00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _AMRLEVELPOLYTROPICGAS_H_
00012 #define _AMRLEVELPOLYTROPICGAS_H_
00013
00014 #include "FArrayBox.H"
00015 #include "LevelData.H"
00016 #include "AMRLevel.H"
00017 #include "CoarseAverage.H"
00018 #include "FineInterp.H"
00019 #include "LevelFluxRegister.H"
00020 #include "Box.H"
00021 #include "IntVectSet.H"
00022 #include "Vector.H"
00023 #include "DisjointBoxLayout.H"
00024
00025 #include "LevelGodunov.H"
00026 #include "PhysIBC.H"
00027
00028 #include "UsingNamespace.H"
00029
00031
00033 class AMRLevelPolytropicGas: public AMRLevel
00034 {
00035 public:
00037
00039 AMRLevelPolytropicGas();
00040
00042
00044 virtual ~AMRLevelPolytropicGas();
00045
00047
00049 void defineParams(const Real& a_cfl,
00050 const Real& a_domainLength,
00051 const int& a_verbosity,
00052 const Real& a_refineThresh,
00053 const int& a_tagBufferSize,
00054 const Real& a_initialDtMultiplier,
00055 const GodunovPhysics* const a_godunovPhysics,
00056 const int& a_normalPredOrder,
00057 const bool& a_useFourthOrderSlopes,
00058 const bool& a_usePrimLimiting,
00059 const bool& a_useCharLimiting,
00060 const bool& a_useFlattening,
00061 const bool& a_useArtificialViscosity,
00062 const Real& a_artificialViscosity,
00063 const bool& a_useSourceTerm,
00064 const Real& a_sourceTermScaling,
00065 const bool& a_highOrderLimiter);
00066
00068
00070 virtual void define(AMRLevel* a_coarserLevelPtr,
00071 const Box& a_problemDomain,
00072 int a_level,
00073 int a_refRatio);
00074
00076
00078 virtual void define(AMRLevel* a_coarserLevelPtr,
00079 const ProblemDomain& a_problemDomain,
00080 int a_level,
00081 int a_refRatio);
00082
00084
00086 virtual Real advance();
00087
00089
00091 virtual void postTimeStep();
00092
00094
00096 virtual void tagCells(IntVectSet& a_tags);
00097
00099
00101 virtual void tagCellsInit(IntVectSet& a_tags);
00102
00104
00106 virtual void regrid(const Vector<Box>& a_newGrids);
00107
00109
00111 virtual void initialGrid(const Vector<Box>& a_newGrids);
00112
00114
00116 virtual void initialData();
00117
00119
00121 virtual void postInitialize();
00122
00123 #ifdef CH_USE_HDF5
00125
00127 virtual void writeCheckpointHeader(HDF5Handle& a_handle) const;
00128
00130
00132 virtual void writeCheckpointLevel(HDF5Handle& a_handle) const;
00133
00135
00137 virtual void readCheckpointHeader(HDF5Handle& a_handle);
00138
00140
00142 virtual void readCheckpointLevel(HDF5Handle& a_handle);
00143
00145
00147 virtual void writePlotHeader(HDF5Handle& a_handle) const;
00148
00150
00152 virtual void writePlotLevel(HDF5Handle& a_handle) const;
00153 #endif
00154
00156
00158 virtual Real computeDt();
00159
00161
00163 virtual Real computeInitialDt();
00164
00166 const LevelData<FArrayBox>& getStateNew() const;
00167
00169 const LevelData<FArrayBox>& getStateOld() const;
00170
00172 bool allDefined() const;
00173
00174
00175 protected:
00176
00177 DisjointBoxLayout loadBalance(const Vector<Box>& a_grids);
00178
00179
00180 void levelSetup();
00181
00182
00183 AMRLevelPolytropicGas* getCoarserLevel() const;
00184
00185
00186 AMRLevelPolytropicGas* getFinerLevel() const;
00187
00188
00189 LevelData<FArrayBox> m_UOld,m_UNew;
00190
00191
00192 Real m_cfl;
00193
00194
00195 Real m_dx;
00196
00197
00198 FineInterp m_fineInterp;
00199
00200
00201 CoarseAverage m_coarseAverage;
00202
00203
00204 Real m_dtNew;
00205
00206
00207 int m_numStates;
00208
00209
00210 Vector<string> m_stateNames;
00211
00212
00213 int m_numGhost;
00214
00215
00216 Real m_domainLength;
00217
00218
00219 LevelGodunov m_levelGodunov;
00220
00221
00222 LevelFluxRegister m_fluxRegister;
00223
00224
00225 GodunovPhysics* m_gdnvPhysics;
00226
00227
00228 int m_normalPredOrder;
00229
00230
00231 bool m_useFourthOrderSlopes;
00232
00233
00234 bool m_usePrimLimiting;
00235 bool m_useCharLimiting;
00236
00237
00238 bool m_useFlattening;
00239
00240
00241 bool m_useArtificialViscosity;
00242 Real m_artificialViscosity;
00243
00244
00245 bool m_useSourceTerm;
00246 Real m_sourceTermScaling;
00247
00248
00249 bool m_highOrderLimiter;
00250
00251
00252 Real m_refineThresh;
00253
00254
00255 int m_tagBufferSize;
00256
00257
00258 bool m_hasCoarser;
00259 bool m_hasFiner;
00260
00261
00262 DisjointBoxLayout m_grids;
00263
00264
00265 bool m_paramsDefined;
00266
00267
00268 private:
00269
00270 void operator=(const AMRLevelPolytropicGas& a_input)
00271 {
00272 MayDay::Error("invalid operator");
00273 }
00274
00275
00276 AMRLevelPolytropicGas(const AMRLevelPolytropicGas& a_input)
00277 {
00278 MayDay::Error("invalid operator");
00279 }
00280 };
00281
00282 #endif