00001
00002
00003
00004
00005
00006 #ifndef LBM_BASE_H
00007 #define LBM_BASE_H
00008
00016 #include "Interfaces/SchemeBase.h"
00017
00024 template <class micro_type, class macro_type, int dim>
00025 class LBMBase : public SchemeBase<micro_type,dim> {
00026 typedef SchemeBase<micro_type,dim> base;
00027 public:
00028 typedef micro_type MicroType;
00029 typedef macro_type MacroType;
00030 typedef typename base::DataType DataType;
00031 typedef typename base::vec_grid_data_type vec_grid_data_type;
00032
00033 enum Scaling { Physical, Lattice };
00034
00035 LBMBase() : base(), _MacroVariables(MacroType::Length()), L0(1.), T0(1.) {}
00036
00037 virtual ~LBMBase() {}
00038
00039
00040
00041
00042
00043 virtual MacroType MacroVariables(const MicroType &f) const = 0;
00044 virtual MicroType Equilibrium(const MacroType &q) const = 0;
00045 virtual void LocalStep(vec_grid_data_type &fvec, vec_grid_data_type &ovec,
00046 const BBox &bb, const double& dt) const = 0;
00047 virtual void ReverseStream(vec_grid_data_type &fvec, const BBox &bb,
00048 const int side) const = 0;
00049 virtual int IncomingIndices(const int side, int indices[]) const = 0;
00050 virtual int OutgoingIndices(const int side, int indices[]) const = 0;
00051 virtual inline const DataType Omega(const DataType dt) const = 0;
00052
00053
00054 virtual bool GFMUseTransform() const { return false; }
00055 virtual void GFMTransform(vec_grid_data_type &fvec, vec_grid_data_type &fvechelp) const {}
00056
00057 virtual int NMaxPass() const { return 0; }
00058 virtual inline void SetLengthScale(const DataType l0) { L0 = l0; }
00059 virtual inline void SetTimeScale(const DataType t0) { T0 = t0; }
00060
00061 inline const DataType& LengthScale() const { return L0; }
00062 inline const DataType& TimeScale() const { return T0; }
00063
00064 inline const int& NMicroVar() const { return base::NEquations(); }
00065 inline const int& NMacroVar() const { return _MacroVariables; }
00066
00067
00068 protected:
00069 int _MacroVariables;
00070 DataType L0, T0;
00071 };
00072
00073
00074 #endif