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 00125 Real step(LevelData<FArrayBox>& a_U, 00126 LevelData<FArrayBox> a_flux[CH_SPACEDIM], 00127 LevelFluxRegister& a_finerFluxRegister, 00128 LevelFluxRegister& a_coarserFluxRegister, 00129 const LevelData<FArrayBox>& a_S, 00130 const LevelData<FArrayBox>& a_UCoarseOld, 00131 const Real& a_TCoarseOld, 00132 const LevelData<FArrayBox>& a_UCoarseNew, 00133 const Real& a_TCoarseNew, 00134 const Real& a_time, 00135 const Real& a_dt); 00136 00138 00140 Real getMaxWaveSpeed(const LevelData<FArrayBox>& a_U); 00141 00142 00143 protected: 00144 // Box layout for this level 00145 DisjointBoxLayout m_grids; 00146 00147 // Patch integrator 00148 PatchGodunov m_patchGodunov; 00149 GodunovPhysics* m_gdnvPhysics; 00150 00151 // Number of ghost cells need locally for this level 00152 int m_numGhost; 00153 00154 // Interpolator for filling in ghost cells from the next coarser level 00155 PiecewiseLinearFillPatch m_patcher; 00156 00157 // Grid spacing 00158 Real m_dx; 00159 00160 // Problem domain - index space for this level 00161 ProblemDomain m_domain; 00162 00163 // Refinement ratio between this level and the next coarser 00164 int m_refineCoarse; 00165 00166 // Number of conserved variables 00167 int m_numCons; 00168 00169 // Number of conservative fluxes and other face centered quantities 00170 int m_numFluxes; 00171 00172 // Flags for the existence of coarser and finer levels, respectively 00173 bool m_hasCoarser; 00174 bool m_hasFiner; 00175 00176 // Order of the normal predictor (1 -> PLM, 2-> PPM) 00177 int m_normalPredOrder; 00178 00179 // Use 4th order slope computations (otherwise, use 2nd order) 00180 bool m_useFourthOrderSlopes; 00181 00182 // Do slope limiting in the primative or characteristic variables, respect. 00183 bool m_usePrimLimiting; 00184 bool m_useCharLimiting; 00185 00186 // Do slope flattening - MUST BE USING 4th order slopes 00187 bool m_useFlattening; 00188 00189 // Apply artificial viscosity of a set value 00190 bool m_useArtificialViscosity; 00191 Real m_artificialViscosity; 00192 00193 // Has this object been defined 00194 bool m_isDefined; 00195 00196 00197 private: 00198 // Disallowed for all the usual reasons 00199 void operator=(const LevelGodunov& a_input) 00200 { 00201 MayDay::Error("invalid operator"); 00202 } 00203 00204 // Disallowed for all the usual reasons 00205 LevelGodunov(const LevelGodunov& a_input) 00206 { 00207 MayDay::Error("invalid operator"); 00208 } 00209 }; 00210 00211 #endif