11 #ifndef _PETSCCOMPGRID_H_ 12 #define _PETSCCOMPGRID_H_ 21 #include "NamespaceHeader.H" 45 #if defined(PETSC_USE_LOG) 46 PetscLogEventRegister(
"createMatrix",PETSC_VIEWER_CLASSID,&m_event0);
47 PetscLogEventRegister(
"PetscCompGrid",PETSC_VIEWER_CLASSID,&m_event1);
48 PetscLogEventRegister(
"Prepartsition",PETSC_VIEWER_CLASSID,&m_event2);
57 int a_numLevels=-1,
int a_ibase=0);
89 a_node.first.setIV(a_iv);
90 a_node.first.setLevel(a_lev);
91 a_node.second.define(1);
92 a_node.second.setValue(a_val);
120 #if defined(PETSC_USE_LOG) 121 PetscLogEvent m_event0;
122 PetscLogEvent m_event1;
123 PetscLogEvent m_event2;
144 #endif // ifdef petsc 156 virtual void createCoefs() = 0;
157 virtual void operator()(
FArrayBox& a_state,
161 bool a_homogeneous) = 0;
170 operator()(a_state, a_valid, a_domain, a_dx, a_homogeneous);
176 PetscReal getCoef(
int a_iSrc,
int a_iGhost=0);
178 Real getCoef(
int a_iSrc,
int a_iGhost=0);
196 virtual void createCoefs();
197 virtual void operator()(
FArrayBox& a_state,
204 #include "NamespaceFooter.H" PetscBool m_repartition
Definition: PetscCompGrid.H:128
std::pair< IndexML, StencilTensorValue > StencilNode
Definition: Stencil.H:139
Vector< int > m_refRatios
Definition: PetscCompGrid.H:100
virtual void InterpToFine(IntVect, int, const DataIndex &, StencilTensor &)
Definition: PetscCompGrid.H:148
IntVect m_nGhosts
Definition: PetscCompGrid.H:186
Vector< RefCountedPtr< LevelData< BaseFab< PetscInt > > > > m_GIDs
Definition: PetscCompGrid.H:103
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
Definition: PetscCompGrid.H:24
Definition: PetscCompGrid.H:24
PetscInt m_patchid0
Definition: PetscCompGrid.H:108
PetscInt m_patch_size
Definition: PetscCompGrid.H:130
virtual void define(const ProblemDomain &a_cdomain, Vector< DisjointBoxLayout > &a_grids, Vector< int > &a_refratios, BCHolder a_bc, const RealVect &a_cdx, int a_numLevels=-1, int a_ibase=0)
int m_verbose
Definition: PetscCompGrid.H:118
PetscErrorCode AddStencilToMat(IntVect, int, const DataIndex &, StencilTensor &, Mat)
std::map< IndexML, StencilTensorValue > StencilTensor
Definition: Stencil.H:137
Definition: PetscCompGrid.H:24
Mat m_mat
Definition: PetscCompGrid.H:110
virtual IntVect getGhostVect() const =0
int m_CFStencilRad
Definition: PetscCompGrid.H:114
virtual void operator()(FArrayBox &a_state, const Box &a_valid, const ProblemDomain &a_domain, Real a_dx, const DataIndex &a_index, bool a_homogeneous)
Definition: PetscCompGrid.H:163
ConstDiriBC(int a_nSource=1, IntVect a_nGhosts=IntVect::Unit)
Definition: PetscCompGrid.H:195
void setCFCoverMaps(int a_nlev)
PetscErrorCode createMatrix(int a_makePmat=0)
int m_num_extra_nnz
Definition: PetscCompGrid.H:126
PetscInt m_nlocrealpatches
Definition: PetscCompGrid.H:108
void NodeDefine(StencilNode &a_node, IntVect a_iv, int a_lev, Real a_val)
Definition: PetscCompGrid.H:87
Mat m_Pmat
Definition: PetscCompGrid.H:111
IntVect nGhosts() const
Definition: PetscCompGrid.H:173
int nSources() const
Definition: PetscCompGrid.H:174
PetscReal * m_Rcoefs
Definition: PetscCompGrid.H:182
Vector< DisjointBoxLayout > m_grids
Definition: PetscCompGrid.H:99
void operator=(const PetscCompGrid &a_input)
Definition: PetscCompGrid.H:135
Mat getMatrix() const
Definition: PetscCompGrid.H:61
PetscCompGrid(int a_dof)
Base class constructor. Called by all subclass constructors.
Definition: PetscCompGrid.H:40
static const IntVect Unit
Definition: IntVect.H:663
Definition: PetscCompGrid.H:30
virtual void createOpStencil(IntVect, int, const DataIndex &, StencilTensor &)=0
bool m_isDefined
Definition: PetscCompGrid.H:188
Vector< ProblemDomain > m_domains
Definition: PetscCompGrid.H:98
double Real
Definition: REAL.H:33
virtual void addExtraCovered(GID_type, int, const DataIndex &, BaseFab< PetscInt > &)
Definition: PetscCompGrid.H:75
virtual ~PetscCompGrid()
Destructor.
VecScatter m_from_petscscat
Definition: PetscCompGrid.H:131
const int m_dof
Definition: PetscCompGrid.H:119
virtual void InterpToCoarse(IntVect, int, const DataIndex &, StencilTensor &)
std::ostream & operator<<(std::ostream &os, GID_type)
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
PetscInt m_gid0
Definition: PetscCompGrid.H:108
PetscCompGrid(const PetscCompGrid &a_input)
Definition: PetscCompGrid.H:140
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
Mat getPMatrix() const
Definition: PetscCompGrid.H:62
Definition: PetscCompGrid.H:23
Definition: DataIndex.H:114
Vec m_origvec
Definition: PetscCompGrid.H:132
Definition: PetscCompGrid.H:23
PetscErrorCode putPetscInChombo(Vec b, Vector< LevelData< FArrayBox > * > &rhs) const
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
IntVect getCFStencil(const ProblemDomain &a_cdom, const IntVect a_ivc)
PetscErrorCode putChomboInPetsc(const Vector< LevelData< FArrayBox > * > &rhs, Vec b) const
void setCoverMaps(int a_nlev)
Vector< RefCountedPtr< LevelData< BaseFab< PetscInt > > > > m_fineCoverGIDs
Definition: PetscCompGrid.H:106
int m_nSources
Definition: PetscCompGrid.H:187
Vector< RefCountedPtr< LevelData< BaseFab< PetscInt > > > > m_crsSupportGIDs
Definition: PetscCompGrid.H:105
void setVerbose(int a_v)
Definition: PetscCompGrid.H:65
virtual void applyBCs(IntVect, int, const DataIndex &, Box, StencilTensor &)
PetscErrorCode permuteDataAndMaps(Vector< StencilTensor > &patchStencil)
Definition: PetscCompGrid.H:23
void setMatlab(bool b=true)
Definition: PetscCompGrid.H:63
GID_type
Definition: PetscCompGrid.H:23
bool m_writeMatlab
Definition: PetscCompGrid.H:116
BaseFab< FourthOrderInterpStencil * > m_FCStencils
Definition: PetscCompGrid.H:115
void setAverageFineSolutionToCoarse(bool b=true)
Definition: PetscCompGrid.H:66
bool m_averageFineSolutionToCoarse
Definition: PetscCompGrid.H:117
CompBC()
Definition: PetscCompGrid.H:151
Definition: PetscCompGrid.H:192
void setRepartition(bool b=true)
Definition: PetscCompGrid.H:64
BCHolder m_bc
Definition: PetscCompGrid.H:112
Vector< RealVect > m_dxs
Definition: PetscCompGrid.H:101