I will list the files in the project to understand the structure and available packages.
I will read package.json to see the dependencies installed in the project.
I will install lucide-react, three, and @types/three using the install_npm_packages tool.
I will read index.html to inspect its structure and title.
I will update index.html with a descriptive title for the Tsunami Propagation Laboratory and add styling for dark mode support.
I will read src/index.css to check the styling setup.
I will update src/index.css to add custom font utilities and scrollbar styles for a polished laboratory UI.
I will create src/types/tsunami.ts to define the TypeScript interfaces for simulation parameters, bathymetry grids, coastal cities, playback states, and experiment logs.
I will create src/simulation/BathymetryPresets.ts containing procedural generators for realistic ocean basins, trenches, continental shelves, fjords, and seamount waveguides.
I will remove the unused import CoastalCity in src/simulation/BathymetryPresets.ts.
I will create src/simulation/TsunamiEngine.ts to implement the 2D Shallow Water Equation finite-difference PDE solver, Okada dipole fault deformation, absorbing sponge boundaries, and coastal city ETA tracking.
I will create src/components/Navbar.tsx for preset selection, switching between 3D, 2D heatmap, cross-section, and comparison views, and opening the physics theory guide.
I will create src/components/ControlPanel.tsx to manage earthquake parameters (magnitude, depth, strike angle, epicenter coordinates), display energy equivalents, and control terrain editing tools.
I will create src/components/CityDashboard.tsx to monitor coastal cities in real time, displaying ETA countdowns, alert levels, and peak wave run-up heights.
I will create src/components/PlaybackControls.tsx for timeline scrubbing, play/pause controls, stepping frame-by-frame, and adjusting slow-motion speeds.
I will update src/components/PlaybackControls.tsx to display the exact historical timestamp when scrubbing through past simulation snapshots.
I will create src/components/views/ThreeView.tsx to render the interactive 3D bathymetry mesh, translucent wave surface, epicenter fault line, and city markers using Three.js and OrbitControls.
I will remove the unused variables and imports from src/components/views/ThreeView.tsx.
I will check and remove the unused halfWidth variable in src/components/views/ThreeView.tsx.
I will create src/components/views/HeatmapView.tsx to render the 2D top-down heatmap, support epicenter dragging, provide real-time terrain brush editing, and display coastal city overlays.
I will replace the unescaped > characters in JSX with > in src/components/views/HeatmapView.tsx.
I will remove the unused icons from src/components/views/HeatmapView.tsx.
I will create src/components/views/CrossSectionView.tsx to display real-time 2D cross-section slice graphs between the epicenter and coastal cities, demonstrating shoaling and Green's Law.
I will remove the unused Compass import from src/components/views/CrossSectionView.tsx.
I will create src/components/views/ComparisonView.tsx to display saved experiment logs, benchmark peak wave heights across different simulation runs, and analyze the impact of earthquake parameters and terrain modifications.
I will create src/components/GuideModal.tsx to provide comprehensive educational documentation on tsunami physics, shallow water equations, Okada fault mechanics, and early warning systems.
I will remove the unused Zap import from src/components/GuideModal.tsx.
I will create src/App.tsx to integrate all components, manage simulation loop updates, handle preset switching, and provide experiment logging.
I will remove the unused React import from src/App.tsx.
I will now build the project using build_project to verify that there are no compilation or type errors.
我已经完成了**海啸传播可视化实验室(Tsunami Propagation & Visualization Laboratory)**的开发和构建。以下是核心功能与系统设计的总结:
1. 真实物理驱动与数值解算引擎 (TsunamiEngine.ts)
- Okada 双极位错发震模型:并非固定圆形扩散动画。模拟基于真实俯冲带逆冲断层(Thrust Fault),根据用户设定的震级(Mw 6.5
9.5)、震源深度(550 km)、走向角(Strike Angle)与倾角(Dip Angle),计算上盘隆起(+Uplift)与下盘沉降(-Subsidence)的初始地表偶极变形。
- 2D 浅水波方程有限差分法 (FDTD):在高精度网格上实时求解 ∂t,波速由局部水深决定()。
2. 多维度视图与可视化呈现
- 3D 空间高度场(Three.js):渲染可交互旋转、平移和缩放的海底地形网格与半透明海面波浪。用户可自由调节垂直波高放大倍率,观察波浪向外传播与近岸增高动态。
- 2D 俯视热力图:支持三种渲染模式(波高偏移、能量密度、纯粹地形),可附加海岸线与等深线(200m/5000m)以及波浪速度向量箭标;支持直接在图上拖拽震源调整发震坐标。
- 横截面切片视图:实时绘制震源至目标城市的剖面曲线,直观对比深海高速长波与近岸浅水增高的戏剧性转变。
- 实验对标与参数灵敏度分析中心:用户可随时保存当前模拟结果档案,对比不同参数或地形改造后的峰值波高差异。
3. 沿海城市监测与时间轴控制
- 预警面板:跟踪各类典型地形场景(太平洋俯冲带、环礁群岛、收口峡湾、海底导波岭)下的目标都市,实时显示预计到达时间(ETA 倒计时)、当前水位和历史最高爬升极值,并自动联动四级预警状态(🚨 紧急撤离 / ⚠️ 红色警报 / 🔵 蓝色关注 / 🟢 正常)。
- 时间轴与慢动作:提供播放/暂停、逐帧推进、多档位速率控制(0.1x 极慢放至 5.0x 极速),以及支持对数百个历史快照进行拖动回溯(Scrubbing)功能。
- 地形笔刷工具:用户可使用笔刷在画面中实时隆起海岭、修筑防波堤或挖掘海沟,直观体验人工工程对海啸防护的影响。
项目已运行 npm run build 打包构建成功。
Files built: index.html, src/index.css, src/types/tsunami.ts, src/simulation/BathymetryPresets.ts, src/simulation/TsunamiEngine.ts, src/components/Navbar.tsx, src/components/ControlPanel.tsx, src/components/CityDashboard.tsx, src/components/PlaybackControls.tsx, src/components/views/ThreeView.tsx, src/components/views/HeatmapView.tsx, src/components/views/CrossSectionView.tsx, src/components/views/ComparisonView.tsx, src/components/GuideModal.tsx, src/App.tsx