00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _PATCH_GODUNOV_H_
00029 #define _PATCH_GODUNOV_H_
00030
00031 #include "PhysIBC.H"
00032 #include "Box.H"
00033 #include "IntVectSet.H"
00034 #include "Vector.H"
00035
00036 #include <string>
00037 using std::string;
00038
00040
00063 class PatchGodunov
00064 {
00065 public:
00067
00069 PatchGodunov();
00070
00072
00074 virtual ~PatchGodunov();
00075
00077
00079 virtual void define(ProblemDomain& a_domain,
00080 const Real& a_dx);
00081
00083
00085 virtual void setPhysIBC(PhysIBC* a_bc);
00086
00088
00090 virtual PhysIBC* getPhysIBC() const;
00091
00093
00095 virtual void setSlopeParameters(bool a_fourthOrderSlopes,
00096 bool a_flattening);
00097
00099
00103 virtual bool useFourthOrderSlopes();
00104
00106
00109 virtual bool useFlattening();
00110
00112
00114 virtual void setArtificialViscosity(bool a_useArtificialViscosity,
00115 Real a_artificialViscosity);
00116
00118
00121 virtual bool useArtificialViscosity();
00122
00124
00126 virtual Real artificialViscosityCoefficient();
00127
00129
00133 virtual PatchGodunov* new_patchGodunov() const = 0;
00134
00136
00138 virtual void setCurrentTime(const Real& a_currentTime);
00139
00141
00143 virtual void setCurrentBox(const Box& a_currentBox);
00144
00146
00153 virtual void updateState(FArrayBox& a_U,
00154 FArrayBox a_F[CH_SPACEDIM],
00155 Real& a_maxWaveSpeed,
00156 const FArrayBox& a_S,
00157 const Real& a_dt,
00158 const Box& a_box);
00159
00161
00163 virtual Real getMaxWaveSpeed(const FArrayBox& a_U,
00164 const Box& a_box) = 0;
00165
00167
00170 virtual int numConserved() = 0;
00171
00173
00178 virtual Vector<string> stateNames();
00179
00181
00186 virtual int numFluxes() = 0;
00187
00188 protected:
00190
00193 virtual bool isDefined() const;
00194
00196
00201 virtual int numPrimitives() = 0;
00202
00204
00210 virtual int numSlopes() = 0;
00211
00213
00215 virtual void consToPrim(FArrayBox& a_W,
00216 const FArrayBox& a_U,
00217 const Box& a_box) = 0;
00218
00220
00224 virtual void computeFlattening(FArrayBox& a_flattening,
00225 const FArrayBox& a_W,
00226 const Box& a_box);
00227
00229
00236 virtual void slope(FArrayBox& a_dW,
00237 const FArrayBox& a_W,
00238 const FArrayBox& a_flattening,
00239 const int& a_dir,
00240 const Box& a_box);
00241
00243
00248 virtual void normalPred(FArrayBox& a_WMinus,
00249 FArrayBox& a_WPlus,
00250 const FArrayBox& a_W,
00251 const FArrayBox& a_dW,
00252 const Real& a_scale,
00253 const int& a_dir,
00254 const Box& a_box) = 0;
00255
00257
00260 virtual void incrementWithSource(FArrayBox& a_W,
00261 const FArrayBox& a_S,
00262 const Real& a_scale,
00263 const Box& a_box);
00264
00266
00270 virtual void riemann(FArrayBox& a_F,
00271 const FArrayBox& a_WLeft,
00272 const FArrayBox& a_WRight,
00273 const int& a_dir,
00274 const Box& a_box) = 0;
00275
00277
00282 virtual void updatePrim(FArrayBox& a_WMinus,
00283 FArrayBox& a_WPlus,
00284 const FArrayBox& a_F,
00285 const Real& a_scale,
00286 const int& a_dir,
00287 const Box& a_box) = 0;
00288
00290
00295 virtual void artificialViscosity(FArrayBox& a_F,
00296 const FArrayBox& a_U,
00297 const FArrayBox& a_divVel,
00298 const int& a_dir,
00299 const Box& a_box);
00300
00302
00308 virtual void updateCons(FArrayBox& a_U,
00309 const FArrayBox& a_F,
00310 const Real& a_scale,
00311 const int& a_dir,
00312 const Box& a_box) = 0;
00313
00314
00315 virtual void postUpdateCons(FArrayBox& a_U,
00316 const FArrayBox& a_Uold,
00317 const Real& a_dt,
00318 const Real& a_dx,
00319 const Box& a_box);
00320
00322
00327 virtual Interval velocityInterval() = 0;
00328
00330
00334 virtual int pressureIndex() = 0;
00335
00337
00342 virtual int bulkModulusIndex() = 0;
00343
00345
00353 virtual void applyLimiter(FArrayBox& a_dW,
00354 const FArrayBox& a_dWLeft,
00355 const FArrayBox& a_dWRight,
00356 const int& a_dir,
00357 const Box& a_box);
00358
00360
00364 virtual void divVel(FArrayBox& a_divVel,
00365 const FArrayBox& a_W,
00366 const int a_dir,
00367 const Box& a_box);
00368
00369
00370 bool m_isDefined;
00371
00372
00373 ProblemDomain m_domain;
00374 Real m_dx;
00375
00376
00377 bool m_useFourthOrderSlopes;
00378 bool m_useFlattening;
00379
00380
00381 bool m_isSlopeSet;
00382
00383
00384 bool m_useArtificialViscosity;
00385 Real m_artificialViscosity;
00386 bool m_isArtViscSet;
00387
00388
00389 PhysIBC* m_bc;
00390 bool m_isBCSet;
00391
00392
00393 Real m_currentTime;
00394 bool m_isCurrentTimeSet;
00395
00396
00397 Box m_currentBox;
00398 bool m_isCurrentBoxSet;
00399
00400 private:
00401
00402 void operator=(const PatchGodunov& a_input)
00403 {
00404 MayDay::Error("invalid operator");
00405 }
00406
00407
00408 PatchGodunov(const PatchGodunov& a_input)
00409 {
00410 MayDay::Error("invalid operator");
00411 }
00412 };
00413
00414 #endif