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

Open Boundary Poisson Solver. More...

#include <AMReX_OpenBC.H>

Public Member Functions

 OpenBCSolver ()=default
 Construct an empty solver; call define() before solving.
 
 OpenBCSolver (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo())
 Build the solver hierarchy covering a_geom/a_grids.
 
 ~OpenBCSolver ()=default
 
 OpenBCSolver (const OpenBCSolver &)=delete
 
 OpenBCSolver (OpenBCSolver &&)=delete
 
OpenBCSolveroperator= (const OpenBCSolver &)=delete
 
OpenBCSolveroperator= (OpenBCSolver &&)=delete
 
void define (const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info=LPInfo())
 Initialize/refresh the solver.
 
void setVerbose (int v) noexcept
 Control verbosity (0 = silent) via v.
 
void setBottomVerbose (int v) noexcept
 Control bottom solver verbosity via v.
 
void useHypre (bool use_hypre) noexcept
 Toggle the Hypre bottom solver (requires Hypre-enabled build).
 
Real solve (const Vector< MultiFab * > &a_sol, const Vector< MultiFab const * > &a_rhs, Real a_tol_rel, Real a_tol_abs)
 Solve the isolated Poisson problem.
 
void compute_moments (Gpu::DeviceVector< openbc::Moments > &moments)
 Build per-face multipole moments that summarize solution derivatives.
 
void compute_potential (Gpu::DeviceVector< openbc::Moments > const &moments)
 Evaluate the coarse potential contribution from precomputed moments.
 
void interpolate_potential (MultiFab &solg)
 Interpolate coarse potential values back onto the grown solution domain.
 

Detailed Description

Open Boundary Poisson Solver.

References: (1) The Solution of Poisson's Equation for Isolated Source Distributions, R. A. James, 1977, JCP 25, 71 (2) A Local Corrections Algorithm for Solving Poisson's Equation in Three Dimensions, P. McCorquodale, P. Colella, G. T. Balls, & S. B. Baden, 2007, Communications in Applied Mathematics and Computational Science, 2, 1, 57-81

Constructor & Destructor Documentation

◆ OpenBCSolver() [1/4]

amrex::OpenBCSolver::OpenBCSolver ( )
default

Construct an empty solver; call define() before solving.

◆ OpenBCSolver() [2/4]

amrex::OpenBCSolver::OpenBCSolver ( const Vector< Geometry > &  a_geom,
const Vector< BoxArray > &  a_grids,
const Vector< DistributionMapping > &  a_dmap,
const LPInfo a_info = LPInfo() 
)

Build the solver hierarchy covering a_geom/a_grids.

Parameters
a_geomAMR geometry objects.
a_gridsAMR grid arrays.
a_dmapDistribution mappings per level.
a_infoOptional linear-operator configuration overrides.

◆ ~OpenBCSolver()

amrex::OpenBCSolver::~OpenBCSolver ( )
default

◆ OpenBCSolver() [3/4]

amrex::OpenBCSolver::OpenBCSolver ( const OpenBCSolver )
delete

◆ OpenBCSolver() [4/4]

amrex::OpenBCSolver::OpenBCSolver ( OpenBCSolver &&  )
delete

Member Function Documentation

◆ compute_moments()

void amrex::OpenBCSolver::compute_moments ( Gpu::DeviceVector< openbc::Moments > &  moments)

Build per-face multipole moments that summarize solution derivatives.

Parameters
momentsDevice vector sized to m_nblocks_local; filled in place.

◆ compute_potential()

void amrex::OpenBCSolver::compute_potential ( Gpu::DeviceVector< openbc::Moments > const &  moments)

Evaluate the coarse potential contribution from precomputed moments.

Parameters
momentsDevice buffer returned by compute_moments().

◆ define()

void amrex::OpenBCSolver::define ( const Vector< Geometry > &  a_geom,
const Vector< BoxArray > &  a_grids,
const Vector< DistributionMapping > &  a_dmap,
const LPInfo a_info = LPInfo() 
)

Initialize/refresh the solver.

May be called repeatedly if the mesh hierarchy changes.

Parameters
a_geomAMR geometry objects.
a_gridsAMR grid arrays.
a_dmapDistribution mappings per level.
a_infoOptional linear-operator configuration overrides.

◆ interpolate_potential()

void amrex::OpenBCSolver::interpolate_potential ( MultiFab solg)

Interpolate coarse potential values back onto the grown solution domain.

Parameters
solgBuffer defined on the extended domain; updated in place.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

OpenBCSolver & amrex::OpenBCSolver::operator= ( OpenBCSolver &&  )
delete

◆ setBottomVerbose()

void amrex::OpenBCSolver::setBottomVerbose ( int  v)
noexcept

Control bottom solver verbosity via v.

◆ setVerbose()

void amrex::OpenBCSolver::setVerbose ( int  v)
noexcept

Control verbosity (0 = silent) via v.

◆ solve()

Real amrex::OpenBCSolver::solve ( const Vector< MultiFab * > &  a_sol,
const Vector< MultiFab const * > &  a_rhs,
Real  a_tol_rel,
Real  a_tol_abs 
)

Solve the isolated Poisson problem.

The RHS/solution vectors must cover the AMR hierarchy supplied to define().

Parameters
a_solSolution MultiFabs (updated in place).
a_rhsRight-hand sides.
a_tol_relRelative tolerance passed to both MLMG instances.
a_tol_absAbsolute tolerance passed to both MLMG instances.
Returns
Final relative residual reported by the outer MLMG stage.

◆ useHypre()

void amrex::OpenBCSolver::useHypre ( bool  use_hypre)
noexcept

Toggle the Hypre bottom solver (requires Hypre-enabled build).

When enabled, the max coarsening level is forced to zero so Hypre owns the coarsest solve.

Parameters
use_hypreTrue to use Hypre; false for AMReX-native solvers.

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