|
|
| PetscHelmholtzDomainBC () |
| | Default constructor. Must subsequently call define.
|
|
virtual | ~PetscHelmholtzDomainBC () |
| | Destructor.
|
| | PetscHelmholtzDomainBC (const PetscHelmholtzDomainBC &a_other)=delete |
| | Disallowed copy constructor.
|
| | PetscHelmholtzDomainBC (const PetscHelmholtzDomainBC &&a_other)=delete |
| | Disallowed move constructor.
|
| PetscHelmholtzDomainBC & | operator= (const PetscHelmholtzDomainBC &a_other)=delete |
| | Disallowed copy assignment operator.
|
| PetscHelmholtzDomainBC & | operator= (const PetscHelmholtzDomainBC &&a_other)=delete |
| | Disallowed move assignment operator.
|
| virtual void | define (const RefCountedPtr< PetscGrid > &a_petscGrid, const RealVect &a_probLo, const Vector< Real > &a_dx) |
| | Define the BC over the AMR hierarchy.
|
| virtual void | getFaceFluxStencil (Real &a_boundaryWeight, VoFStencil &a_stencilCoar, VoFStencil &a_stencil, VoFStencil &a_stencilFine, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const =0 |
| | Get the stencil of the face flux through a domain face, and the weight of the boundary data.
|
| virtual Real | getBoundaryData (const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const =0 |
| | Get the boundary data g at a domain face.
|
Base class for domain boundary conditions of PetscHelmholtzOp.
This mirrors EBHelmholtzDomainBC, but where that class computes the flux through a domain face from data, this class returns the flux as a linear form in the cell values and the boundary data g, i.e.
F = w_B * g + sum_i w_i * phi_i
g is what the user specifies on the boundary, e.g. phi for a Dirichlet BC and dphi/dn for a Neumann BC. The weights w_i and w_B depend only on the grid and the discretization, and come from getFaceFluxStencil: the w_i go into the matrix, and w_B is kept by the operator. g comes from getBoundaryData, and w_B * g goes into the right-hand side, so that g can change between solves without the matrix being reassembled. F is the derivative of phi in the +a_dir direction on the face, i.e. it does not include the b-coefficient, which PetscHelmholtzOp multiplies in on the face. The discretizations in the subclasses are the same as in the EBHelmholtz domain BCs, so that PetscHelmholtzOp and EBHelmholtzOp discretize the same problem.
Like the PETSc matrix, the BC is composite: it is defined once over the whole AMR hierarchy, and each query names the phase, level, grid index and cell it is for. Through the PetscGrid a subclass has the grids on every level, their coarsenings and refinements (which share DataIndex with the level they came from), and knows for every cell whether it is covered by a finer grid. This is what a stencil needs in order to reach into a coarser or finer level.
| virtual void PetscHelmholtzDomainBC::getFaceFluxStencil |
( |
Real & | a_boundaryWeight, |
|
|
VoFStencil & | a_stencilCoar, |
|
|
VoFStencil & | a_stencil, |
|
|
VoFStencil & | a_stencilFine, |
|
|
const int | a_phase, |
|
|
const int | a_level, |
|
|
const DataIndex & | a_din, |
|
|
const VolIndex & | a_vof, |
|
|
const int | a_dir, |
|
|
const Side::LoHiSide | a_side ) const |
|
pure virtual |
Get the stencil of the face flux through a domain face, and the weight of the boundary data.
The stencil gives the weights w_i of the flux, excluding the b-coefficient. It is returned in three parts, one per level, which are summed: a_stencil over cells on level a_level in the index space of grid a_din, a_stencilCoar over cells on level a_level - 1 in the index space of grid a_din coarsened (PetscGrid::getMFLevelGridsCoFi()[a_level - 1]), and a_stencilFine over cells on level a_level + 1 in the index space of grid a_din refined (PetscGrid::getMFLevelGridsFiCo()[a_level + 1]). Previous contents of the three stencils are discarded.
This function does not require the entries to be PETSc rows: they may be e.g. coarse-fine ghost cells or cells covered by a finer grid. It is up to the operator that uses the stencil to make it consistent with the PetscGrid before it goes into the matrix, by replacing the entries it knows how to replace and failing on the rest. See PetscHelmholtzOp for what that operator accepts.
- Parameters
-
| [out] | a_boundaryWeight | Weight w_B of the boundary data in the flux, see getBoundaryData |
| [out] | a_stencilCoar | Stencil over cells on level a_level - 1 |
| [out] | a_stencil | Stencil over cells on level a_level |
| [out] | a_stencilFine | Stencil over cells on level a_level + 1 |
| [in] | a_phase | Phase |
| [in] | a_level | Grid level |
| [in] | a_din | Grid index on the level |
| [in] | a_vof | Cell adjacent to the domain face |
| [in] | a_dir | Coordinate direction of the face |
| [in] | a_side | Domain side of the face |
Implemented in PetscHelmholtzDirichletDomainBC, PetscHelmholtzElectrostaticDomainBC, PetscHelmholtzNeumannDomainBC, and PetscHelmholtzRobinDomainBC.