Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

LevelGodunov.H

Go to the documentation of this file.
00001 /*   _______              __
00002     / ___/ /  ___  __ _  / /  ___
00003    / /__/ _ \/ _ \/  V \/ _ \/ _ \
00004    \___/_//_/\___/_/_/_/_.__/\___/
00005 */
00006 // CHOMBO Copyright (c) 2000-2004, The Regents of the University of
00007 // California, through Lawrence Berkeley National Laboratory (subject to
00008 // receipt of any required approvals from U.S. Dept. of Energy).  All
00009 // rights reserved.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are met:
00013 //
00014 // (1) Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 // (2) Redistributions in binary form must reproduce the above copyright
00017 // notice, this list of conditions and the following disclaimer in the
00018 // documentation and/or other materials provided with the distribution.
00019 // (3) Neither the name of Lawrence Berkeley National Laboratory, U.S.
00020 // Dept. of Energy nor the names of its contributors may be used to endorse
00021 // or promote products derived from this software without specific prior
00022 // written permission.
00023 //
00024 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00026 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00027 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00028 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00029 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00030 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00031 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00032 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00033 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00034 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035 //
00036 // You are under no obligation whatsoever to provide any bug fixes,
00037 // patches, or upgrades to the features, functionality or performance of
00038 // the source code ("Enhancements") to anyone; however, if you choose to
00039 // make your Enhancements available either publicly, or directly to
00040 // Lawrence Berkeley National Laboratory, without imposing a separate
00041 // written license agreement for such Enhancements, then you hereby grant
00042 // the following license: a non-exclusive, royalty-free perpetual license
00043 // to install, use, modify, prepare derivative works, incorporate into
00044 // other computer software, distribute, and sublicense such Enhancements or
00045 // derivative works thereof, in binary and source code form.
00046 //
00047 // TRADEMARKS. Product and company names mentioned herein may be the
00048 // trademarks of their respective owners.  Any rights not expressly granted
00049 // herein are reserved.
00050 //
00051 
00052 #ifndef _LEVELGODUNOV_H_
00053 #define _LEVELGODUNOV_H_
00054 
00055 #include "FArrayBox.H"
00056 #include "FluxBox.H"
00057 #include "DisjointBoxLayout.H"
00058 #include "LevelData.H"
00059 #include "PiecewiseLinearFillPatch.H"
00060 #include "ExtrapFillPatch.H"
00061 #include "LevelFluxRegister.H"
00062 #include "ProblemDomain.H"
00063 
00064 #include "PatchGodunov.H"
00065 
00067 
00069 class LevelGodunov
00070 {
00071 public:
00073 
00076   LevelGodunov();
00077 
00079 
00083   ~LevelGodunov();
00084 
00086 
00093   void define(const DisjointBoxLayout&    a_thisDisjointBoxLayout,
00094               const DisjointBoxLayout&    a_coarserDisjointBoxLayout,
00095               const ProblemDomain&        a_domain,
00096               const int&                  a_refineCoarse,
00097               const Real&                 a_dx,
00098               const GodunovPhysics* const a_godunovFactory,
00099               const int&                  a_normalPredOrder,
00100               const bool&                 a_useFourthOrderSlopes,
00101               const bool&                 a_usePrimLimiting,
00102               const bool&                 a_useCharLimiting,
00103               const bool&                 a_useFlattening,
00104               const bool&                 a_useArtificialViscosity,
00105               const Real&                 a_artificialViscosity,
00106               const bool&                 a_hasCoarser,
00107               const bool&                 a_hasFiner);
00108 
00110 
00124   Real step(LevelData<FArrayBox>&       a_U,
00125             LevelData<FArrayBox>        a_flux[CH_SPACEDIM],
00126             LevelFluxRegister&          a_finerFluxRegister,
00127             LevelFluxRegister&          a_coarserFluxRegister,
00128             const LevelData<FArrayBox>& a_S,
00129             const LevelData<FArrayBox>& a_UCoarseOld,
00130             const Real&                 a_TCoarseOld,
00131             const LevelData<FArrayBox>& a_UCoarseNew,
00132             const Real&                 a_TCoarseNew,
00133             const Real&                 a_time,
00134             const Real&                 a_dt);
00135 
00137 
00139   void computeWHalf(LayoutData<FluxBox>&        a_WHalf,
00140                     LevelData<FArrayBox>&       a_U,
00141                     const LevelData<FArrayBox>& a_S,
00142                     const LevelData<FArrayBox>& a_UCoarseOld,
00143                     const Real&                 a_TCoarseOld,
00144                     const LevelData<FArrayBox>& a_UCoarseNew,
00145                     const Real&                 a_TCoarseNew,
00146                     const Real&                 a_time,
00147                     const Real&                 a_dt);
00148 
00150 
00152   Real computeUpdate(LevelData<FArrayBox>&       a_dU,
00153                      LevelFluxRegister&          a_finerFluxRegister,
00154                      LevelFluxRegister&          a_coarserFluxRegister,
00155                      const LevelData<FArrayBox>& a_U,
00156                      const LayoutData<FluxBox>&  a_WHalf,
00157                      const Real&                 a_time,
00158                      const Real&                 a_dt);
00159 
00161 
00163   Real getMaxWaveSpeed(const LevelData<FArrayBox>& a_U);
00164 
00166 
00170   GodunovPhysics* getGodunovPhysicsPtr();
00171 
00172 protected:
00173   // Box layout for this level
00174   DisjointBoxLayout m_grids;
00175 
00176   // Patch integrator
00177   PatchGodunov    m_patchGodunov;
00178 
00179   // Number of ghost cells need locally for this level
00180   int m_numGhost;
00181 
00182   // Interpolator for filling in ghost cells from the next coarser level
00183   PiecewiseLinearFillPatch m_patcher;
00184 
00185   // Grid spacing
00186   Real m_dx;
00187 
00188   // Problem domain - index space for this level
00189   ProblemDomain m_domain;
00190 
00191   // Refinement ratio between this level and the next coarser
00192   int m_refineCoarse;
00193 
00194   // Number of conserved variables
00195   int m_numCons;
00196 
00197   // Number of conservative fluxes and other face centered quantities
00198   int m_numFluxes;
00199 
00200   // Flags for the existence of coarser and finer levels, respectively
00201   bool m_hasCoarser;
00202   bool m_hasFiner;
00203 
00204   // Order of the normal predictor (1 -> PLM, 2-> PPM)
00205   int m_normalPredOrder;
00206 
00207   // Use 4th order slope computations (otherwise, use 2nd order)
00208   bool m_useFourthOrderSlopes;
00209 
00210   // Do slope limiting in the primative or characteristic variables, respect.
00211   bool m_usePrimLimiting;
00212   bool m_useCharLimiting;
00213 
00214   // Do slope flattening - MUST BE USING 4th order slopes
00215   bool m_useFlattening;
00216 
00217   // Apply artificial viscosity of a set value
00218   bool m_useArtificialViscosity;
00219   Real m_artificialViscosity;
00220 
00221   // Has this object been defined
00222   bool m_isDefined;
00223 
00224 
00225 private:
00226   // Disallowed for all the usual reasons
00227   void operator=(const LevelGodunov& a_input)
00228   {
00229     MayDay::Error("invalid operator");
00230   }
00231 
00232   // Disallowed for all the usual reasons
00233   LevelGodunov(const LevelGodunov& a_input)
00234   {
00235     MayDay::Error("invalid operator");
00236   }
00237 };
00238 
00239 #endif

Generated on Wed Oct 5 12:08:14 2005 for Chombo&AMRIdealMHD by  doxygen 1.4.1