SWE
/import/home/rettenbs/src/SWE/submodules/swe_solvers/src/solver/WavePropagation.hpp
00001 
00018 #ifndef WAVEPROPAGATIONSOLVER_HPP_
00019 #define WAVEPROPAGATIONSOLVER_HPP_
00020 
00021 namespace solver {
00022   template <typename T> class WavePropagation;
00023 }
00024 
00030 template <typename T> class solver::WavePropagation {
00031   protected:
00032     //global variables
00034     T dryTol;
00036     const T g;
00038     const T zeroTol;
00039 
00040 #if 0
00041     //parameters for computeNetUpdates
00042     T h[2];
00043     T hu[2];
00044     T b[2];
00045     T u[2];
00046 
00047 #define hLeft  (h[0])
00048 #define hRight (h[1])
00049 
00050 #define huLeft  (hu[0])
00051 #define huRight (hu[1])
00052 
00053 #define bLeft  (b[0])
00054 #define bRight (b[1])
00055 
00056 #define uLeft  (u[0])
00057 #define uRight (u[1])
00058 
00059 #else
00060     //edge-local variables
00062     T hLeft;
00064     T hRight;
00066     T huLeft;
00068     T huRight;
00070     T bLeft;
00072     T bRight;
00073 
00075     T uLeft;
00077     T uRight;
00078 #endif
00079 
00083     enum WetDryState {
00084       DryDry,               
00085       WetWet,               
00086       WetDryInundation,     
00087       WetDryWall,           
00089       WetDryWallInundation, 
00091       DryWetInundation,     
00092       DryWetWall,           
00094       DryWetWallInundation  
00096     };
00097 
00099     WetDryState wetDryState;
00100 
00101 
00103     virtual void determineWetDryState() = 0;
00104 
00112     WavePropagation( T i_dryTolerance,
00113                      T i_gravity,
00114                      T i_zeroTolerance ):
00115                        dryTol(i_dryTolerance),
00116                        g(i_gravity),
00117                        zeroTol(i_zeroTolerance) {};
00118 
00129     inline void storeParameters( const T &i_hLeft,  const T &i_hRight,
00130                                  const T &i_huLeft, const T &i_huRight,
00131                                  const T &i_bLeft,  const T &i_bRight ) {
00132       //store parameters to member variables
00133       hLeft = i_hLeft;
00134       hRight = i_hRight;
00135 
00136       huLeft = i_huLeft;
00137       huRight = i_huRight;
00138 
00139       bLeft = i_bLeft;
00140       bRight = i_bRight;
00141     }
00142 
00155     inline void storeParameters( const T &i_hLeft,  const T &i_hRight,
00156                                  const T &i_huLeft, const T &i_huRight,
00157                                  const T &i_bLeft,  const T &i_bRight,
00158                                  const T &i_uLeft,  const T &i_uRight) {
00159       //store parameters to member variables
00160       storeParameters( i_hLeft,  i_hRight,
00161                        i_huLeft, i_huRight,
00162                        i_bLeft,  i_bRight );
00163 
00164       uLeft = i_uLeft;
00165       uRight = i_uRight;
00166     }
00167 
00168   public:
00186     virtual void computeNetUpdates ( const T &i_hLeft,  const T &i_hRight,
00187                                      const T &i_huLeft, const T &i_huRight,
00188                                      const T &i_bLeft,  const T &i_bRight,
00189 
00190                                      T &o_hUpdateLeft,
00191                                      T &o_hUpdateRight,
00192                                      T &o_huUpdateLeft,
00193                                      T &o_huUpdateRight,
00194                                      T &o_maxWaveSpeed ) = 0;
00195 
00201     void setDryTolerance( const T i_dryTolerance ) {
00202       dryTol = i_dryTolerance;
00203     }
00204 
00205     virtual ~WavePropagation() {};
00206 
00207 
00208 #undef hLeft
00209 #undef hRight
00210 
00211 #undef huLeft
00212 #undef huRight
00213 
00214 #undef bLeft
00215 #undef bRight
00216 
00217 #undef uLeft
00218 #undef uRight
00219 };
00220 
00221 #endif /* WAVEPROPAGATIONSOLVER_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends