00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013
00014
00015
00016 #ifndef AMRNODESOLVERALT_H
00017 #define AMRNODESOLVERALT_H
00018
00019 #include <cstdlib>
00020 #include <cmath>
00021 #include <iostream>
00022 #include "SPACE.H"
00023 #include "REAL.H"
00024 #include "ProblemDomain.H"
00025 #include "NodeFArrayBox.H"
00026 #include "Vector.H"
00027 #include "IntVectSet.H"
00028 #include "DisjointBoxLayout.H"
00029 #include "LevelData.H"
00030 #include "LevelNodeSolver.H"
00031
00032 #include "UsingNamespace.H"
00033
00035
00043 class AMRNodeSolverAlt
00044 {
00045 public:
00046
00051
00053
00057 AMRNodeSolverAlt();
00058
00060
00063 AMRNodeSolverAlt(const Vector<DisjointBoxLayout>& a_gridsLevel,
00064 const Vector<ProblemDomain>& a_domainLevel,
00065 const Vector<Real>& a_dxLevel,
00066 const Vector<int>& a_refRatio,
00067 int a_numLevels,
00068 int a_lBase,
00069 const NodeLevelOp* const a_opin,
00070 int a_minLength = 1);
00071
00073
00076 AMRNodeSolverAlt(const Vector<DisjointBoxLayout>& a_gridsLevel,
00077 const Vector<Box>& a_domainLevel,
00078 const Vector<Real>& a_dxLevel,
00079 const Vector<int>& a_refRatio,
00080 int a_numLevels,
00081 int a_lBase,
00082 const NodeLevelOp* const a_opin,
00083 int a_minLength = 1);
00084
00085
00087
00089 ~AMRNodeSolverAlt();
00090
00092
00098 void define(
00099 const Vector<DisjointBoxLayout>& a_gridsLevel,
00101 const Vector<ProblemDomain>& a_domainLevel,
00103 const Vector<Real>& a_dxLevel,
00105 const Vector<int>& a_refRatio,
00107 int a_numLevels,
00109 int a_lBase,
00111 const NodeLevelOp* const a_opin,
00113 int a_minLength = 1);
00114
00115
00117
00123 void define(
00124 const Vector<DisjointBoxLayout>& a_gridsLevel,
00126 const Vector<Box>& a_domainLevel,
00128 const Vector<Real>& a_dxLevel,
00130 const Vector<int>& a_refRatio,
00132 int a_numLevels,
00134 int a_lBase,
00136 const NodeLevelOp* const a_opin,
00138 int a_minLength = 1);
00139
00146
00148
00150 bool isDefined() const;
00151
00158
00160
00163 void setNumSmoothUp(int a_numSmoothUp);
00164
00166
00169 void setNumSmoothDown(int a_numSmoothDown);
00170
00172
00174 void setTolerance(Real a_tolerance);
00175
00177
00180 void setBottomSmoothing(bool a_doBottomSmooth);
00181
00183
00186 void setMaxIter(int a_maxIter);
00187
00189
00191 void setVerbose(bool a_verbose);
00192
00193
00200
00202
00212 void solveAMR(
00213 Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00215 const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00216
00219 protected:
00220
00223 void setDefaultValues();
00224
00227 void clear();
00228
00231 Real m_tolerance;
00232
00235 int m_lBase;
00236
00239 int m_numLevels;
00240
00243 int m_finestLevel;
00244
00248 Vector<int> m_refRatio;
00249
00252 Vector<Real> m_dxLevel;
00253
00256 Vector<DisjointBoxLayout> m_gridsLevel;
00257
00260 Vector<ProblemDomain> m_domainLevel;
00261
00264 int m_numSmoothUp;
00265
00268 int m_numSmoothDown;
00269
00272 bool m_isDefined;
00273
00276 Vector<LevelNodeSolver*> m_levelSolver;
00277
00280 bool m_verbose;
00281
00282 private:
00283 AMRNodeSolverAlt(const AMRNodeSolverAlt&);
00284 AMRNodeSolverAlt& operator=(const AMRNodeSolverAlt&);
00285
00286
00287 };
00288 #endif