00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _QUADCFINTERP_H_
00012 #define _QUADCFINTERP_H_
00013
00014 #include <iostream>
00015 #include <cmath>
00016 #include "SPACE.H"
00017 #include <cstdlib>
00018 #include "REAL.H"
00019 #include "IntVect.H"
00020 #include "Box.H"
00021 #include "BaseFab.H"
00022 #include "DisjointBoxLayout.H"
00023 #include "LevelData.H"
00024 #include "FArrayBox.H"
00025 #include "QuadCFStencil.H"
00026 #include "ProblemDomain.H"
00027 #include "NamespaceHeader.H"
00028
00029 class CFIVS;
00030 class TensorFineStencilSet;
00032
00036 class QuadCFInterp
00037 {
00038 public:
00039
00041
00043 static void
00044 homogeneousCFInterp(LevelData<FArrayBox>& a_phif,
00045 LevelData<FArrayBox>& a_tanGrad,
00046 LayoutData<CFIVS> a_loCFIVS[SpaceDim],
00047 LayoutData<CFIVS> a_hiCFIVS[SpaceDim],
00048 Real a_dxLevel,
00049 Real a_dxCrse,
00050 int a_ncomp,
00051 LayoutData<TensorFineStencilSet> a_loTanStencilSets[SpaceDim],
00052 LayoutData<TensorFineStencilSet> a_hiTanStencilSets[SpaceDim]);
00053
00054
00056
00058 static void
00059 homogeneousCFInterpTanGrad(LevelData<FArrayBox>& a_tanGrad,
00060 const LevelData<FArrayBox>& a_phi,
00061 const DataIndex& a_DatInd,
00062 int a_idir,
00063 Side::LoHiSide a_hiorlo,
00064 Real a_dxLevel,
00065 Real a_dxCrse,
00066 int a_ncomp,
00067 LayoutData<TensorFineStencilSet> a_loTanStencilSets[SpaceDim],
00068 LayoutData<TensorFineStencilSet> a_hiTanStencilSets[SpaceDim]);
00069
00070
00072
00074 static void
00075 homogeneousCFInterpPhi(LevelData<FArrayBox>& a_phif,
00076 const DataIndex& a_datInd,
00077 int a_idir,
00078 Side::LoHiSide a_hiorlo,
00079 LayoutData<CFIVS> a_loCFIVS[SpaceDim],
00080 LayoutData<CFIVS> a_hiCFIVS[SpaceDim],
00081 Real a_dxLevel,
00082 Real a_dxCrse,
00083 int a_ncomp);
00084
00085 static void
00086 interpPhiOnIVS(LevelData<FArrayBox>& a_phif,
00087 const FArrayBox& a_phistar,
00088 const DataIndex& a_datInd,
00089 const int a_idir,
00090 const Side::LoHiSide a_hiorlo,
00091 const IntVectSet& a_interpIVS,
00092 Real a_dxLevel,
00093 Real a_dxCrse,
00094 int a_ncomp);
00095
00097
00099
00104 QuadCFInterp(
00105 const DisjointBoxLayout& a_fineBoxes,
00106 const DisjointBoxLayout* a_coarBoxes,
00107 Real a_dxFine,
00108 int a_refRatio,
00109 int a_nComp,
00110 const Box& a_domf);
00111
00113
00118 QuadCFInterp(
00119 const DisjointBoxLayout& a_fineBoxes,
00120 const DisjointBoxLayout* a_coarBoxes,
00121 Real a_dxFine,
00122 int a_refRatio,
00123 int a_nComp,
00124 const ProblemDomain& a_domf);
00125
00127
00131 void define(
00132 const DisjointBoxLayout& a_fineBoxes,
00133 const DisjointBoxLayout* a_coarBoxes,
00134 Real a_dxFine,
00135 int a_refRatio,
00136 int a_nComp,
00137 const ProblemDomain& a_domf);
00138
00140
00143 QuadCFInterp();
00144
00146 virtual ~QuadCFInterp();
00147
00149
00152 void clear();
00153
00155
00158 void coarseFineInterp(
00159 LevelData<FArrayBox>& a_phif,
00160 const LevelData<FArrayBox>& a_phic
00161 );
00162
00164
00167 bool isDefined() const;
00168
00169 static bool newCFInterMode;
00170
00171 protected:
00172
00173 BoxLayout m_coarBoxes;
00174
00175
00176 int m_level;
00177
00178
00179 int m_nComp;
00180
00181
00182 int m_refRatio;
00183
00184
00185 Real m_dxFine;
00186
00187
00188
00189 LayoutData<QuadCFStencil> m_loQCFS[SpaceDim];
00190
00191
00192
00193 LayoutData<QuadCFStencil> m_hiQCFS[SpaceDim];
00194
00195
00196 BoxLayoutData<FArrayBox> m_coarBuffer;
00197 Copier m_copier;
00198
00199 DisjointBoxLayout m_inputFineLayout;
00200 DisjointBoxLayout m_inputCoarLayout;
00202 bool m_isDefined;
00203 bool m_fineCoversCoarse;
00204 ProblemDomain m_domainFine;
00205 protected:
00206
00207
00208
00209
00210
00211 void coarseFineInterp(BaseFab<Real> & a_phif,
00212 const BaseFab<Real> & a_phic,
00213 const QuadCFStencil& a_qcfs,
00214 const Side::LoHiSide a_hiorlo,
00215 const int a_idir,
00216 const Interval& a_variables) const;
00217
00218
00219 void getPhiStar(BaseFab<Real> & a_phistar,
00220 const BaseFab<Real> & a_phic,
00221 const QuadCFStencil& a_qcfs,
00222 const Side::LoHiSide a_hiorlo,
00223 const int a_idir,
00224 const Interval& a_variables) const;
00225
00226
00227 void interpOnIVS(BaseFab<Real> & a_phif,
00228 const BaseFab<Real> & a_phiStar,
00229 const QuadCFStencil& a_qcfs,
00230 const Side::LoHiSide a_hiorlo,
00231 const int a_idir,
00232 const Interval& a_variables) const;
00233 };
00234
00235 #include "NamespaceFooter.H"
00236 #endif