Main Page | Modules | 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(const 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   
00167   
00169 
00175   virtual void computeFluxes(FArrayBox&       a_U,
00176                              FArrayBox        a_F[CH_SPACEDIM],
00177                              const FArrayBox& a_S,
00178                              const Real&      a_dt,
00179                              const Box&       a_box);
00180 
00181 
00183 
00185   virtual Real getMaxWaveSpeed(const FArrayBox& a_U,
00186                                const Box&       a_box) = 0;
00187 
00189 
00192   virtual int numConserved() = 0;
00193 
00195 
00200   virtual Vector<string> stateNames();
00201 
00203 
00208   virtual int numFluxes() = 0;
00209 
00210 protected:
00212 
00215   virtual bool isDefined() const;
00216 
00218 
00223   virtual int numPrimitives() = 0;
00224 
00226 
00232   virtual int numSlopes() = 0;
00233 
00235 
00237   virtual void consToPrim(FArrayBox&       a_W,
00238                           const FArrayBox& a_U,
00239                           const Box&       a_box) = 0;
00240 
00242 
00246   virtual void computeFlattening(FArrayBox&       a_flattening,
00247                                  const FArrayBox& a_W,
00248                                  const Box&       a_box);
00249 
00251 
00258   virtual void slope(FArrayBox&       a_dW,
00259                      const FArrayBox& a_W,
00260                      const FArrayBox& a_flattening,
00261                      const int&       a_dir,
00262                      const Box&       a_box);
00263 
00265 
00270   virtual void normalPred(FArrayBox&       a_WMinus,
00271                           FArrayBox&       a_WPlus,
00272                           const FArrayBox& a_W,
00273                           const FArrayBox& a_dW,
00274                           const Real&      a_scale,
00275                           const int&       a_dir,
00276                           const Box&       a_box) = 0;
00277 
00279 
00282   virtual void incrementWithSource(FArrayBox&       a_W,
00283                                    const FArrayBox& a_S,
00284                                    const Real&      a_scale,
00285                                    const Box&       a_box);
00286 
00288 
00292   virtual void riemann(FArrayBox&       a_F,
00293                        const FArrayBox& a_WLeft,
00294                        const FArrayBox& a_WRight,
00295                        const int&       a_dir,
00296                        const Box&       a_box) = 0;
00297 
00299 
00304   virtual void updatePrim(FArrayBox&       a_WMinus,
00305                           FArrayBox&       a_WPlus,
00306                           const FArrayBox& a_F,
00307                           const Real&      a_scale,
00308                           const int&       a_dir,
00309                           const Box&       a_box) = 0;
00310 
00312 
00317   virtual void artificialViscosity(FArrayBox&       a_F,
00318                                    const FArrayBox& a_U,
00319                                    const FArrayBox& a_divVel,
00320                                    const int&       a_dir,
00321                                    const Box&       a_box);
00322   
00324 
00330   virtual void updateCons(FArrayBox&       a_U,
00331                           const FArrayBox& a_F,
00332                           const Real&      a_scale,
00333                           const int&       a_dir,
00334                           const Box&       a_box) = 0;
00335 
00337 
00343   virtual void finalUpdate(FArrayBox&       a_U,
00344                            const FArrayBox& a_F,
00345                            const Real&      a_scale,
00346                            const int&       a_dir,
00347                            const Box&       a_box) = 0;
00348 
00349 
00350   virtual void postUpdateCons(FArrayBox&       a_U,
00351                           const FArrayBox& a_Uold,
00352                           const Real&      a_dt,
00353                           const Real&      a_dx,
00354                           const Box&       a_box);
00355 
00357 
00362   virtual Interval velocityInterval() = 0;
00363 
00365 
00369   virtual int pressureIndex() = 0;
00370 
00372 
00377   virtual int bulkModulusIndex() = 0;
00378 
00380 
00388   virtual void applyLimiter(FArrayBox&       a_dW,
00389                             const FArrayBox& a_dWLeft,
00390                             const FArrayBox& a_dWRight,
00391                             const int&       a_dir,
00392                             const Box&       a_box);
00393 
00395 
00399   virtual void divVel(FArrayBox&       a_divVel,
00400                       const FArrayBox& a_W,
00401                       const int        a_dir,
00402                       const Box&       a_box);
00403 
00404   // Has define() been called
00405   bool m_isDefined;
00406 
00407   // Problem domain and grid spacing
00408   ProblemDomain m_domain;
00409   Real m_dx;
00410 
00411   // Slope computation flags and have they been set
00412   bool m_useFourthOrderSlopes;
00413   bool m_useFlattening;
00414   bool m_limitSlopes;
00415 
00416   // Have they been set
00417   bool m_isSlopeSet;
00418 
00419   // Artificial viscosity flag, coefficient, and have they been set
00420   bool m_useArtificialViscosity;
00421   Real m_artificialViscosity;
00422   bool m_isArtViscSet;
00423 
00424   // Initial and boundary condition object and has it been set
00425   PhysIBC* m_bc;
00426   bool m_isBCSet;
00427 
00428   // Current time and has it been set
00429   Real m_currentTime;
00430   bool m_isCurrentTimeSet;
00431 
00432   // Current box and has it been set
00433   Box m_currentBox;
00434   bool m_isCurrentBoxSet;
00435 
00436 private:
00437   // Disallowed for all the usual reasons
00438   void operator=(const PatchGodunov& a_input)
00439   {
00440     MayDay::Error("invalid operator");
00441   }
00442 
00443   // Disallowed for all the usual reasons
00444   PatchGodunov(const PatchGodunov& a_input)
00445   {
00446     MayDay::Error("invalid operator");
00447   }
00448 };
00449 
00450 #endif

Generated on Fri Jul 2 17:53:43 2004 for Chombo by doxygen 1.3.2