00001
00002
00003
00004
00005
00006 #ifndef SCHEME_BASE_H
00007 #define SCHEME_BASE_H
00008
00016 #include "AMRBase.h"
00017
00024 template <class vector_type, int dim>
00025 class SchemeBase : public AMRBase<vector_type,dim> {
00026 typedef AMRBase<vector_type,dim> base;
00027 public:
00028 typedef vector_type VectorType;
00029 typedef typename VectorType::InternalDataType DataType;
00030 typedef typename base::vec_grid_data_type vec_grid_data_type;
00031 typedef GridData<DataType,dim> grid_data_type;
00032 typedef Vector<DataType,dim> point_type;
00033
00034 enum SideName { Left, Right, Bottom, Top, Front, Back };
00035 enum Conversion { Conserved, Primitive };
00036
00037 SchemeBase() : base() {}
00038
00039 virtual ~SchemeBase() {}
00040
00041
00042
00043
00044
00045 virtual double Step(vec_grid_data_type& fvec, vec_grid_data_type& ovec, vec_grid_data_type* Flux[],
00046 const double& t, const double& dt, const int& mpass) const = 0;
00047
00048 virtual void ICStandard(vec_grid_data_type &fvec, const int type, DataType* aux=0, const int naux=0,
00049 const int scaling=0) const = 0;
00050 virtual void BCStandard(vec_grid_data_type &fvec, const BBox &bb, const int type, const int side,
00051 DataType* aux=0, const int naux=0, const int scaling=0) const = 0;
00052
00053 virtual bool GFMUseTransform() const = 0;
00054 virtual void GFMTransform(vec_grid_data_type &fvec, vec_grid_data_type &fvechelp) const = 0;
00055 virtual void GFMBCStandard(vec_grid_data_type &fvec, const int type, const int& nc, const int* idx,
00056 const VectorType* f, const point_type* xc, const DataType* distance,
00057 const point_type* normal, DataType* aux=0, const int naux=0,
00058 const int scaling=0) const = 0;
00059
00060 virtual void Input(vec_grid_data_type& fvec, grid_data_type& work, const int cnt,
00061 const int skip_ghosts=1) const = 0;
00062 virtual void Output(vec_grid_data_type& fvec, grid_data_type& work, const int cnt,
00063 const int skip_ghosts=1) const = 0;
00064 virtual int Check(vec_grid_data_type& fvec, const BBox &bb, const double& time,
00065 const int verbose) const = 0;
00066 virtual int NMethodOrder() const = 0;
00067 virtual int NMaxPass() const = 0;
00068
00069
00070 inline int idx(const int i) const { return (i); }
00071 inline int idx(const int i, const int j, const int Nx) const { return (i+Nx*j); }
00072 inline int idx(const int i, const int j, const int k, const int Nx, const int Ny) const { return (i+Nx*(j+Ny*k)); }
00073 };
00074
00075
00076 #endif