00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013
00014
00015 #ifndef NODELEVELMG_H
00016 #define NODELEVELMG_H
00017
00018 #include <iostream>
00019 #include <cmath>
00020 #include "SPACE.H"
00021 #include <cstdlib>
00022 #include "REAL.H"
00023 #include "ProblemDomain.H"
00024 #include "DisjointBoxLayout.H"
00025 #include "NodeFArrayBox.H"
00026 #include "LevelData.H"
00027 #include "NodeCoarseAverage.H"
00028 #include "NodeLevelOp.H"
00029
00030 #include "UsingNamespace.H"
00031
00033
00038 class NodeLevelMG
00039 {
00040 public:
00041
00046
00048
00050 NodeLevelMG();
00051
00053
00056 NodeLevelMG(const DisjointBoxLayout& a_grids,
00057 const DisjointBoxLayout* a_gridsCoarsePtr,
00058 const ProblemDomain& a_domain,
00059 Real a_dx,
00060 int a_refToCoarse,
00061 const NodeLevelOp* const a_opin,
00062 int a_nCoarserLevels);
00063
00065
00068 NodeLevelMG(const DisjointBoxLayout& a_grids,
00069 const DisjointBoxLayout* a_gridsCoarsePtr,
00070 const Box& a_domain,
00071 Real a_dx,
00072 int a_refToCoarse,
00073 const NodeLevelOp* const a_opin,
00074 int a_nCoarserLevels);
00075
00077
00079 ~NodeLevelMG();
00080
00082
00085 NodeLevelMG(NodeLevelMG& a_L,
00086 int a_refToCoarse,
00087 const NodeLevelOp* a_opin);
00088
00090
00092 void define(
00093 const DisjointBoxLayout& a_grids,
00095 const DisjointBoxLayout* a_gridsCoarsePtr,
00097 const ProblemDomain& a_domain,
00099 Real a_dx,
00100
00101 int a_refToCoarse,
00103 const NodeLevelOp* const a_opin,
00105 int a_nCoarserLevels);
00106
00108
00110 void define(
00111 const DisjointBoxLayout& a_grids,
00113 const DisjointBoxLayout* a_gridsCoarsePtr,
00115 const Box& a_domain,
00117 Real a_dx,
00118
00119 int a_refToCoarse,
00121 const NodeLevelOp* const a_opin,
00123 int a_nCoarserLevels);
00124
00126
00128 void define(
00129 const NodeLevelMG& a_L,
00131 int a_refToCoarse,
00133 const NodeLevelOp* a_opin);
00134
00135
00136
00143
00145
00148 bool isDefined() const;
00149
00156
00158
00160 void setnumSmoothUp(int a_numSmoothUp);
00161
00163
00165 void setnumSmoothDown(int a_numSmoothDown);
00166
00168
00171 void setVerbose(bool a_verbose);
00172
00179
00181
00190 void mgRelax(
00191 LevelData<NodeFArrayBox>& a_phi,
00193 const LevelData<NodeFArrayBox>& a_rhs,
00195 bool a_bottomsolveflag);
00196
00201 NodeLevelOp* levelOpPtr();
00202
00205 NodeLevelMG* lCoarsePtr();
00206
00207 protected:
00208
00211 void setDefaultValues();
00212
00215 void clearMemory();
00216
00219 bool m_isDefined;
00220
00223 bool m_verbose;
00224
00225
00226
00229 LevelData<NodeFArrayBox> m_resid;
00230
00233 LevelData<NodeFArrayBox> m_crseResid;
00234
00237 LevelData<NodeFArrayBox> m_crseCorr;
00238
00241 DisjointBoxLayout m_grids;
00242
00245 DisjointBoxLayout m_coarsenedGrids;
00246
00249 const DisjointBoxLayout* m_gridsCoarsePtr;
00250
00253 Real m_dx;
00254
00257 ProblemDomain m_domain;
00258
00261 int m_nCoarserLevels;
00262
00265 NodeLevelMG* m_lCoarsePtr;
00266
00269 NodeLevelOp* m_levelopPtr;
00270
00273 int m_numBottomPoints;
00274
00277 int m_numSmoothUp;
00278
00281 int m_numSmoothDown;
00282
00285 int m_refToCoarsened;
00286
00289 NodeCoarseAverage m_averageOp;
00290
00293 Box m_boxRef;
00294
00297 FArrayBox m_weights;
00298
00299 private:
00300
00304 void crseCorrect(LevelData<NodeFArrayBox>& a_phi);
00305
00306 void operator=(const NodeLevelMG& a_levmgin){};
00307
00308 NodeLevelMG(const NodeLevelMG& a_levmgin) {};
00309 };
00310
00311 #endif