00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _VCAMRPOISSONOP2_H_
00012 #define _VCAMRPOISSONOP2_H_
00013
00014 #include "AMRPoissonOp.H"
00015
00016 #include "NamespaceHeader.H"
00017
00019
00024 class VCAMRPoissonOp2 : public AMRPoissonOp
00025 {
00026 public:
00030
00032
00034 VCAMRPoissonOp2() { ; }
00035
00037
00039 virtual ~VCAMRPoissonOp2() { ; }
00040
00042 virtual void residualI(LevelData<FArrayBox>& a_lhs,
00043 const LevelData<FArrayBox>& a_phi,
00044 const LevelData<FArrayBox>& a_rhs,
00045 bool a_homogeneous = false);
00046
00048 virtual void preCond(LevelData<FArrayBox>& a_correction,
00049 const LevelData<FArrayBox>& a_residual);
00050
00052 virtual void applyOpI(LevelData<FArrayBox>& a_lhs,
00053 const LevelData<FArrayBox>& a_phi,
00054 bool a_homogeneous = false);
00055
00056 virtual void applyOpNoBoundary(LevelData<FArrayBox>& a_lhs,
00057 const LevelData<FArrayBox>& a_phi);
00058
00064
00065 virtual void relax(LevelData<FArrayBox>& a_e,
00066 const LevelData<FArrayBox>& a_residual,
00067 int a_iterations);
00068
00073 virtual void restrictResidual(LevelData<FArrayBox>& a_resCoarse,
00074 LevelData<FArrayBox>& a_phiFine,
00075 const LevelData<FArrayBox>& a_rhsFine);
00076
00082
00084 virtual void setAlphaAndBeta(const Real& a_alpha,
00085 const Real& a_beta);
00086
00088 virtual void setCoefs(const RefCountedPtr<LevelData<FArrayBox> >& a_aCoef,
00089 const RefCountedPtr<LevelData<FluxBox> >& a_bCoef,
00090 const Real& a_alpha,
00091 const Real& a_beta);
00092
00094 virtual void resetLambda();
00095
00097 virtual void computeLambda();
00098
00099 virtual void reflux(const LevelData<FArrayBox>& a_phiFine,
00100 const LevelData<FArrayBox>& a_phi,
00101 LevelData<FArrayBox>& a_residual,
00102 AMRLevelOp<LevelData<FArrayBox> >* a_finerOp);
00103
00106
00107 RefCountedPtr<LevelData<FArrayBox> > m_aCoef;
00108
00110 RefCountedPtr<LevelData<FluxBox> > m_bCoef;
00111
00113 LevelData<FArrayBox> m_lambda;
00114
00115 protected:
00116 LayoutData<CFIVS> m_loCFIVS[SpaceDim];
00117 LayoutData<CFIVS> m_hiCFIVS[SpaceDim];
00118
00119 virtual void levelGSRB(LevelData<FArrayBox>& a_phi,
00120 const LevelData<FArrayBox>& a_rhs);
00121
00122 virtual void levelMultiColor(LevelData<FArrayBox>& a_phi,
00123 const LevelData<FArrayBox>& a_rhs);
00124
00125 virtual void looseGSRB(LevelData<FArrayBox>& a_phi,
00126 const LevelData<FArrayBox>& a_rhs);
00127
00128 virtual void overlapGSRB(LevelData<FArrayBox>& a_phi,
00129 const LevelData<FArrayBox>& a_rhs);
00130
00131 virtual void levelGSRBLazy(LevelData<FArrayBox>& a_phi,
00132 const LevelData<FArrayBox>& a_rhs);
00133
00134 virtual void levelJacobi(LevelData<FArrayBox>& a_phi,
00135 const LevelData<FArrayBox>& a_rhs);
00136
00138 virtual void getFlux(FArrayBox& a_flux,
00139 const FArrayBox& a_data,
00140 const FluxBox& a_bCoef,
00141 const Box& a_facebox,
00142 int a_dir,
00143 int a_ref = 1) const ;
00144 #if 0
00146 void computeOperatorNoBCs(LevelData<FArrayBox>& a_lhs,
00147 const LevelData<FArrayBox>& a_phi);
00148 #endif
00149 };
00150
00152
00155 class VCAMRPoissonOp2Factory: public AMRLevelOpFactory<LevelData<FArrayBox> >
00156 {
00157 public:
00158 VCAMRPoissonOp2Factory();
00159
00160 virtual ~VCAMRPoissonOp2Factory() { ; }
00161
00163
00176 void define(const ProblemDomain& a_coarseDomain,
00177 const Vector<DisjointBoxLayout>& a_grids,
00178 const Vector<int>& a_refRatios,
00179 const Real& a_coarsedx,
00180 BCHolder a_bc,
00181 const Real& a_alpha,
00182 Vector<RefCountedPtr<LevelData<FArrayBox> > >& a_aCoef,
00183 const Real& a_beta,
00184 Vector<RefCountedPtr<LevelData<FluxBox> > >& a_bCoef);
00185
00187 virtual MGLevelOp<LevelData<FArrayBox> >* MGnewOp(const ProblemDomain& a_FineindexSpace,
00188 int a_depth,
00189 bool a_homoOnly = true);
00190
00192 virtual AMRLevelOp<LevelData<FArrayBox> >* AMRnewOp(const ProblemDomain& a_indexSpace);
00193
00195 virtual int refToFiner(const ProblemDomain& a_domain) const;
00196
00197 int m_coefficient_average_type;
00198
00199 private:
00200 void setDefaultValues();
00201
00202 Vector<ProblemDomain> m_domains;
00203 Vector<DisjointBoxLayout> m_boxes;
00204
00205 Vector<Real> m_dx;
00206 Vector<int> m_refRatios;
00207
00208 BCHolder m_bc;
00209
00210 Real m_alpha;
00211 Real m_beta;
00212
00213 Vector<RefCountedPtr<LevelData<FArrayBox> > > m_aCoef;
00214 Vector<RefCountedPtr<LevelData<FluxBox> > > m_bCoef;
00215
00216 Vector<RefCountedPtr<LevelData<FArrayBox> > > m_lambda;
00217
00218 Vector<Copier> m_exchangeCopiers;
00219 Vector<CFRegion> m_cfregion;
00220 };
00221
00222 #include "NamespaceFooter.H"
00223 #endif