00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _QUADCFSTENCIL_H_
00012 #define _QUADCFSTENCIL_H_
00013
00014 #include <iostream>
00015 #include <math.h>
00016 #include "SPACE.H"
00017 #include <stdlib.h>
00018 #include "REAL.H"
00019 #include "IntVect.H"
00020 #include "Box.H"
00021 #include "DisjointBoxLayout.H"
00022 #include "FArrayBox.H"
00023 #include "IntVectSet.H"
00024 #include "CFStencil.H"
00025 #include "DerivStencil.H"
00026 #include "NamespaceHeader.H"
00027
00029
00034 class QuadCFStencil
00035 {
00036
00037 public:
00039
00041
00049 Real computeSecondDerivative(
00050 const BaseFab<Real> & a_phic,
00051 int a_derivdir,
00052 int a_ivar,
00053 const IntVect& a_ivin,
00054 Real a_dx) const;
00055
00057
00065 Real computeFirstDerivative(
00066 const BaseFab<Real> & a_phic,
00067 int a_derivdir,
00068 int a_ivar,
00069 const IntVect& a_ivin,
00070 Real a_dx) const;
00071
00073
00083 Real computeMixedDerivative(
00084 const BaseFab<Real> & a_phic,
00085 int a_ivar,
00086 const IntVect& a_ivin,
00087 Real a_dx) const;
00088
00090 QuadCFStencil();
00091
00093 ~QuadCFStencil();
00094
00096 QuadCFStencil(
00097 const Box& a_fine_domain,
00098 const Box& a_grid,
00099 const DisjointBoxLayout& a_fineBoxes,
00100 const DisjointBoxLayout& a_coarBoxes,
00101 int a_refRatio,
00102 int a_direction,
00103 Side::LoHiSide a_hiorlo);
00104
00106 QuadCFStencil(
00107 const ProblemDomain& a_fine_domain,
00108 const Box& a_grid,
00109 const DisjointBoxLayout& a_fineBoxes,
00110 const DisjointBoxLayout& a_coarBoxes,
00111 int a_refRatio,
00112 int a_direction,
00113 Side::LoHiSide a_hiorlo);
00114
00116 void define(
00117 const Box& a_fine_domain,
00118 const Box& a_grid,
00119 const DisjointBoxLayout& a_fineBoxes,
00120 const DisjointBoxLayout& a_coarBoxes,
00121 int a_refRatio,
00122 int a_direction,
00123 Side::LoHiSide a_hiorlo);
00124
00126 void define(
00127 const ProblemDomain& a_fine_domain,
00128 const Box& a_grid,
00129 const DisjointBoxLayout& a_fineBoxes,
00130 const DisjointBoxLayout& a_coarBoxes,
00131 int a_refRatio,
00132 int a_direction,
00133 Side::LoHiSide a_hiorlo);
00134
00135
00137 void define(
00138 const ProblemDomain& a_fine_domain,
00139 const Box& a_grid,
00140 const Vector<Box>& a_periodicBoxes,
00141 const Vector<Box>& a_coarsenedPeriodicBoxes,
00142 const DisjointBoxLayout& a_coarBoxes,
00143 int a_refRatio,
00144 int a_direction,
00145 Side::LoHiSide a_hiorlo);
00146
00148
00150
00153 bool isDefined() const;
00154
00156
00159 bool isEmpty() const
00160 {
00161 CH_assert(m_baseCFS.isDefined());
00162 return m_baseCFS.isEmpty();
00163 }
00164
00166
00168 const IntVectSet& getFineIVS() const
00169 {
00170 CH_assert(m_baseCFS.isDefined());
00171 return m_baseCFS.getFineIVS();
00172 }
00173
00175
00177 const IntVectSet& getCoarIVS() const
00178 {
00179 CH_assert(m_baseCFS.isDefined());
00180 return m_baseCFS.getCoarIVS();
00181 }
00182
00183 bool finePacked() const
00184 {
00185 return m_baseCFS.isPacked();
00186 }
00187
00188 const Box& packedBox() const
00189 {
00190 return m_baseCFS.packedBox();
00191 }
00192
00193
00194 protected:
00195
00196
00197 bool m_isDefined;
00198
00199
00200 int m_direction;
00201
00203
00209 IntVectSet m_ivsStandard;
00210
00212
00216 IntVectSet m_ivsQuadd;
00217
00224
00225
00229 BaseFab<DerivStencil> m_mixedSten;
00230
00232
00236 BaseFab<DerivStencil> m_second[SpaceDim];
00237
00239
00243 BaseFab<DerivStencil> m_firstD[SpaceDim];
00244
00246
00250 BaseFab<bool> m_dropOrd;
00251
00253 CFStencil m_baseCFS;
00254
00255
00256 private:
00257
00258
00259
00260 void setDefaultValues();
00261
00262
00263
00264
00265 void addFabToSten(const BaseFab<Real> & fabin_a,
00266 DerivStencil& sten_a);
00267
00268
00269 void operator= (const QuadCFStencil& cfs_in)
00270 {
00271 }
00272
00273
00274 QuadCFStencil(const QuadCFStencil& cfs_in)
00275 {
00276 }
00277
00278 void buildStencils(const IntVectSet& ivsAllGood);
00279
00280 };
00281
00282 #include "NamespaceFooter.H"
00283 #endif