Blockstructured Adaptive Mesh Refinement in object-oriented C++
00001 #ifndef AMROC_PROBLEM_H 00002 #define AMROC_PROBLEM_H 00003 00004 #include "euler2.h" 00005 00006 typedef Vector(NAUX)<Data_type> Aux_type; 00007 typedef Vector(NFIXUP)<Data_type> Fixup_type; 00008 typedef short Flag_type; 00009 00010 00011 class IntegratorSpecific : 00012 public ClpIntegrator(DIM)<Vector_type,Aux_type> { 00013 public: 00014 IntegratorSpecific() : 00015 ClpIntegrator(DIM)<Vector_type,Aux_type>(NEQUSED,NWAVES,GHOSTWIDTH) {} 00016 }; 00017 00018 class InitialConditionSpecific : 00019 public ClpInitialCondition(DIM)<Vector_type> { 00020 public: 00021 InitialConditionSpecific() : 00022 ClpInitialCondition(DIM)<Vector_type>(GHOSTWIDTH) {} 00023 }; 00024 00025 class BoundaryConditionsSpecific : 00026 public ClpBoundaryConditions(DIM)<Vector_type> { 00027 public: 00028 BoundaryConditionsSpecific() : 00029 ClpBoundaryConditions(DIM)<Vector_type>(GHOSTWIDTH) {} 00030 }; 00031 00032 class FixupSpecific : 00033 public ClpFixup(DIM)<Vector_type,Fixup_type,Aux_type> { 00034 public: 00035 FixupSpecific(ClpIntegrator(DIM)<Vector_type,Aux_type>& integ) : 00036 ClpFixup(DIM)<Vector_type,Fixup_type,Aux_type>(integ) {} 00037 }; 00038 00039 class FlaggingSpecific : 00040 public AMRFlagging(DIM)<Vector_type,Fixup_type,Flag_type> { 00041 typedef Vector_type::InternalDataType Data_type; 00042 typedef GridFunction(DIM)<Data_type> gr_fct_type; 00043 public: 00044 FlaggingSpecific(AMRSolver(DIM)<Vector_type,Fixup_type,Flag_type>& solver) : 00045 AMRFlagging(DIM)<Vector_type,Fixup_type,Flag_type>(solver) {} 00046 00047 virtual void FlagByDifference(const int Time, const int Level, gr_fct_type &u, 00048 Data_type TolSp, Flag_type FlagValue) { 00049 if (TolSp <= 0.0) return; 00050 int East[2] = { 1, 0 }; int West[2] = { -1, 0 }; 00051 int North[2] = { 0, 1 }; int South[2] = { 0, -1 }; 00052 FlagInDirection(Time, Level, u, East, West, TolSp, FlagValue); 00053 FlagInDirection(Time, Level, u, North, South, TolSp, FlagValue); 00054 } 00055 }; 00056 00057 class SolverSpecific : 00058 public AMRSolver(DIM)<Vector_type,Fixup_type,Flag_type> { 00059 public: 00060 SolverSpecific(ClpIntegrator(DIM)<Vector_type,Aux_type>& integ, 00061 ClpInitialCondition(DIM)<Vector_type>& init, 00062 ClpBoundaryConditions(DIM)<Vector_type>& bc) : 00063 AMRSolver(DIM)<Vector_type,Fixup_type,Flag_type>(integ, init, bc) { 00064 SetFlagging(new FlaggingSpecific(*this)); 00065 SetFixup(new FixupSpecific(integ)); 00066 } 00067 00068 ~SolverSpecific() { 00069 delete _Flagging; 00070 delete _Fixup; 00071 } 00072 }; 00073 00074 class SolverControlSpecific : 00075 public AMRSolverControl(DIM)<Vector_type,Fixup_type,Flag_type> { 00076 public: 00077 SolverControlSpecific(AMRSolver(DIM)<Vector_type,Fixup_type,Flag_type>& solver) : 00078 AMRSolverControl(DIM)<Vector_type,Fixup_type,Flag_type>(solver) {} 00079 }; 00080 00081 00082 #endif 00083
Quickstart Users Guide Programmers Reference Installation Examples Download
AMROC Main Home Contactlast update: 06/01/04