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 // NodeMGInterp.H 00012 // petermc, 20 Jun 2001 00013 #ifndef _NODEMGINTERP_H_ 00014 #define _NODEMGINTERP_H_ 00015 00016 #include "REAL.H" 00017 #include "LevelData.H" 00018 #include "NodeFArrayBox.H" 00019 #include "NamespaceHeader.H" 00020 00021 /// Class to interpolate coarse-level data to a fine level 00022 /** 00023 NodeMGInterp manages the interpolation of coarse-level data 00024 to fine-level data for multigrid. 00025 This class should be considered internal 00026 to AMRNodeSolver and not a part of the Chombo API. 00027 */ 00028 class NodeMGInterp 00029 { 00030 public: 00031 00032 /** 00033 \name Constructors, destructor and defines 00034 */ 00035 /*@{*/ 00036 00037 /// 00038 /** Default constructor. User must subsequently call define(). 00039 */ 00040 NodeMGInterp(); 00041 00042 /// 00043 /** Destructor. 00044 */ 00045 ~NodeMGInterp(); 00046 00047 /// 00048 /** Defining constructor. Calls define() function with 00049 identical arguments. 00050 */ 00051 NodeMGInterp(const DisjointBoxLayout& a_grids, 00052 int a_numcomps, 00053 int a_refRatio, 00054 const Box& a_domain); 00055 00056 /// 00057 /** Defining constructor. Calls define() function with 00058 identical arguments. 00059 */ 00060 NodeMGInterp(const DisjointBoxLayout& a_grids, 00061 int a_numcomps, 00062 int a_refRatio, 00063 const ProblemDomain& a_domain); 00064 00065 /// 00066 /** Defines this object. Existing information is overridden. 00067 */ 00068 void define(/// CELL-centered grids at the finer level 00069 const DisjointBoxLayout& a_grids, 00070 /// number of components of data 00071 int a_numcomps, 00072 /// refinement ratio between the two levels 00073 int a_refRatio, 00074 /// CELL-centered physical domain at the finer level 00075 const ProblemDomain& a_domain); 00076 00077 /// 00078 /** Defines this object. Existing information is overridden. 00079 */ 00080 void define(/// CELL-centered grids at the finer level 00081 const DisjointBoxLayout& a_grids, 00082 /// number of components of data 00083 int a_numcomps, 00084 /// refinement ratio between the two levels 00085 int a_refRatio, 00086 /// CELL-centered physical domain at the finer level 00087 const Box& a_domain); 00088 00089 /*@}*/ 00090 00091 /** 00092 \name Access functions 00093 */ 00094 /*@{*/ 00095 00096 /// 00097 /** Returns <tt>true</tt> if this object was created with the defining 00098 constructor or if define() has been called. 00099 */ 00100 bool isDefined() const; 00101 00102 /*@}*/ 00103 00104 /** 00105 \name Data modification functions 00106 */ 00107 /*@{*/ 00108 00109 /// 00110 /** Adds interpolated coarse-level data to fine-level data. 00111 */ 00112 void interpToFine(/// data at the finer level 00113 LevelData<NodeFArrayBox>& a_fine, 00114 /// data at the coarser level 00115 const LevelData<NodeFArrayBox>& a_coarse, 00116 /// whether the finer-level grids are refinements of the coarser-level grids 00117 bool a_sameGrids = false); 00118 00119 /*@}*/ 00120 00121 protected: 00122 00123 /** has this NodeMGInterp object been defined yet? 00124 */ 00125 bool is_defined; 00126 00127 /** the refinement ratio between the two levels 00128 */ 00129 int m_refRatio; 00130 00131 /** work array for the coarse-level data in a domain that is the 00132 outline of the fine level domain on the coarse level 00133 */ 00134 BoxLayoutData<NodeFArrayBox> m_coarsenedFine; 00135 00136 /** CELL-centered grids at the finer level 00137 */ 00138 DisjointBoxLayout m_grids; 00139 00140 /** CELL-centered physical domain at the finer level 00141 */ 00142 ProblemDomain m_domain; 00143 00144 /** reference box used in interpolation 00145 */ 00146 Box m_boxRef; 00147 00148 /** weights of corners in interpolation 00149 */ 00150 FArrayBox m_weights; 00151 }; 00152 00153 #include "NamespaceFooter.H" 00154 #endif