00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _FINEINTERPFACE_H_ 00012 #define _FINEINTERPFACE_H_ 00013 00014 #include "REAL.H" 00015 #include "LevelData.H" 00016 #include "BaseFab.H" 00017 #include "FArrayBox.H" 00018 #include "FluxBox.H" 00019 #include "ProblemDomain.H" 00020 00021 #include "NamespaceHeader.H" 00022 00023 class DisjointBoxLayout; 00024 00025 /// replaces face-centered fine data with interpolation of coarse level data. 00026 /** 00027 This class replaces data at a fine level of refinement with data 00028 interpolated from a coarser level of refinement. Interpolation on 00029 fine faces which overlie coarse faces is piecewise bi(tri)linear, 00030 with van Leer slopes if there is room for the stencil, with 00031 lower-order slopes if there isn't. For the intermediate fine-level 00032 faces, interpolate linearly between the corresponding fine-grid faces 00033 which _do_ overlie coarse-grid faces. 00034 */ 00035 class FineInterpFace 00036 { 00037 public: 00038 /// 00039 /** 00040 Default constructor. User must subsequently call define(). 00041 */ 00042 FineInterpFace(); 00043 00044 /// 00045 /** 00046 Destructor. 00047 */ 00048 ~FineInterpFace(); 00049 00050 /// 00051 /** 00052 Defining constructor. Constructs a valid object. 00053 Equivalent to default construction followed by define(). 00054 00055 {\bf Arguments:}\\ 00056 a_fine_domain (not modified): the fine level domain.\\ 00057 a_numcomps (not modified): the number of components.\\ 00058 a_ref_ratio (not modified): the refinement ratio.\\ 00059 a_fine_problem_domain (not modified): problem domain at the fine level.\\ 00060 00061 */ 00062 FineInterpFace(const DisjointBoxLayout& a_fine_domain, 00063 const int& a_numcomps, 00064 const int& a_ref_ratio, 00065 const Box& a_fine_problem_domain); 00066 00067 00068 /// 00069 /** 00070 Defining constructor. Constructs a valid object. 00071 Equivalent to default construction followed by define(). 00072 00073 {\bf Arguments:}\\ 00074 a_fine_domain (not modified): the fine level domain.\\ 00075 a_numcomps (not modified): the number of components.\\ 00076 a_ref_ratio (not modified): the refinement ratio.\\ 00077 a_fine_problem_domain (not modified): problem domain at the fine level.\\ 00078 00079 */ 00080 FineInterpFace(const DisjointBoxLayout& a_fine_domain, 00081 const int& a_numcomps, 00082 const int& a_ref_ratio, 00083 const ProblemDomain& a_fine_problem_domain); 00084 00085 /// 00086 /** 00087 Defines this object. Existing information is overriden. 00088 00089 {\bf Arguments:}\\ 00090 a_fine_domain (not modified): the fine level domain.\\ 00091 a_numcomps (not modified): the number of components.\\ 00092 a_ref_ratio (not modified): the refinement ratio.\\ 00093 a_fine_problem_domain (not modified): problem domain at the fine level.\\ 00094 00095 {\bf This:}\\ 00096 ---This object is modified.--- 00097 00098 */ 00099 void 00100 define(const DisjointBoxLayout& a_fine_domain, // the fine level domain 00101 const int& a_numcomps, // the number of components 00102 const int& a_ref_ratio, // the refinement ratio 00103 const Box& a_fine_problem_domain); // problem domain 00104 00105 /// 00106 /** 00107 Defines this object. Existing information is overriden. 00108 00109 {\bf Arguments:}\\ 00110 a_fine_domain (not modified): the fine level domain.\\ 00111 a_numcomps (not modified): the number of components.\\ 00112 a_ref_ratio (not modified): the refinement ratio.\\ 00113 a_fine_problem_domain (not modified): problem domain at the fine level.\\ 00114 00115 {\bf This:}\\ 00116 ---This object is modified.--- 00117 00118 */ 00119 void 00120 define(const DisjointBoxLayout& a_fine_domain, // the fine level domain 00121 const int& a_numcomps, // the number of components 00122 const int& a_ref_ratio, // the refinement ratio 00123 const ProblemDomain& a_fine_problem_domain); // problem domain 00124 00125 /// 00126 /** 00127 Returns true if this object was created with the defining 00128 constructor or if define() has been called. 00129 00130 {\bf This:}\\ 00131 This object is not modified. 00132 */ 00133 bool 00134 isDefined() const; 00135 00136 /// 00137 /** 00138 Replaces a_fine_data with data interpolated from a_coarse_data. It 00139 is an error to call if not this->isDefined(). The domain of 00140 a_fine_data should be the same as the fine domain specified in the 00141 most recent call to define(). It is expected that the coarse and 00142 fine level's domains are properly nested. Both a_coarse_data and 00143 a_fine_data should have the same number of components specified in 00144 the most recent call to define(). 00145 00146 {\bf Arguments:}\\ 00147 a_fine_data (modified): fine data. \\ 00148 a_coarse_data (not modified): coarse data. \\ 00149 00150 {\bf This:}\\ 00151 Well, it's complicated. As far as the user is concerned, this object 00152 is not modified. See the design document if you care for details. 00153 00154 */ 00155 void 00156 interpToFine(LevelData<FluxBox>& a_fine_data, 00157 const LevelData<FluxBox>& a_coarse_data, 00158 bool a_averageFromDest = false); 00159 00160 protected: 00161 void 00162 interpGridData(BaseFab<Real>& a_fine, 00163 const BaseFab<Real>& a_coarse, 00164 const Box& a_coarsened_fine_box, 00165 const int& a_ref_ratio, const int& a_dir) 00166 const; 00167 00168 protected: 00169 bool is_defined; 00170 // the refinement ratio 00171 int m_ref_ratio; 00172 // work array for the coarse level data in a domain that is the 00173 // outline of the fine level domain on the coarse level 00174 LevelData<FluxBox> m_coarsened_fine_data; 00175 // coarse level problem domain 00176 ProblemDomain m_coarse_problem_domain; 00177 }; 00178 00179 #include "NamespaceFooter.H" 00180 00181 #endif