15#ifndef CD_PETSCHELMHOLTZOP_H
16#define CD_PETSCHELMHOLTZOP_H
25#include <RefCountedPtr.H>
27#include <LayoutData.H>
38#include <CD_NamespaceHeader.H>
220 const MFAMRCellData& a_aCoef,
221 const MFAMRFluxData& a_bCoef,
222 const MFAMRIVData& a_bCoefIrreg,
223 const RealVect& a_probLo,
224 const Vector<Real>& a_dx,
226 const Real a_beta) noexcept;
249 setCoefficients(const MFAMRCellData& a_aCoef, const MFAMRFluxData& a_bCoef, const MFAMRIVData& a_bCoefIrreg) noexcept;
286 scaleRows(Vec& a_vec, const
bool a_inverse) const noexcept;
485 getCoveredCells(const
int a_level, const DataIndex& a_din, const
int a_phase) const noexcept;
495 isInterfaceCell(const IntVect& a_iv, const
int a_level, const DataIndex& a_din) const noexcept;
510 const IntVectSet& a_coveredCells,
512 const DataIndex& a_din,
513 const
int a_phase) const noexcept;
529 const DataIndex& a_din,
530 const
int a_phase) const noexcept;
545 const Side::LoHiSide a_side,
547 const DataIndex& a_din,
548 const
int a_phase) const noexcept;
551#include <CD_NamespaceFooter.H>
Class for holding data across EBAMR hierarchies.
Parent base class for multigrid interpolation.
Declaration of a wrapper class for holding multifluid EBMultigridInterpolators.
File containing declaration of PetscGrid.
Declaration of a domain boundary condition class for PetscHelmholtzOp.
Declaration of a base class for electrode (EB) boundary conditions of PetscHelmholtzOp.
Declaration of a base class for the interface (jump) conditions of PetscHelmholtzOp.
Multigrid interpolator class.
Definition CD_EBMGLeastSquaresInterpolator.H:55
Wrapper class for holding multifluid EBMultigridInterpolators.
Definition CD_MFMultigridInterpolator.H:27
Class which maps a multifluid cut-cell AMR hierarchy to PETSc.
Definition CD_PetscGrid.H:47
Base class for domain boundary conditions of PetscHelmholtzOp.
Definition CD_PetscHelmholtzDomainBC.H:51
Base class for the boundary conditions on the EB faces of cut cells that are not interface cells (ele...
Definition CD_PetscHelmholtzEBBC.H:35
Base class for the conditions on the interface between two phases, for PetscHelmholtzOp.
Definition CD_PetscHelmholtzJumpBC.H:41
Real m_beta
Operator beta.
Definition CD_PetscHelmholtzOp.H:372
virtual void defineDomainFluxStencils() noexcept
Define the flux stencils through the domain faces, m_domainFluxStencils.
Definition CD_PetscHelmholtzOp.cpp:1092
RefCountedPtr< PetscHelmholtzJumpBC > m_jumpBc
Conditions on the EB faces of interface cells.
Definition CD_PetscHelmholtzOp.H:332
Vector< RefCountedPtr< LayoutData< BaseFab< PetscStencil > > > > m_domainFluxStencils[SpaceDim][2]
Flux stencils through the domain faces, without beta and b, over PETSc rows.
Definition CD_PetscHelmholtzOp.H:392
virtual void setCoefficients(const MFAMRCellData &a_aCoef, const MFAMRFluxData &a_bCoef, const MFAMRIVData &a_bCoefIrreg) noexcept
Point the operator to other a- and b-coefficients. The matrix is not changed until fillMatrix is call...
Definition CD_PetscHelmholtzOp.cpp:174
PetscHelmholtzOp() noexcept
Default constructor. Must subsequently call define.
Definition CD_PetscHelmholtzOp.cpp:32
virtual IntVectSet getCoveredCells(const int a_level, const DataIndex &a_din, const int a_phase) const noexcept
Get the cells around a grid that are covered by the finer level.
Definition CD_PetscHelmholtzOp.cpp:334
PetscHelmholtzOp & operator=(const PetscHelmholtzOp &a_other)=delete
Disallowed copy assignment operator.
RefCountedPtr< PetscGrid > m_petscGrid
PETSc grid.
Definition CD_PetscHelmholtzOp.H:317
MFAMRIVData m_bCoefIrreg
b-coefficient on the EB faces.
Definition CD_PetscHelmholtzOp.H:352
PetscHelmholtzOp(const PetscHelmholtzOp &a_other)=delete
Disallowed copy constructor.
Real m_alpha
Operator alpha.
Definition CD_PetscHelmholtzOp.H:367
virtual void checkSupported() const noexcept
Abort unless the grids are supported by this operator: an interpolator for each phase on every level ...
Definition CD_PetscHelmholtzOp.cpp:268
virtual void define(const RefCountedPtr< PetscGrid > &a_petscGrid, const Vector< MFMultigridInterpolator > &a_interpolators, const RefCountedPtr< PetscHelmholtzDomainBC > &a_domainBc, const RefCountedPtr< PetscHelmholtzEBBC > &a_ebBc, const RefCountedPtr< PetscHelmholtzJumpBC > &a_jumpBc, const MFAMRCellData &a_aCoef, const MFAMRFluxData &a_bCoef, const MFAMRIVData &a_bCoefIrreg, const RealVect &a_probLo, const Vector< Real > &a_dx, const Real a_alpha, const Real a_beta) noexcept
Define the operator.
Definition CD_PetscHelmholtzOp.cpp:98
RefCountedPtr< PetscHelmholtzDomainBC > m_domainBc
Domain boundary conditions.
Definition CD_PetscHelmholtzOp.H:322
virtual void clear() noexcept
Release the matrix, the boundary conditions, the coefficients and all per-level data,...
Definition CD_PetscHelmholtzOp.cpp:61
PetscHelmholtzOp & operator=(const PetscHelmholtzOp &&a_other)=delete
Disallowed move assignment operator.
RefCountedPtr< PetscHelmholtzEBBC > m_ebBc
Boundary conditions on the EB faces of cut cells that are not interface cells.
Definition CD_PetscHelmholtzOp.H:327
virtual ~PetscHelmholtzOp() noexcept
Destructor. Destroys the matrix, unless PETSc has already been finalized.
Definition CD_PetscHelmholtzOp.cpp:46
virtual void addToMatrix(const PetscInt a_row, const PetscStencil &a_stencil) noexcept
Add a stencil to a row of the matrix, with ADD_VALUES.
Definition CD_PetscHelmholtzOp.cpp:518
Vector< Real > m_dx
Grid resolution on each level.
Definition CD_PetscHelmholtzOp.H:362
virtual bool isInterfaceCell(const IntVect &a_iv, const int a_level, const DataIndex &a_din) const noexcept
Check if a cell is an interface cell, i.e. cut in both phases.
Definition CD_PetscHelmholtzOp.cpp:363
virtual const Mat & getMatrix() const noexcept
Get the assembled matrix.
Definition CD_PetscHelmholtzOp.cpp:189
virtual void addBoundaryConditionsToRHS(Vec &a_rhs, const EBAMRIVData &a_sigma) const noexcept
Move the boundary data part of the domain boundary fluxes into a right-hand side.
Definition CD_PetscHelmholtzOp.cpp:909
virtual Real getRowWeight(const int a_level) const noexcept
Get the weight that the rows of a level are multiplied by.
Definition CD_PetscHelmholtzOp.cpp:202
virtual VoFStencil getCutFaceFluxStencil(const FaceIndex &a_face, const IntVectSet &a_coveredCells, const int a_level, const DataIndex &a_din, const int a_phase) const noexcept
Get the flux b * dphi/dx through the centroid of an interior cut face, as in EBHelmholtzOp.
Definition CD_PetscHelmholtzOp.cpp:383
bool m_isDefined
Is defined or not.
Definition CD_PetscHelmholtzOp.H:307
Vector< RefCountedPtr< LayoutData< BaseFab< std::vector< PetscStencil > > > > > m_coarCFFluxStencils[SpaceDim][2]
Flux stencils through the fine faces on a refinement boundary, seen from the coarse side.
Definition CD_PetscHelmholtzOp.H:410
Vector< RefCountedPtr< LayoutData< BaseFab< PetscStencil > > > > m_fineCFFluxStencils[SpaceDim][2]
Flux stencils through the fine faces on a refinement boundary, seen from the fine side.
Definition CD_PetscHelmholtzOp.H:401
PetscHelmholtzOp(const PetscHelmholtzOp &&a_other)=delete
Disallowed move constructor.
virtual void createMatrix() noexcept
Allocate the boundary weights, and create the matrix with an exact preallocation.
Definition CD_PetscHelmholtzOp.cpp:455
MFAMRCellData m_aCoef
Cell-centered a-coefficient.
Definition CD_PetscHelmholtzOp.H:342
virtual void copyFineBcoefToCoarse() noexcept
Copy the b-coefficient of each finer level into the index space of the coarse level,...
Definition CD_PetscHelmholtzOp.cpp:1114
virtual void defineCoarseFineFluxStencils() noexcept
Define the flux stencils through the refinement boundaries, m_fineCFFluxStencils and m_coarCFFluxSten...
Definition CD_PetscHelmholtzOp.cpp:1103
EBAMRIFData m_boundaryWeights[2]
Weight w_B of the boundary data in the flux through each domain face.
Definition CD_PetscHelmholtzOp.H:384
virtual Real getBcoef(const IntVect &a_iv, const int a_dir, const Side::LoHiSide a_side, const int a_level, const DataIndex &a_din, const int a_phase) const noexcept
Get the b-coefficient on a face.
Definition CD_PetscHelmholtzOp.cpp:299
virtual RefCountedPtr< EBMultigridInterpolator > getInterpolator(const int a_level, const int a_phase) const noexcept
Get the coarse-fine interpolator of a level and phase.
Definition CD_PetscHelmholtzOp.cpp:323
virtual PetscInt getCoarseRow(const IntVect &a_ivGhost, const int a_refRat, const int a_level, const DataIndex &a_din, const int a_phase) const noexcept
Get the row of the coarse cell across a refinement boundary from a fine cell.
Definition CD_PetscHelmholtzOp.cpp:423
virtual void setAlphaAndBeta(const Real a_alpha, const Real a_beta) noexcept
Set alpha and beta. The matrix is not changed until fillMatrix is called.
Definition CD_PetscHelmholtzOp.cpp:162
EBAMRFluxData m_bCoefFiCo
The b-coefficient of the finer level, in the index space of the coarse level.
Definition CD_PetscHelmholtzOp.H:419
MFAMRFluxData m_bCoef
Face-centered b-coefficient.
Definition CD_PetscHelmholtzOp.H:347
virtual void fillMatrix() noexcept
Fill the matrix from the current alpha, beta, and a- and b-coefficients.
Definition CD_PetscHelmholtzOp.cpp:548
Vector< MFMultigridInterpolator > m_interpolators
Coarse-fine ghost cell interpolators of each phase, on each level. Entry 0 is not used.
Definition CD_PetscHelmholtzOp.H:337
virtual void scaleRows(Vec &a_vec, const bool a_inverse) const noexcept
Multiply, or divide, each local row of a vector by its row weight.
Definition CD_PetscHelmholtzOp.cpp:212
Mat m_matrix
The assembled matrix.
Definition CD_PetscHelmholtzOp.H:377
RealVect m_probLo
Lower-left corner of the computational domain.
Definition CD_PetscHelmholtzOp.H:357
bool m_verbose
Verbose output or not.
Definition CD_PetscHelmholtzOp.H:312
A linear stencil over global PETSc rows, i.e. a list of (row, weight) pairs.
Definition CD_PetscStencil.H:43