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 #ifndef NODEPOISSONOP_H
00032 #define NODEPOISSONOP_H
00033
00034 #include "NodeLevelOp.H"
00035 #include <cmath>
00036 #include <cstdlib>
00037 #include "BaseFab.H"
00038 #include "NodeCFIVS.H"
00039 #include "NodeBC.H"
00040 #include "NodeQuadCFInterp.H"
00041 #include "NodeBaseBottomSmoother.H"
00042 #include "LoHiSide.H"
00043
00045 class NodePoissonOp: public NodeLevelOp
00048 {
00049 public:
00050
00055
00057
00059 NodePoissonOp();
00060
00062
00068 virtual NodeLevelOp* new_levelop() const;
00069
00071
00073 ~NodePoissonOp();
00074
00076
00080 void define(
00081 const DisjointBoxLayout& a_grids,
00083 const DisjointBoxLayout* a_gridsCoarsePtr,
00085 Real a_dx,
00087 int a_refToCoarse,
00089 const ProblemDomain& a_domain,
00091 bool a_homogeneousOnly = false,
00093 int a_ncomp = 1,
00095 bool a_verbose = false);
00096
00097
00099
00103 void define(
00104 const DisjointBoxLayout& a_grids,
00106 const DisjointBoxLayout* a_gridsCoarsePtr,
00108 Real a_dx,
00110 int a_refToCoarse,
00112 const Box& a_domain,
00114 bool a_homogeneousOnly = false,
00116 int a_ncomp = 1,
00118 bool a_verbose = false);
00119
00121
00125 void define(
00126 const NodeLevelOp* a_opfine,
00128 int a_refToFine);
00129
00136
00138
00141 virtual bool isDefined() const;
00142
00149
00150
00151
00152
00153
00155
00157 virtual void setVerbose( bool a_verbose );
00158
00160
00162 void setBottomSmoother(const NodeBaseBottomSmoother& a_bottomSmoother);
00163
00165
00167 void setDomainNodeBC(const DomainNodeBC& a_dombcin);
00168
00170
00177 void setInterpolationDegree(int a_interpolationDegree);
00178
00185
00187
00191 void CFInterp(
00192 LevelData<NodeFArrayBox>& a_phi,
00194 const LevelData<NodeFArrayBox>& a_phiCoarse,
00196 bool a_inhomogeneous);
00197
00199
00202 void homogeneousCFInterp(
00203 LevelData<NodeFArrayBox>& a_phi);
00204
00211
00213
00222 void residualI(
00223 LevelData<NodeFArrayBox>& a_resid,
00225 LevelData<NodeFArrayBox>& a_phi,
00227 const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00229 const LevelData<NodeFArrayBox>& a_rhs);
00230
00232
00241 void residualH(
00242 LevelData<NodeFArrayBox>& a_resid,
00244 LevelData<NodeFArrayBox>& a_phi,
00246 const LevelData<NodeFArrayBox>& a_rhs);
00247
00249
00258 void residualIcfHphys(
00259 LevelData<NodeFArrayBox>& a_resid,
00261 LevelData<NodeFArrayBox>& a_phi,
00263 const LevelData<NodeFArrayBox>* a_phiCoarsePtr,
00265 const LevelData<NodeFArrayBox>& a_rhs);
00266
00268
00277 void residualHcfIphys(
00278 LevelData<NodeFArrayBox>& a_resid,
00280 LevelData<NodeFArrayBox>& a_phi,
00282 const LevelData<NodeFArrayBox>& a_rhs);
00283
00290
00292
00300 void applyOpI(
00301 LevelData<NodeFArrayBox>& a_LofPhi,
00303 LevelData<NodeFArrayBox>& a_phi,
00305 const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00306
00308
00316 void applyOpH(
00317 LevelData<NodeFArrayBox>& a_LofPhi,
00319 LevelData<NodeFArrayBox>& a_phi);
00320
00322
00330 void applyOpIcfHphys(
00331 LevelData<NodeFArrayBox>& a_LofPhi,
00333 LevelData<NodeFArrayBox>& a_phi,
00335 const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00336
00338
00346 void applyOpHcfIphys(
00347 LevelData<NodeFArrayBox>& a_LofPhi,
00349 LevelData<NodeFArrayBox>& a_phi);
00350
00357
00359
00367 void gradient(
00368 LevelData<NodeFArrayBox>& a_gradPhi,
00370 LevelData<NodeFArrayBox>& a_phi,
00372 const LevelData<NodeFArrayBox>* a_phiCoarsePtr);
00373
00380
00382
00387 void smooth(
00388 LevelData<NodeFArrayBox>& a_phi,
00390 const LevelData<NodeFArrayBox>& a_rhs);
00391
00393
00397 void levelPreconditioner(
00398 LevelData<NodeFArrayBox>& a_phihat,
00400 const LevelData<NodeFArrayBox>& a_rhshat);
00401
00403
00405 void bottomSmoother(
00406 LevelData<NodeFArrayBox>& a_phi,
00408 const LevelData<NodeFArrayBox>& a_rhs);
00409
00412 protected:
00413
00416 DomainNodeBC m_dombc;
00417
00420 int m_interpolationDegree;
00421
00422
00423
00424
00425
00428 ProblemDomain m_domainInteriorNodes;
00429
00432 DisjointBoxLayout m_grids;
00433
00436 Copier m_exchangeCopier;
00437
00440 DisjointBoxLayout m_gridsCoarse;
00441
00444 int m_ncomp;
00445
00448 int m_refToCoarse;
00449
00452 Real m_dx;
00453
00456 Real m_dxCoarse;
00457
00460 bool m_isDefined;
00461
00464 bool m_isBCDefined;
00465
00468 bool m_ihcfiEnabled;
00469
00472 LayoutData<NodeCFIVS> m_loCFIVS[SpaceDim];
00473
00476 LayoutData<NodeCFIVS> m_hiCFIVS[SpaceDim];
00477
00478
00479
00480
00483 NodeQuadCFInterp m_qcfi;
00484
00487 NodeBaseBottomSmoother* m_bottomSmootherPtr;
00488
00491 LayoutData< Vector<IntVectSet> > m_IVSV;
00492
00495 LayoutData< BitSet > m_IVSVfull;
00496
00497
00498
00499
00500
00501 private:
00502
00503
00507 void setCFIVS();
00508
00512 void levelGSRB(LevelData<NodeFArrayBox>& a_phi,
00513 const LevelData<NodeFArrayBox>& a_rhs);
00514
00519 void applyOpOnly(LevelData<NodeFArrayBox>& a_LofPhi,
00520 const LevelData<NodeFArrayBox>& a_phi);
00521
00526 void gradientOnly(LevelData<NodeFArrayBox>& a_gradPhi,
00527 const LevelData<NodeFArrayBox>& a_phi);
00528
00532 void homogeneousCFInterp(FArrayBox& a_phiFab,
00533 const DataIndex& a_datInd,
00534 const int a_idir,
00535 const Side::LoHiSide a_hiorlo);
00536
00537 void clearMemory();
00538
00539 void setDefaultValues();
00540
00541 void residualDiff(LevelData<NodeFArrayBox>& a_resid,
00542 const LevelData<NodeFArrayBox>& a_rhs);
00543
00544 };
00545
00546 #endif