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
00033 #ifndef AMRNODESOLVERALT_H
00034 #define AMRNODESOLVERALT_H
00035
00036 #include <cstdlib>
00037 #include <cmath>
00038 #include <iostream>
00039 #include <assert.h>
00040 #include "REAL.H"
00041 #include "ProblemDomain.H"
00042 #include "NodeFArrayBox.H"
00043 #include "Vector.H"
00044 #include "IntVectSet.H"
00045 #include "DisjointBoxLayout.H"
00046 #include "LevelData.H"
00047 #include "LevelNodeSolver.H"
00048
00050
00057 class AMRNodeSolverAlt
00058 {
00059 public:
00060
00062
00064
00068 AMRNodeSolverAlt();
00069
00071
00074 AMRNodeSolverAlt(const Vector<DisjointBoxLayout>& a_gridsLevel,
00075 const Vector<ProblemDomain>& a_domainLevel,
00076 const Vector<Real>& a_dxLevel,
00077 const Vector<int>& a_refRatio,
00078 int a_numLevels,
00079 int a_lBase,
00080 const NodeLevelOp* const a_opin,
00081 int a_minLength = 1);
00082
00083 AMRNodeSolverAlt(const Vector<DisjointBoxLayout>& a_gridsLevel,
00084 const Vector<Box>& a_domainLevel,
00085 const Vector<Real>& a_dxLevel,
00086 const Vector<int>& a_refRatio,
00087 int a_numLevels,
00088 int a_lBase,
00089 const NodeLevelOp* const a_opin,
00090 int a_minLength = 1);
00091
00092
00094
00096 ~AMRNodeSolverAlt();
00097
00099
00120 void define(const Vector<DisjointBoxLayout>& a_gridsLevel,
00121 const Vector<ProblemDomain>& a_domainLevel,
00122 const Vector<Real>& a_dxLevel,
00123 const Vector<int>& a_refRatio,
00124 int a_numLevels,
00125 int a_lBase,
00126 const NodeLevelOp* const a_opin,
00127 int a_minLength = 1);
00128
00129 void define(const Vector<DisjointBoxLayout>& a_gridsLevel,
00130 const Vector<Box>& a_domainLevel,
00131 const Vector<Real>& a_dxLevel,
00132 const Vector<int>& a_refRatio,
00133 int a_numLevels,
00134 int a_lBase,
00135 const NodeLevelOp* const a_opin,
00136 int a_minLength = 1);
00137
00139
00141
00143 bool isDefined() const;
00144
00146
00148
00150 void setTolerance(Real a_tolerance);
00151
00153
00156 void setBottomSmoothing(bool a_doBottomSmooth);
00157
00159
00162 void setMaxIter(int a_maxIter);
00163
00165
00167 void setVerbose(bool a_verbose);
00168
00169
00171
00173
00187 void solveAMR(Vector<LevelData<NodeFArrayBox> *>& a_phiLevel,
00188 const Vector<LevelData<NodeFArrayBox> *>& a_rhsLevel);
00189
00190 protected:
00191
00192
00193 void setDefaultValues();
00194
00195 void clear();
00196
00197
00198 int m_lBase;
00199
00200
00201 int m_numLevels;
00202
00203
00204 int m_finestLevel;
00205
00206
00207 Vector<int> m_refRatio;
00208
00209
00210 Vector<Real> m_dxLevel;
00211
00212
00213 Vector<DisjointBoxLayout> m_gridsLevel;
00214
00215
00216 Vector<ProblemDomain> m_domainLevel;
00217
00218 bool m_isDefined;
00219
00220
00221 Vector<LevelNodeSolver*> m_levelSolver;
00222
00223
00224 bool m_verbose;
00225
00226 private:
00227 AMRNodeSolverAlt(const AMRNodeSolverAlt&);
00228 AMRNodeSolverAlt& operator=(const AMRNodeSolverAlt&);
00229
00230
00231 };
00232 #endif