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
00029
00030
00031
00032 #ifndef NODELEVELMG_H
00033 #define NODELEVELMG_H
00034
00035 #include <iostream>
00036 #include <cmath>
00037 #include <assert.h>
00038 #include <cstdlib>
00039 #include "REAL.H"
00040 #include "ProblemDomain.H"
00041 #include "DisjointBoxLayout.H"
00042 #include "NodeFArrayBox.H"
00043 #include "LevelData.H"
00044 #include "NodeCoarseAverage.H"
00045 #include "NodeLevelOp.H"
00046
00048
00053 class NodeLevelMG
00054 {
00055 public:
00056
00061
00063
00065 NodeLevelMG();
00066
00068
00071 NodeLevelMG(const DisjointBoxLayout& a_grids,
00072 const DisjointBoxLayout* a_gridsCoarsePtr,
00073 const ProblemDomain& a_domain,
00074 Real a_dx,
00075 int a_refToCoarse,
00076 const NodeLevelOp* const a_opin,
00077 int a_nCoarserLevels);
00078
00080
00083 NodeLevelMG(const DisjointBoxLayout& a_grids,
00084 const DisjointBoxLayout* a_gridsCoarsePtr,
00085 const Box& a_domain,
00086 Real a_dx,
00087 int a_refToCoarse,
00088 const NodeLevelOp* const a_opin,
00089 int a_nCoarserLevels);
00090
00092
00094 ~NodeLevelMG();
00095
00097
00100 NodeLevelMG(NodeLevelMG& a_L,
00101 int a_refToCoarse,
00102 const NodeLevelOp* a_opin);
00103
00105
00107 void define(
00108 const DisjointBoxLayout& a_grids,
00110 const DisjointBoxLayout* a_gridsCoarsePtr,
00112 const ProblemDomain& a_domain,
00114 Real a_dx,
00115
00116 int a_refToCoarse,
00118 const NodeLevelOp* const a_opin,
00120 int a_nCoarserLevels);
00121
00123
00125 void define(
00126 const DisjointBoxLayout& a_grids,
00128 const DisjointBoxLayout* a_gridsCoarsePtr,
00130 const Box& a_domain,
00132 Real a_dx,
00133
00134 int a_refToCoarse,
00136 const NodeLevelOp* const a_opin,
00138 int a_nCoarserLevels);
00139
00141
00143 void define(
00144 const NodeLevelMG& a_L,
00146 int a_refToCoarse,
00148 const NodeLevelOp* a_opin);
00149
00150
00151
00158
00160
00163 bool isDefined() const;
00164
00171
00173
00175 void setnumSmoothUp(int a_numSmoothUp);
00176
00178
00180 void setnumSmoothDown(int a_numSmoothDown);
00181
00183
00186 void setVerbose(bool a_verbose);
00187
00194
00196
00205 void mgRelax(
00206 LevelData<NodeFArrayBox>& a_phi,
00208 const LevelData<NodeFArrayBox>& a_rhs,
00210 bool a_bottomsolveflag);
00211
00216 NodeLevelOp* levelOpPtr();
00217
00220 NodeLevelMG* lCoarsePtr();
00221
00222 protected:
00223
00226 void setDefaultValues();
00227
00230 void clearMemory();
00231
00234 bool m_isDefined;
00235
00238 bool m_verbose;
00239
00240
00241
00244 LevelData<NodeFArrayBox> m_resid;
00245
00248 LevelData<NodeFArrayBox> m_crseResid;
00249
00252 LevelData<NodeFArrayBox> m_crseCorr;
00253
00256 DisjointBoxLayout m_grids;
00257
00260 DisjointBoxLayout m_coarsenedGrids;
00261
00264 const DisjointBoxLayout* m_gridsCoarsePtr;
00265
00268 Real m_dx;
00269
00272 ProblemDomain m_domain;
00273
00276 int m_nCoarserLevels;
00277
00280 NodeLevelMG* m_lCoarsePtr;
00281
00284 NodeLevelOp* m_levelopPtr;
00285
00288 int m_numBottomPoints;
00289
00292 int m_numSmoothUp;
00293
00296 int m_numSmoothDown;
00297
00300 int m_refToCoarsened;
00301
00304 NodeCoarseAverage m_averageOp;
00305
00308 Box m_boxRef;
00309
00312 FArrayBox m_weights;
00313
00314 private:
00315
00319 void crseCorrect(LevelData<NodeFArrayBox>& a_phi);
00320
00321 void operator=(const NodeLevelMG& a_levmgin){};
00322
00323 NodeLevelMG(const NodeLevelMG& a_levmgin) {};
00324 };
00325
00326 #endif