Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::PETScABecLap Class Reference

PETSc wrapper that assembles/solves (a alpha - b div beta grad) phi = rhs. More...

#include <AMReX_PETSc.H>

Public Member Functions

 PETScABecLap (const BoxArray &grids, const DistributionMapping &dmap, const Geometry &geom_, MPI_Comm comm_)
 Construct a PETSc solver bound to the supplied AMR level.
 ~PETScABecLap ()
 PETScABecLap (PETScABecLap const &)=delete
 PETScABecLap (PETScABecLap &&) noexcept=delete
PETScABecLap & operator= (PETScABecLap const &)=delete
PETScABecLap & operator= (PETScABecLap &&) noexcept=delete
void setScalars (Real sa, Real sb)
 Store constant scalars for the diagonal and diffusive terms.
void setACoeffs (const MultiFab &alpha)
 Install cell-centered a coefficients (copied as needed).
void setBCoeffs (const Array< const MultiFab *, 3 > &beta)
 Install per-direction face-centered b coefficients.
void setVerbose (int _verbose)
 Set PETSc verbosity level forwarded to KSP monitors (_verbose).
void solve (MultiFab &soln, const MultiFab &rhs, Real rel_tol, Real abs_tol, int max_iter, const BndryData &bndry, int max_bndry_order)
 Solve the assembled ABec system using PETSc/KSP.
void setEBDirichlet (MultiFab const *beb)
 Provide b coefficients stored in beb for embedded-boundary faces.
void prepareSolver ()
 Build PETSc matrices/vectors and apply runtime parameters.
void loadVectors (MultiFab &soln, const MultiFab &rhs)
 Copy AMReX solution guess soln and RHS rhs into PETSc vectors.
void getSolution (MultiFab &soln)
 Copy PETSc's solved solution back into AMReX storage soln.

Detailed Description

PETSc wrapper that assembles/solves (a alpha - b div beta grad) phi = rhs.

Constructor & Destructor Documentation

◆ PETScABecLap() [1/3]

amrex::PETScABecLap::PETScABecLap ( const BoxArray & grids,
const DistributionMapping & dmap,
const Geometry & geom_,
MPI_Comm comm_ )

Construct a PETSc solver bound to the supplied AMR level.

Parameters
gridsGrid layout for the level.
dmapDistribution map associated with grids.
geom_Geometry describing the domain.
comm_MPI communicator passed to PETSc.

◆ ~PETScABecLap()

amrex::PETScABecLap::~PETScABecLap ( )

◆ PETScABecLap() [2/3]

amrex::PETScABecLap::PETScABecLap ( PETScABecLap const & )
delete

◆ PETScABecLap() [3/3]

amrex::PETScABecLap::PETScABecLap ( PETScABecLap && )
deletenoexcept

Member Function Documentation

◆ getSolution()

void amrex::PETScABecLap::getSolution ( MultiFab & soln)

Copy PETSc's solved solution back into AMReX storage soln.

◆ loadVectors()

void amrex::PETScABecLap::loadVectors ( MultiFab & soln,
const MultiFab & rhs )

Copy AMReX solution guess soln and RHS rhs into PETSc vectors.

◆ operator=() [1/2]

PETScABecLap & amrex::PETScABecLap::operator= ( PETScABecLap && )
deletenoexcept

◆ operator=() [2/2]

PETScABecLap & amrex::PETScABecLap::operator= ( PETScABecLap const & )
delete

◆ prepareSolver()

void amrex::PETScABecLap::prepareSolver ( )

Build PETSc matrices/vectors and apply runtime parameters.

◆ setACoeffs()

void amrex::PETScABecLap::setACoeffs ( const MultiFab & alpha)

Install cell-centered a coefficients (copied as needed).

Parameters
alphaMultiFab containing the a coefficients.

◆ setBCoeffs()

void amrex::PETScABecLap::setBCoeffs ( const Array< const MultiFab *, 3 > & beta)

Install per-direction face-centered b coefficients.

Parameters
betaArray of per-direction coefficient MultiFabs.

◆ setEBDirichlet()

void amrex::PETScABecLap::setEBDirichlet ( MultiFab const * beb)
inline

Provide b coefficients stored in beb for embedded-boundary faces.

◆ setScalars()

void amrex::PETScABecLap::setScalars ( Real sa,
Real sb )

Store constant scalars for the diagonal and diffusive terms.

Parameters
saScalar applied to the a term.
sbScalar applied to the b term.

◆ setVerbose()

void amrex::PETScABecLap::setVerbose ( int _verbose)

Set PETSc verbosity level forwarded to KSP monitors (_verbose).

◆ solve()

void amrex::PETScABecLap::solve ( MultiFab & soln,
const MultiFab & rhs,
Real rel_tol,
Real abs_tol,
int max_iter,
const BndryData & bndry,
int max_bndry_order )

Solve the assembled ABec system using PETSc/KSP.

Parameters
solnSolution MultiFab (updated in place).
rhsRight-hand side.
rel_tolRelative tolerance.
abs_tolAbsolute tolerance.
max_iterMaximum allowed iterations.
bndryBoundary data.
max_bndry_orderMaximum order at the boundary (2 to 4; 2 or 3 with EB).

The documentation for this class was generated from the following files: