SWE
/import/home/rettenbs/src/SWE/src/blocks/SWE_WavePropagationBlock.hh
Go to the documentation of this file.
00001 
00029 #ifndef SWEWAVEPROPAGATIONBLOCK_HH_
00030 #define SWEWAVEPROPAGATIONBLOCK_HH_
00031 
00032 #include "blocks/SWE_Block.hh"
00033 #ifdef DYNAMIC_DISPLACEMENTS
00034 #include "scenarios/Asagi.hpp"
00035 #endif
00036 #include "tools/help.hh"
00037 
00038 #include <string>
00039 
00040 //which wave propagation solver should be used
00041 //  0: Hybrid
00042 //  1: f-Wave
00043 //  2: Approximate Augmented Riemann solver
00044 //  3: Approximate Augmented Riemann solver which uses the underlying Fortran routines of GeoClaw directly.
00045 #if WAVE_PROPAGATION_SOLVER==1
00046 #include "solvers/FWave.hpp"
00047 #elif WAVE_PROPAGATION_SOLVER==2
00048 #include "solvers/AugRie.hpp"
00049 #elif WAVE_PROPAGATION_SOLVER==3
00050 #include "solvers/AugRieGeoClaw.hpp"
00051 #elif WAVE_PROPAGATION_SOLVER==4
00052 #include "solvers/FWaveVec.hpp"
00053 #else
00054 #include "solvers/Hybrid.hpp"
00055 #endif
00056 
00065 class SWE_WavePropagationBlock: public SWE_Block {
00066 //private:
00067   //OpenMp: Every task defines it own solver -> SWE_WavePropagationBlock.cpp
00068 #ifndef LOOP_OPENMP
00069     //specify the wave propagation solver
00070 #if WAVE_PROPAGATION_SOLVER==1
00071 
00072     solver::FWave<float> wavePropagationSolver;
00073 #elif WAVE_PROPAGATION_SOLVER==2
00074 
00075     solver::AugRie<float> wavePropagationSolver;
00076 #elif WAVE_PROPAGATION_SOLVER==3
00077 
00078     solver::AugRieGeoClaw<double> wavePropagationSolver;
00079 #elif WAVE_PROPAGATION_SOLVER==4
00080 
00081     solver::FWaveVec<float> wavePropagationSolver;
00082 #else
00083 
00084     solver::Hybrid<float> wavePropagationSolver;
00085 #endif
00086 #endif
00087 
00089     Float2D hNetUpdatesLeft;
00091     Float2D hNetUpdatesRight;
00092 
00094     Float2D huNetUpdatesLeft;
00096     Float2D huNetUpdatesRight;
00097 
00098     #if WAVE_PROPAGATION_SOLVER==3
00099 
00100     Float2D hvNetUpdatesLeft;
00102     Float2D hvNetUpdatesRight;
00103     #endif
00104 
00106     Float2D hNetUpdatesBelow;
00108     Float2D hNetUpdatesAbove;
00109 
00111     Float2D hvNetUpdatesBelow;
00113     Float2D hvNetUpdatesAbove;
00114 
00115     #if WAVE_PROPAGATION_SOLVER==3
00116 
00117     Float2D huNetUpdatesBelow;
00119     Float2D huNetUpdatesAbove;
00120     #endif
00121 
00122   public:
00123     //constructor of a SWE_WavePropagationBlock.
00124     SWE_WavePropagationBlock(int l_nx, int l_ny,
00125                                         float l_dx, float l_dy);
00126 
00127     //executes a single timestep.
00128     virtual void simulateTimestep(float dt);
00129 
00130     //computes the net-updates for the block
00131     void computeNumericalFluxes();
00132 
00133     //update the cells
00134     void updateUnknowns(float dt);
00135 
00136     //runs the simulation until i_tEnd is reached.
00137     float simulate(float i_tStart, float i_tEnd);
00138 
00139     //updates the bathymetry with the current displacment values
00140 #ifdef DYNAMIC_DISPLACEMENTS
00141     bool updateBathymetryWithDynamicDisplacement(scenarios::Asagi &i_asagiScenario, float time);
00142 #endif
00143 
00149     virtual ~SWE_WavePropagationBlock() {}
00150 };
00151 
00152 #endif /* SWEWAVEPROPAGATIONBLOCK_HH_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends