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 _FOURTHORDERPATCHINTERP_H_ 00012 #define _FOURTHORDERPATCHINTERP_H_ 00013 00014 #include "FArrayBox.H" 00015 #include "ProblemDomain.H" 00016 #include "IntVectSet.H" 00017 #include "FourthOrderInterpStencil.H" 00018 #include "NamespaceHeader.H" 00019 00020 /// Fourth-order interpolation in space on a single patch 00021 00022 /** 00023 */ 00024 class FourthOrderPatchInterp 00025 { 00026 public: 00027 /// Default constructor 00028 /** 00029 Object requires define() to be called before all other functions. 00030 */ 00031 FourthOrderPatchInterp(); 00032 00033 /// Destructor 00034 /** 00035 Destroys all objects created by define(). Passed in data references 00036 of define() are left alone. 00037 */ 00038 virtual ~FourthOrderPatchInterp(); 00039 00040 /// Actual constructor. 00041 /** 00042 Set up object. 00043 */ 00044 virtual void define( 00045 /// problem domain on this level 00046 const ProblemDomain& a_domain, 00047 /// refinement ratio between this level and next coarser level 00048 const int& a_refineCoarse, 00049 /// maximum distance of stencil from domain boundary 00050 const int& a_maxStencilDist, 00051 /// dimensions that are fixed, not interpolated 00052 Interval a_fixedDims = Interval() ); 00053 00054 /// Set the coarse box before calling setStencil or interpToFine. 00055 /** 00056 */ 00057 virtual void setCoarseBox(const Box& a_coarseBox); 00058 00059 /// Set stencil for current coarse box and domain 00060 /** 00061 Set a_stencil for m_coarseBox. 00062 */ 00063 virtual void setStencil(BaseFab<IntVect>& a_stencil); 00064 00065 /// Interpolate in space. 00066 /** 00067 Interpolate in space to a_fine from a_coarse. 00068 */ 00069 virtual void interpToFine(/// interpolated solution on this level 00070 FArrayBox& a_fine, 00071 /// coarse solution 00072 const FArrayBox& a_coarse, 00073 /// stencils 00074 const BaseFab<IntVect>& a_stencils); 00075 00076 /// Interpolate in space. 00077 /** 00078 Interpolate in space to a_fine from a_coarse at 00079 fine cells within the coarse cells listed in a_ivs. 00080 */ 00081 virtual void interpToFine(/// interpolated solution on this level 00082 FArrayBox& a_fine, 00083 /// coarse solution 00084 const FArrayBox& a_coarse, 00085 /// stencils 00086 const BaseFab<IntVect>& a_stencils, 00087 /// we fill in fine cells within these coarse cells 00088 const IntVectSet& a_ivs); 00089 00090 protected: 00091 00092 /// all possible stencils, on (-m_maxStencilDist:+m_maxStencilDist)^SpaceDim 00093 BaseFab<FourthOrderInterpStencil*> m_stencils; 00094 00095 /// Problem domain - index space for this level 00096 ProblemDomain m_domain; 00097 00098 // m_domain coarsened by m_refineCoarse 00099 ProblemDomain m_coarseDomain; 00100 00101 /// Refinement ratio between this level and the next coarser 00102 int m_refineCoarse; 00103 00104 /// maximum distance of stencil from domain boundary 00105 int m_maxStencilDist; 00106 00107 /// max degree of approximations 00108 int m_degree; 00109 00110 /// dimensions that are fixed, not interpolated 00111 Interval m_fixedDims; 00112 00113 /// 1 in m_fixedDims, m_refineCoarse in other dimensions 00114 IntVect m_refineVect; 00115 00116 /// define() has been called 00117 bool m_defined; 00118 00119 /// current coarse box 00120 Box m_coarseBox; 00121 00122 /// m_coarseBox is set 00123 bool m_isCoarseBoxSet; 00124 00125 private: 00126 00127 // Disallowed for all the usual reasons 00128 void operator=(const FourthOrderPatchInterp& a_input) 00129 { 00130 MayDay::Error("invalid operator"); 00131 } 00132 00133 // Disallowed for all the usual reasons 00134 FourthOrderPatchInterp(const FourthOrderPatchInterp& a_input) 00135 { 00136 MayDay::Error("invalid operator"); 00137 } 00138 }; 00139 00140 #include "NamespaceFooter.H" 00141 #endif