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                                   bool a_limitSlopes = true);
00098 
00100 
00104   virtual bool useFourthOrderSlopes();
00105 
00107 
00110   virtual bool useFlattening();
00111 
00113 
00116   virtual bool limitSlopes();
00117 
00119 
00121   virtual void setArtificialViscosity(bool a_useArtificialViscosity,
00122                                       Real a_artificialViscosity);
00123 
00125 
00128   virtual bool useArtificialViscosity();
00129 
00131 
00133   virtual Real artificialViscosityCoefficient();
00134 
00136 
00140   virtual PatchGodunov* new_patchGodunov() const = 0;
00141 
00143 
00145   virtual void setCurrentTime(const Real& a_currentTime);
00146 
00148 
00150   virtual void setCurrentBox(const Box& a_currentBox);
00151 
00153 
00160   virtual void updateState(FArrayBox&       a_U,
00161                            FArrayBox        a_F[CH_SPACEDIM],
00162                            Real&            a_maxWaveSpeed,
00163                            const FArrayBox& a_S,
00164                            const Real&      a_dt,
00165                            const Box&       a_box);
00166 
00168 
00170   virtual Real getMaxWaveSpeed(const FArrayBox& a_U,
00171                                const Box&       a_box) = 0;
00172 
00174 
00177   virtual int numConserved() = 0;
00178 
00180 
00185   virtual Vector<string> stateNames();
00186 
00188 
00193   virtual int numFluxes() = 0;
00194 
00195 protected:
00197 
00200   virtual bool isDefined() const;
00201 
00203 
00208   virtual int numPrimitives() = 0;
00209 
00211 
00217   virtual int numSlopes() = 0;
00218 
00220 
00222   virtual void consToPrim(FArrayBox&       a_W,
00223                           const FArrayBox& a_U,
00224                           const Box&       a_box) = 0;
00225 
00227 
00231   virtual void computeFlattening(FArrayBox&       a_flattening,
00232                                  const FArrayBox& a_W,
00233                                  const Box&       a_box);
00234 
00236 
00243   virtual void slope(FArrayBox&       a_dW,
00244                      const FArrayBox& a_W,
00245                      const FArrayBox& a_flattening,
00246                      const int&       a_dir,
00247                      const Box&       a_box);
00248 
00250 
00255   virtual void normalPred(FArrayBox&       a_WMinus,
00256                           FArrayBox&       a_WPlus,
00257                           const FArrayBox& a_W,
00258                           const FArrayBox& a_dW,
00259                           const Real&      a_scale,
00260                           const int&       a_dir,
00261                           const Box&       a_box) = 0;
00262 
00264 
00267   virtual void incrementWithSource(FArrayBox&       a_W,
00268                                    const FArrayBox& a_S,
00269                                    const Real&      a_scale,
00270                                    const Box&       a_box);
00271 
00273 
00277   virtual void riemann(FArrayBox&       a_F,
00278                        const FArrayBox& a_WLeft,
00279                        const FArrayBox& a_WRight,
00280                        const int&       a_dir,
00281                        const Box&       a_box) = 0;
00282 
00284 
00289   virtual void updatePrim(FArrayBox&       a_WMinus,
00290                           FArrayBox&       a_WPlus,
00291                           const FArrayBox& a_F,
00292                           const Real&      a_scale,
00293                           const int&       a_dir,
00294                           const Box&       a_box) = 0;
00295 
00297 
00302   virtual void artificialViscosity(FArrayBox&       a_F,
00303                                    const FArrayBox& a_U,
00304                                    const FArrayBox& a_divVel,
00305                                    const int&       a_dir,
00306                                    const Box&       a_box);
00307   
00309 
00315   virtual void updateCons(FArrayBox&       a_U,
00316                           const FArrayBox& a_F,
00317                           const Real&      a_scale,
00318                           const int&       a_dir,
00319                           const Box&       a_box) = 0;
00320 
00321 
00322   virtual void postUpdateCons(FArrayBox&       a_U,
00323                           const FArrayBox& a_Uold,
00324                           const Real&      a_dt,
00325                           const Real&      a_dx,
00326                           const Box&       a_box);
00327 
00329 
00334   virtual Interval velocityInterval() = 0;
00335 
00337 
00341   virtual int pressureIndex() = 0;
00342 
00344 
00349   virtual int bulkModulusIndex() = 0;
00350 
00352 
00360   virtual void applyLimiter(FArrayBox&       a_dW,
00361                             const FArrayBox& a_dWLeft,
00362                             const FArrayBox& a_dWRight,
00363                             const int&       a_dir,
00364                             const Box&       a_box);
00365 
00367 
00371   virtual void divVel(FArrayBox&       a_divVel,
00372                       const FArrayBox& a_W,
00373                       const int        a_dir,
00374                       const Box&       a_box);
00375 
00376   // Has define() been called
00377   bool m_isDefined;
00378 
00379   // Problem domain and grid spacing
00380   ProblemDomain m_domain;
00381   Real m_dx;
00382 
00383   // Slope computation flags and have they been set
00384   bool m_useFourthOrderSlopes;
00385   bool m_useFlattening;
00386   bool m_limitSlopes;
00387 
00388   // Have they been set
00389   bool m_isSlopeSet;
00390 
00391   // Artificial viscosity flag, coefficient, and have they been set
00392   bool m_useArtificialViscosity;
00393   Real m_artificialViscosity;
00394   bool m_isArtViscSet;
00395 
00396   // Initial and boundary condition object and has it been set
00397   PhysIBC* m_bc;
00398   bool m_isBCSet;
00399 
00400   // Current time and has it been set
00401   Real m_currentTime;
00402   bool m_isCurrentTimeSet;
00403 
00404   // Current box and has it been set
00405   Box m_currentBox;
00406   bool m_isCurrentBoxSet;
00407 
00408 private:
00409   // Disallowed for all the usual reasons
00410   void operator=(const PatchGodunov& a_input)
00411   {
00412     MayDay::Error("invalid operator");
00413   }
00414 
00415   // Disallowed for all the usual reasons
00416   PatchGodunov(const PatchGodunov& a_input)
00417   {
00418     MayDay::Error("invalid operator");
00419   }
00420 };
00421 
00422 #endif

Generated on Wed Apr 16 14:26:49 2003 for Chombo by doxygen1.2.16