Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PatchGodunov.H

Go to the documentation of this file.
00001 /* _______              __
00002   / ___/ /  ___  __ _  / /  ___
00003  / /__/ _ \/ _ \/  ' \/ _ \/ _ \
00004  \___/_//_/\___/_/_/_/_.__/\___/
00005 */
00006 //
00007 // This software is copyright (C) by the Lawrence Berkeley
00008 // National Laboratory.  Permission is granted to reproduce
00009 // this software for non-commercial purposes provided that
00010 // this notice is left intact.
00011 //
00012 // It is acknowledged that the U.S. Government has rights to
00013 // this software under Contract DE-AC03-765F00098 between
00014 // the U.S.  Department of Energy and the University of
00015 // California.
00016 //
00017 // This software is provided as a professional and academic
00018 // contribution for joint exchange. Thus it is experimental,
00019 // is provided ``as is'', with no warranties of any kind
00020 // whatsoever, no support, no promise of updates, or printed
00021 // documentation. By using this software, you acknowledge
00022 // that the Lawrence Berkeley National Laboratory and
00023 // Regents of the University of California shall have no
00024 // liability with respect to the infringement of other
00025 // copyrights by any part of this software.
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   // Has define() been called
00370   bool m_isDefined;
00371 
00372   // Problem domain and grid spacing
00373   ProblemDomain m_domain;
00374   Real m_dx;
00375 
00376   // Slope computation flags and have they been set
00377   bool m_useFourthOrderSlopes;
00378   bool m_useFlattening;
00379 
00380   // Have they been set
00381   bool m_isSlopeSet;
00382 
00383   // Artificial viscosity flag, coefficient, and have they been set
00384   bool m_useArtificialViscosity;
00385   Real m_artificialViscosity;
00386   bool m_isArtViscSet;
00387 
00388   // Initial and boundary condition object and has it been set
00389   PhysIBC* m_bc;
00390   bool m_isBCSet;
00391 
00392   // Current time and has it been set
00393   Real m_currentTime;
00394   bool m_isCurrentTimeSet;
00395 
00396   // Current box and has it been set
00397   Box m_currentBox;
00398   bool m_isCurrentBoxSet;
00399 
00400 private:
00401   // Disallowed for all the usual reasons
00402   void operator=(const PatchGodunov& a_input)
00403   {
00404     MayDay::Error("invalid operator");
00405   }
00406 
00407   // Disallowed for all the usual reasons
00408   PatchGodunov(const PatchGodunov& a_input)
00409   {
00410     MayDay::Error("invalid operator");
00411   }
00412 };
00413 
00414 #endif

Generated on Tue Jul 2 10:42:20 2002 for Chombo by doxygen1.2.16