Chombo + EB  3.2
PetscCompGridPois.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _PETSCCOMPGRIDPOIS_H_
12 #define _PETSCCOMPGRIDPOIS_H_
13 #ifdef CH_USE_PETSC
14 
15 #include "PetscCompGrid.H"
16 #include "NamespaceHeader.H"
17 
18 //! \class PetscCompGridPois
19 //! This base class organizes the construction of a PETSc matrix,
20 //! and solve with an AMR hierarchy
21 #define COMP_POIS_DOF 1
23 {
24 public:
25  //! Base class constructor. Called by all subclass constructors.
26  PetscCompGridPois(Real a_al=0., Real a_be=-1.0, int a_order=2) :
27  PetscCompGrid(COMP_POIS_DOF), m_alpha(a_al), m_beta(a_be), m_order(a_order), m_cornerStencil(false)
28  {
29  }
30  virtual void clean();
31 
32  //! Destructor.
34  {
35  clean();
36  }
37  bool isCornerStencil() const {return m_cornerStencil;}
38  void setCornerStencil(bool a_b=true) {m_cornerStencil = a_b;}
39  virtual IntVect getGhostVect()const
40  {
41  return (m_order==2) ? IntVect::Unit : 2*IntVect::Unit;
42  }
43  Real getAlpha()const{return m_alpha;}
44  Real getBeta()const{return m_beta;}
45  void setAlpha(Real a_b) {m_alpha = a_b;}
46  void setBeta(Real a_b) {m_beta = a_b;}
47  int getOrder()const{return m_order;}
48  void setOrder(int a_b) {m_order = a_b;}
49 protected:
50  virtual void createOpStencil(IntVect,int,const DataIndex&,StencilTensor &);
53  int m_order;
55 };
56 
57 #include "NamespaceFooter.H"
58 #endif
59 #endif
bool isCornerStencil() const
Definition: PetscCompGridPois.H:37
Definition: PetscCompGridPois.H:22
int m_order
Definition: PetscCompGridPois.H:53
Real getBeta() const
Definition: PetscCompGridPois.H:44
#define COMP_POIS_DOF
Definition: PetscCompGridPois.H:21
Real getAlpha() const
Definition: PetscCompGridPois.H:43
std::map< IndexML, StencilTensorValue > StencilTensor
Definition: Stencil.H:137
virtual IntVect getGhostVect() const
Definition: PetscCompGridPois.H:39
static const IntVect Unit
Definition: IntVect.H:659
PetscCompGridPois(Real a_al=0., Real a_be=-1.0, int a_order=2)
Base class constructor. Called by all subclass constructors.
Definition: PetscCompGridPois.H:26
Definition: PetscCompGrid.H:30
int getOrder() const
Definition: PetscCompGridPois.H:47
double Real
Definition: REAL.H:33
virtual ~PetscCompGridPois()
Destructor.
Definition: PetscCompGridPois.H:33
virtual void clean()
Real m_alpha
Definition: PetscCompGridPois.H:51
Definition: DataIndex.H:112
void setOrder(int a_b)
Definition: PetscCompGridPois.H:48
void setAlpha(Real a_b)
Definition: PetscCompGridPois.H:45
Real m_beta
Definition: PetscCompGridPois.H:52
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
void setBeta(Real a_b)
Definition: PetscCompGridPois.H:46
virtual void createOpStencil(IntVect, int, const DataIndex &, StencilTensor &)
void setCornerStencil(bool a_b=true)
Definition: PetscCompGridPois.H:38
bool m_cornerStencil
Definition: PetscCompGridPois.H:54