00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _PETSCCOMPGRIDPOIS_H_ 00012 #define _PETSCCOMPGRIDPOIS_H_ 00013 #ifdef CH_USE_PETSC 00014 00015 #include "PetscCompGrid.H" 00016 #include "NamespaceHeader.H" 00017 00018 //! \class PetscCompGridPois 00019 //! This base class organizes the construction of a PETSc matrix, 00020 //! and solve with an AMR hierarchy 00021 #define COMP_POIS_DOF 1 00022 class PetscCompGridPois : public PetscCompGrid 00023 { 00024 public: 00025 //! Base class constructor. Called by all subclass constructors. 00026 PetscCompGridPois(Real a_al=0., Real a_be=-1.0, int a_order=2) : 00027 PetscCompGrid(COMP_POIS_DOF), m_alpha(a_al), m_beta(a_be), m_order(a_order), m_cornerStencil(false) 00028 { 00029 } 00030 virtual void clean(); 00031 00032 //! Destructor. 00033 virtual ~PetscCompGridPois() 00034 { 00035 clean(); 00036 } 00037 bool isCornerStencil() const {return m_cornerStencil;} 00038 void setCornerStencil(bool a_b=true) {m_cornerStencil = a_b;} 00039 virtual IntVect getGhostVect()const 00040 { 00041 return (m_order==2) ? IntVect::Unit : 2*IntVect::Unit; 00042 } 00043 Real getAlpha()const{return m_alpha;} 00044 Real getBeta()const{return m_beta;} 00045 void setAlpha(Real a_b) {m_alpha = a_b;} 00046 void setBeta(Real a_b) {m_beta = a_b;} 00047 int getOrder()const{return m_order;} 00048 void setOrder(int a_b) {m_order = a_b;} 00049 protected: 00050 virtual void createOpStencil(IntVect,int,const DataIndex&,StencilTensor &); 00051 Real m_alpha; 00052 Real m_beta; 00053 int m_order; 00054 bool m_cornerStencil; 00055 }; 00056 00057 #include "NamespaceFooter.H" 00058 #endif 00059 #endif