SWE
/import/home/rettenbs/src/SWE/src/blocks/rusanov/SWE_RusanovBlock.hh
Go to the documentation of this file.
00001 
00028 #ifndef __SWE_RUSANOVBLOCK_HH
00029 #define __SWE_RUSANOVBLOCK_HH
00030 
00031 #include <iostream>
00032 #include <stdio.h>
00033 #include <fstream>
00034 
00035 #include "tools/help.hh"
00036 #include "SWE_Block.hh"
00037 
00038 
00039 using namespace std;
00040 
00046 class SWE_RusanovBlock : public SWE_Block {
00047 
00048   public:
00049     // Constructor und Destructor
00050     SWE_RusanovBlock(float _offsetX = 0, float _offsetY = 0);
00051     virtual ~SWE_RusanovBlock();
00052     
00053   // object methods
00055     virtual void simulateTimestep(float dt);
00057     virtual float simulate(float tStart, float tEnd);
00058     
00060     virtual void computeNumericalFluxes();
00062     virtual void updateUnknowns(float dt);
00063 
00064   protected:
00065      
00067     virtual void computeBathymetrySources();
00068 
00069     static float computeFlux(float fLoc, float fNeigh, float xiLoc, float xiNeigh, float llf);
00070     float computeLocalSV(int i, int j, char dir);
00071 
00072     // compute the largest allowed time step for the current grid block
00073     virtual void computeMaxTimestep() {
00074        SWE_Block::computeMaxTimestep();
00075        // more pessimistic choice of the time step
00076        maxTimestep *= 0.5; 
00077     };
00078 
00079     // define additional arrays for temporary unknowns: 
00080     // - arrays to hold the values of the flux terms at cell edges
00081     Float2D Fh;
00082     Float2D Fhu;
00083     Float2D Fhv;
00084     Float2D Gh;
00085     Float2D Ghu;
00086     Float2D Ghv;
00087     // - arrays to hold the bathymetry source terms for the hu and hv equations
00088     Float2D Bx;
00089     Float2D By;
00090     
00091     // overload operator<< such that data can be written via cout <<
00092     // -> needs to be declared as friend to be allowed to access private data
00093     friend ostream& operator<< (ostream& os, const SWE_RusanovBlock& swe);
00094   
00095 };
00096 
00097 ostream& operator<< (ostream& os, const SWE_RusanovBlock& swe);
00098 
00099 
00100 
00101 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends