stabilization.h

Go to the documentation of this file.
00001 #ifndef __stabilization_h
00002 #define __stabilization_h
00003 
00004 #include "nvector.h"
00005 
00006 /*-------------------------------------------*/
00007 
00008 namespace Gascoigne
00009 {
00010   class Stabilization
00011 {
00012  protected:
00013 
00014   double _alpha, _h, dt, _dtfactor, _norm;
00015 
00016   void norm(double u, double v)
00017     { 
00018       _norm = sqrt(u*u+v*v)+1e-6; 
00019     }
00020   void norm(double u, double v, double w) 
00021     { 
00022       _norm = sqrt(u*u+v*v+w*w)+1e-6; 
00023     }
00024 
00025  public:
00026 
00027   Stabilization() : dt(0.), _dtfactor(1.), _norm(0.), alpha0(0.2), xeta0(6.) {}
00028   ~Stabilization() {}
00029 
00030   double alpha0, xeta0;
00031 
00032   double& DeltaT()           { return dt;}
00033   double  DeltaT()     const { return dt;}
00034   double  alpha()      const { return _alpha;}
00035   double& alpha()            { return _alpha;}
00036   double  h()          const { return _h;}
00037   double& dtfactor()         { return _dtfactor; }
00038   void    SetConvection(double u, double v)           { norm(u,v);}    
00039   void    SetConvection(double u, double v, double w) { norm(u,v,w);}    
00040 
00041   void ReInit(double h, double visc)
00042     {
00043       _h = h;
00044       _alpha = alpha0 *h*h / (xeta0 * visc);
00045     }
00046 };
00047 }
00048 
00049 #endif

Generated on Thu Sep 14 10:34:38 2006 for Gascoigne by  doxygen 1.4.7