00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef NODECOARSEAVERAGE_H
00029 #define NODECOARSEAVERAGE_H
00030
00031
00032 #include "REAL.H"
00033 #include "BaseFab.H"
00034 #include "IntVectSet.H"
00035 #include "NodeFArrayBox.H"
00036 #include "LevelData.H"
00037 #include "DisjointBoxLayout.H"
00038 #include "BitSet.H"
00039
00041
00042 class NodeCoarseAverage
00049 {
00050 public:
00051
00056
00058
00060 NodeCoarseAverage();
00061
00063
00066 NodeCoarseAverage(const DisjointBoxLayout& a_gridsFine,
00067 const DisjointBoxLayout& a_gridsCoarse,
00068 int a_numcomps,
00069 int a_refRatio,
00070 const ProblemDomain& a_domainFine);
00071
00073
00076 NodeCoarseAverage(const DisjointBoxLayout& a_gridsFine,
00077 const DisjointBoxLayout& a_gridsCoarse,
00078 int a_numcomps,
00079 int a_refRatio,
00080 const Box& a_domainFine);
00081
00083
00086 NodeCoarseAverage(const DisjointBoxLayout& a_gridsCoarse,
00087 int a_numcomps,
00088 int a_refRatio,
00089 const ProblemDomain& a_domainFine);
00090
00092
00095 NodeCoarseAverage(const DisjointBoxLayout& a_gridsCoarse,
00096 int a_numcomps,
00097 int a_refRatio,
00098 const Box& a_domainFine);
00099
00101
00103 ~NodeCoarseAverage();
00104
00106
00108 void define(
00109 const DisjointBoxLayout& a_gridsFine,
00111 const DisjointBoxLayout& a_gridsCoarse,
00113 int a_numcomps,
00115 int a_refRatio,
00117 const ProblemDomain& a_domainFine);
00118
00120
00122 void define(
00123 const DisjointBoxLayout& a_gridsFine,
00125 const DisjointBoxLayout& a_gridsCoarse,
00127 int a_numcomps,
00129 int a_refRatio,
00131 const Box& a_domainFine);
00132
00133
00135
00138 void define(
00139 const DisjointBoxLayout& a_gridsCoarse,
00141 int a_numcomps,
00143 int a_refRatio,
00145 const ProblemDomain& a_domainFine);
00146
00148
00151 void define(
00152 const DisjointBoxLayout& a_gridsCoarse,
00154 int a_numcomps,
00156 int a_refRatio,
00158 const Box& a_domainFine);
00159
00166
00168
00171 bool isDefined() const;
00172
00174
00177 void setVerbose( bool a_verbose );
00178
00179
00186
00188
00205
00206
00207 void averageToCoarse(
00208 LevelData<NodeFArrayBox>& a_coarse,
00210 LevelData<NodeFArrayBox>& a_fine);
00211
00214 protected:
00215
00218 bool is_defined;
00219
00222 bool m_verbose;
00223
00226 int m_refRatio;
00227
00230 int m_numcomps;
00231
00234 ProblemDomain m_domainCoarse;
00235
00239 Box m_refbox;
00240
00243 FArrayBox m_weights;
00244
00247 bool m_sameGrids;
00248
00251 DisjointBoxLayout m_coarsenedGrids;
00252
00255 LevelData<NodeFArrayBox> m_coarsenedFine;
00256
00259 LayoutData< Vector<IntVectSet> > m_IVSV;
00260
00263 LayoutData< BitSet > m_IVSVfull;
00264
00267 LayoutData< Vector<IntVectSet> > m_IVSVsame;
00268 };
00269
00270 #endif