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 "NodeFArrayBox.H"
00035 #include "LevelData.H"
00036 #include "DisjointBoxLayout.H"
00037
00039
00040 class NodeCoarseAverage
00047 {
00048 public:
00049
00051
00053
00055 NodeCoarseAverage();
00056
00058
00061 NodeCoarseAverage(const DisjointBoxLayout& a_gridsFine,
00062 const DisjointBoxLayout& a_gridsCoarse,
00063 int a_numcomps,
00064 int a_refRatio,
00065 const ProblemDomain& a_domainFine);
00066
00067 NodeCoarseAverage(const DisjointBoxLayout& a_gridsFine,
00068 const DisjointBoxLayout& a_gridsCoarse,
00069 int a_numcomps,
00070 int a_refRatio,
00071 const Box& a_domainFine);
00072
00074
00077 NodeCoarseAverage(const DisjointBoxLayout& a_gridsCoarse,
00078 int a_numcomps,
00079 int a_refRatio,
00080 const ProblemDomain& a_domainFine);
00081
00082 NodeCoarseAverage(const DisjointBoxLayout& a_gridsCoarse,
00083 int a_numcomps,
00084 int a_refRatio,
00085 const Box& a_domainFine);
00086
00088
00090 ~NodeCoarseAverage();
00091
00093
00105 void define(const DisjointBoxLayout& a_gridsFine,
00106 const DisjointBoxLayout& a_gridsCoarse,
00107 int a_numcomps,
00108 int a_refRatio,
00109 const ProblemDomain& a_domainFine);
00110
00111 void define(const DisjointBoxLayout& a_gridsFine,
00112 const DisjointBoxLayout& a_gridsCoarse,
00113 int a_numcomps,
00114 int a_refRatio,
00115 const Box& a_domainFine);
00116
00118
00130 void define(const DisjointBoxLayout& a_gridsCoarse,
00131 int a_numcomps,
00132 int a_refRatio,
00133 const ProblemDomain& a_domainFine);
00134
00135 void define(const DisjointBoxLayout& a_gridsCoarse,
00136 int a_numcomps,
00137 int a_refRatio,
00138 const Box& a_domainFine);
00139
00141
00143
00146 bool isDefined() const;
00147
00148
00150
00152
00172
00173
00174 void averageToCoarse(LevelData<NodeFArrayBox>& a_coarse,
00175 LevelData<NodeFArrayBox>& a_fine);
00176
00177 protected:
00178
00179 bool is_defined;
00180
00181
00182 int m_refRatio;
00183
00184
00185 int m_numcomps;
00186
00187 ProblemDomain m_domainCoarse;
00188
00189 FArrayBox m_weights;
00190
00191
00192 bool m_sameGrids;
00193
00194 DisjointBoxLayout m_coarsenedGrids;
00195
00196
00197
00198 LevelData<NodeFArrayBox> m_coarsenedFine;
00199
00200
00201
00202 LayoutData< Vector<IntVectSet> > m_IVSV;
00203
00204
00205
00206 LayoutData< Vector<IntVectSet> > m_IVSVsame;
00207
00208 };
00209
00210 #endif