00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _GODUNOVPHYSICS_H_
00012 #define _GODUNOVPHYSICS_H_
00013
00014 #include <string>
00015 using std::string;
00016
00017 #include "Box.H"
00018 #include "IntVectSet.H"
00019 #include "Vector.H"
00020 #include "PhysIBC.H"
00021 #include "FluxBox.H"
00022
00023 #include "GodunovUtilities.H"
00024 #include "NamespaceHeader.H"
00025
00026 class HDF5HeaderData;
00027
00029
00040 class GodunovPhysics
00041 {
00042 public:
00044
00046 GodunovPhysics();
00047
00049
00051 PhysIBC* getPhysIBC() const;
00052
00054
00056 void setPhysIBC(PhysIBC* a_bc);
00057
00059
00061 virtual ~GodunovPhysics();
00062
00064
00066 virtual void define(const ProblemDomain& a_domain,
00067 const Real& a_dx);
00068
00070
00072 virtual void setCurrentBox(const Box& a_currentBox);
00073
00075
00077 virtual Real getMaxWaveSpeed(const FArrayBox& a_U,
00078 const Box& a_box) = 0;
00079
00081
00083 virtual GodunovPhysics* new_godunovPhysics() const = 0;
00084
00086
00089 virtual int numConserved() = 0;
00090
00092
00095 virtual Vector<string> stateNames() = 0;
00096
00098
00103 virtual int numFluxes() = 0;
00104
00106
00111 virtual void computeUpdate(FArrayBox& a_dU,
00112 FluxBox& a_F,
00113 const FArrayBox& a_U,
00114 const FluxBox& a_WHalf,
00115 const bool& a_useArtificialViscosity,
00116 const Real& a_artificialViscosity,
00117 const Real& a_currentTime,
00118 const Real& a_dx,
00119 const Real& a_dt,
00120 const Box& a_box);
00121
00123
00130 virtual void getFlux(FArrayBox& a_flux,
00131 const FArrayBox& a_WHalf,
00132 const int& a_dir,
00133 const Box& a_box);
00134
00136
00139 virtual bool isDefined() const;
00140
00142
00147 virtual int numPrimitives() = 0;
00148
00150
00158 virtual void charAnalysis(FArrayBox& a_dW,
00159 const FArrayBox& a_W,
00160 const int& a_dir,
00161 const Box& a_box) = 0;
00162
00164
00172 virtual void charSynthesis(FArrayBox& a_dW,
00173 const FArrayBox& a_W,
00174 const int& a_dir,
00175 const Box& a_box) = 0;
00176
00178
00185 virtual void charValues(FArrayBox& a_lambda,
00186 const FArrayBox& a_W,
00187 const int& a_dir,
00188 const Box& a_box) = 0;
00189
00191
00196 virtual void incrementSource(FArrayBox& a_S,
00197 const FArrayBox& a_W,
00198 const Box& a_box) = 0;
00199
00201
00205 virtual void riemann(
00206 FArrayBox& a_WStar,
00208 const FArrayBox& a_WLeft,
00210 const FArrayBox& a_WRight,
00212 const FArrayBox& a_W,
00214 const Real& a_time,
00216 const int& a_dir,
00218 const Box& a_box) = 0;
00219
00221
00225 virtual void postNormalPred(FArrayBox& a_dWMinus,
00226 FArrayBox& a_dWPlus,
00227 const FArrayBox& a_W,
00228 const Real& a_dt,
00229 const Real& a_dx,
00230 const int& a_dir,
00231 const Box& a_box) = 0;
00232
00234
00236 virtual void quasilinearUpdate(FArrayBox& a_AdWdx,
00237 const FArrayBox& a_wHalf,
00238 const FArrayBox& a_W,
00239 const Real& a_scale,
00240 const int& a_dir,
00241 const Box& a_box) = 0;
00242
00244
00246 virtual void consToPrim(FArrayBox& a_W,
00247 const FArrayBox& a_U,
00248 const Box& a_box) = 0;
00249
00251
00256 virtual Interval velocityInterval() = 0;
00257
00259
00263 virtual int pressureIndex() = 0;
00264
00266
00271 virtual Real smallPressure() = 0;
00272
00274
00279 virtual int bulkModulusIndex() = 0;
00280
00282
00286 virtual void artVisc(FArrayBox& a_F,
00287 const FArrayBox& a_U,
00288 const Real& a_artificialViscosity,
00289 const Real& a_currentTime,
00290 const int& a_dir,
00291 const Box& a_box);
00292
00293 #ifdef CH_USE_HDF5
00294 virtual void expressions(HDF5HeaderData& a_holder) const {;}
00295 #endif
00296
00297
00298 protected:
00299
00300 bool m_isDefined;
00301
00302
00303 ProblemDomain m_domain;
00304 Real m_dx;
00305
00306
00307 GodunovUtilities m_util;
00308
00309
00310 PhysIBC* m_bc;
00311 bool m_isBCSet;
00312
00313
00314 private:
00315
00316 void operator=(const GodunovPhysics& a_input)
00317 {
00318 MayDay::Error("invalid operator");
00319 }
00320
00321
00322 GodunovPhysics(const GodunovPhysics& a_input)
00323 {
00324 MayDay::Error("invalid operator");
00325 }
00326 };
00327
00328 #include "NamespaceFooter.H"
00329 #endif