00001
00002
00003
00004
00005
00006 #ifndef AMROC_LBM_STD_PROBLEM_H
00007 #define AMROC_LBM_STD_PROBLEM_H
00008
00016 typedef LBMType::MicroType MicroType;
00017 typedef Vector<DataType,0> FixupType;
00018
00019 #ifndef OWN_LBMSCHEME
00020 class LBMSpecific : public LBMType {
00021 public:
00022 LBMSpecific() : LBMType() {}
00023 };
00024 #endif
00025
00026 #ifndef OWN_INTEGRATOR
00027 class IntegratorSpecific : public LBMIntegrator<LBMType,DIM> {
00028 public:
00029 IntegratorSpecific(LBMType &lbm) : LBMIntegrator<LBMType,DIM>(lbm) {}
00030 };
00031 #endif
00032
00033 #ifndef OWN_FIXUP
00034 class FixupSpecific :
00035 public LBMFixup<LBMType,FixupType,DIM> {
00036 public:
00037 FixupSpecific(LBMType &lbm) : LBMFixup<LBMType,FixupType,DIM>(lbm) {}
00038 };
00039 #endif
00040
00041 #ifndef OWN_INITIALCONDITION
00042 class InitialConditionSpecific : public LBMInitialCondition<LBMType,DIM> {
00043 public:
00044 InitialConditionSpecific(LBMType &lbm) : LBMInitialCondition<LBMType,DIM>(lbm) {}
00045 };
00046 #endif
00047
00048 #ifndef OWN_BOUNDARYCONDITION
00049 class BoundaryConditionsSpecific : public LBMBoundaryConditions<LBMType,DIM> {
00050 public:
00051 BoundaryConditionsSpecific(LBMType &lbm) : LBMBoundaryConditions<LBMType,DIM>(lbm) {}
00052 };
00053 #endif
00054
00055 #ifndef OWN_FLAGGING
00056 class FlaggingSpecific :
00057 public AMRFlagging<MicroType,FixupType,FlagType,DIM> {
00058 typedef AMRFlagging<MicroType,FixupType,FlagType,DIM> base;
00059 public:
00060 FlaggingSpecific(base::solver_type& solver, LBMType &lbm) : base(solver) {
00061 base::AddCriterion(new FlagRegions<MicroType,FlagType,DIM>());
00062 base::AddCriterion(new ByValue<MicroType,FlagType,DIM>());
00063 base::AddCriterion(new ScaledGradient<MicroType,FlagType,DIM>());
00064 base::AddCriterion(new LimiterType<MicroType,FlagType,DIM>());
00065 base::AddCriterion(new AbsoluteError<MicroType,FixupType,FlagType,DIM>(solver));
00066 base::AddCriterion(new RelativeError<MicroType,FixupType,FlagType,DIM>(solver));
00067
00068 base::AddCriterion(new SchemeByValue<LBMType,FlagType,DIM>(lbm));
00069 base::AddCriterion(new SchemeScaledGradient<LBMType,FlagType,DIM>(lbm));
00070 base::AddCriterion(new SchemeLimiterType<LBMType,FlagType,DIM>(lbm));
00071 base::AddCriterion(new SchemeAbsoluteError<LBMType,FixupType,FlagType,DIM>(solver,lbm));
00072 base::AddCriterion(new SchemeRelativeError<LBMType,FixupType,FlagType,DIM>(solver,lbm));
00073 }
00074
00075 ~FlaggingSpecific() { DeleteAllCriterions(); }
00076
00077 virtual void init() {
00078 base::init();
00079 base::AddCriterion(new UnflagRegions<MicroType,FlagType,DIM>());
00080 }
00081 };
00082 #endif
00083
00084 #ifndef OWN_AMRSOLVER
00085 class SolverSpecific :
00086 public AMRSolver<MicroType,FixupType,FlagType,DIM> {
00087 typedef AMRSolver<MicroType,FixupType,FlagType,DIM> base;
00088 public:
00089 SolverSpecific(IntegratorSpecific& integ,
00090 base::initial_condition_type& init,
00091 base::boundary_conditions_type& bc) : base(integ, init, bc) {
00092 SetLevelTransfer(new LBMF77LevelTransfer<LBMType,DIM>(integ.Scheme(), f_prolong, f_restrict));
00093 SetFileOutput(new SchemeFileOutput<LBMType,DIM>(integ.Scheme()));
00094 SetFixup(new FixupSpecific(integ.Scheme()));
00095 SetFlagging(new FlaggingSpecific(*this,integ.Scheme()));
00096 }
00097
00098 ~SolverSpecific() {
00099 delete _LevelTransfer;
00100 delete _Flagging;
00101 delete _Fixup;
00102 delete _FileOutput;
00103 }
00104
00105 virtual void SetupData() {
00106 base::SetupData();
00107 base::NAMRTimeSteps = 1;
00108 base::AdaptBndTimeInterpolate = 0;
00109 base::Step[0].LastTime = 1.e37;
00110 base::Step[0].VariableTimeStepping = -1;
00111 base::Step[0].dtv[0] = ((LBMIntegrator<LBMType,DIM> &)Integrator_()).LBM().TimeScale();
00112 }
00113 };
00114 #endif
00115
00116 #ifndef OWN_SOLVERCONTROL
00117 class SolverControlSpecific :
00118 public SolverControl {
00119 typedef SolverControl base;
00120 public:
00121 SolverControlSpecific(base::solver_type& solver) :
00122 base(solver) {}
00123
00124 virtual void update() {
00125 base::update();
00126 base::HitLastTime=0;
00127 }
00128 };
00129 #endif
00130
00131
00132 #endif