SWE
/import/home/rettenbs/src/SWE/src/scenarios/SWE_simple_scenarios.hh
Go to the documentation of this file.
00001 
00029 #ifndef __SWE_SIMPLE_SCENARIOS_H
00030 #define __SWE_SIMPLE_SCENARIOS_H
00031 
00032 #include <cmath>
00033 
00034 #include "SWE_Scenario.hh"
00035 
00040 class SWE_RadialDamBreakScenario : public SWE_Scenario {
00041 
00042   public:
00043 
00044     float getBathymetry(float x, float y) {
00045        return -250.f;
00046     };
00047 
00048     float getWaterHeight(float x, float y) { 
00049        return ( sqrt( (x-500.f)*(x-500.f) + (y-500.f)*(y-500.f) ) < 100.f ) ? 253.f: 250.0f;
00050     };
00051 
00052         virtual float endSimulation() { return (float) 15; };
00053 
00054     virtual BoundaryType getBoundaryType(BoundaryEdge edge) { return OUTFLOW; };
00055 
00061     float getBoundaryPos(BoundaryEdge i_edge) {
00062        if ( i_edge == BND_LEFT )
00063          return (float)0;
00064        else if ( i_edge == BND_RIGHT)
00065          return (float)1000;
00066        else if ( i_edge == BND_BOTTOM )
00067          return (float)0;
00068        else
00069          return (float)1000;
00070     };
00071 };
00072 
00077 class SWE_BathymetryDamBreakScenario : public SWE_Scenario {
00078 
00079   public:
00080 
00081     float getBathymetry(float x, float y) { 
00082        return ( std::sqrt( (x-500.f)*(x-500.f) + (y-500.f)*(y-500.f) ) < 50.f ) ? -255.f: -260.f;
00083     };
00084     
00085         virtual float endSimulation() { return (float) 15; };
00086 
00087     virtual BoundaryType getBoundaryType(BoundaryEdge edge) { return OUTFLOW; };
00088 
00094     float getBoundaryPos(BoundaryEdge i_edge) {
00095        if ( i_edge == BND_LEFT )
00096          return (float)0;
00097        else if ( i_edge == BND_RIGHT)
00098          return (float)1000;
00099        else if ( i_edge == BND_BOTTOM )
00100          return (float)0;
00101        else
00102          return (float)1000;
00103     };
00104 
00112     float getWaterHeight( float i_positionX,
00113                           float i_positionY ) {
00114       return (float) 260;
00115     }
00116 };
00117 
00124 class SWE_SeaAtRestScenario : public SWE_Scenario {
00125 
00126   public:
00127 
00128     float getWaterHeight(float x, float y) { 
00129        return ( sqrt( (x-0.5)*(x-0.5) + (y-0.5)*(y-0.5) ) < 0.1f ) ? 9.9f: 10.0f;
00130     };
00131     float getBathymetry(float x, float y) { 
00132        return ( sqrt( (x-0.5)*(x-0.5) + (y-0.5)*(y-0.5) ) < 0.1f ) ? 0.1f: 0.0f;
00133     };
00134 
00135 };
00136 
00141 class SWE_SplashingPoolScenario : public SWE_Scenario {
00142 
00143   public:
00144 
00145     float getBathymetry(float x, float y) {
00146        return -250.f;
00147     };
00148 
00149     float getWaterHeight(float x, float y) {
00150         return 250.0f+(5.0f-(x+y)/200);
00151     };
00152 
00153         virtual float endSimulation() { return (float) 15; };
00154 
00160     float getBoundaryPos(BoundaryEdge i_edge) {
00161        if ( i_edge == BND_LEFT )
00162          return (float)0;
00163        else if ( i_edge == BND_RIGHT)
00164          return (float)1000;
00165        else if ( i_edge == BND_BOTTOM )
00166          return (float)0;
00167        else
00168          return (float)1000;
00169     };
00170 
00171 };
00172 
00179 class SWE_SplashingConeScenario : public SWE_Scenario {
00180 
00181   public:
00182 
00183     float getWaterHeight(float x, float y) { 
00184        float r = sqrt( (x-0.5f)*(x-0.5f) + (y-0.5f)*(y-0.5f) );
00185        float h = 4.0f-4.5f*(r/0.5f);
00186 
00187        if (r<0.1f) h = h+1.0f;
00188 
00189        return (h>0.0f) ? h : 0.0f;
00190     };
00191 
00192     float getBathymetry(float x, float y) { 
00193        float r = sqrt( (x-0.5f)*(x-0.5f) + (y-0.5f)*(y-0.5f) );
00194        return 1.0f+9.0f*( (r < 0.5f) ? r : 0.5f);
00195     };
00196     
00197     float waterHeightAtRest() { return 4.0f; };
00198     float endSimulation() { return 0.5f; };
00199 
00200     virtual BoundaryType getBoundaryType(BoundaryEdge edge) { return OUTFLOW; };
00201 };
00202 
00203 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends