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

IJ-based nodal Laplacian that mirrors MLNodeLinOp's discretization. More...

#include <AMReX_HypreNodeLap.H>

Public Types

using Int = HYPRE_Int
 
using AtomicInt = std::conditional_t< sizeof(Int)==4, unsigned int, unsigned long long >
 

Public Member Functions

 HypreNodeLap (const BoxArray &grids_, const DistributionMapping &dmap_, const Geometry &geom_, const FabFactory< FArrayBox > &factory_, const iMultiFab &owner_mask_, const iMultiFab &dirichlet_mask_, MPI_Comm comm_, MLNodeLinOp const *linop_, int verbose_, std::string options_namespace_)
 Construct an IJ-based nodal Laplacian mirroring MLNodeLinOp.
 
 ~HypreNodeLap ()
 
 HypreNodeLap (HypreNodeLap const &)=delete
 
 HypreNodeLap (HypreNodeLap &&)=delete
 
HypreNodeLapoperator= (HypreNodeLap const &)=delete
 
HypreNodeLapoperator= (HypreNodeLap &&)=delete
 
void solve (MultiFab &soln, const MultiFab &rhs, Real rel_tol, Real abs_tol, int max_iter)
 Solve the nodal Laplacian using HYPRE's IJ interface.
 
void setHypreOptionsNamespace (const std::string &ns)
 Override the ParmParse namespace used when configuring HYPRE (ns).
 
Int fill_local_node_id ()
 Assign local ids to each owned node.
 
Int fill_local_node_id_gpu ()
 GPU-specific local-id fill routine; returns the owned-node count.
 
Int fill_local_node_id_cpu ()
 CPU fallback local-id fill routine; returns the owned-node count.
 
void fill_global_node_id ()
 Convert local ids to globally unique ids recognized by HYPRE.
 
void loadVectors (MultiFab &soln, const MultiFab &rhs)
 Copy AMReX solution guess soln and RHS rhs into HYPRE's IJ vectors prior to solving.
 
void getSolution (MultiFab &soln)
 Copy the solved data soln out of HYPRE and back into AMReX storage.
 

Static Public Member Functions

static void adjust_singular_matrix (Int const *ncols, Int const *cols, Int const *rows, Real *mat)
 Apply the fix-up HYPRE expects for singular matrices (Dirichlet pinning).
 

Detailed Description

IJ-based nodal Laplacian that mirrors MLNodeLinOp's discretization.

Member Typedef Documentation

◆ AtomicInt

using amrex::HypreNodeLap::AtomicInt = std::conditional_t<sizeof(Int) == 4, unsigned int, unsigned long long>

◆ Int

using amrex::HypreNodeLap::Int = HYPRE_Int

Constructor & Destructor Documentation

◆ HypreNodeLap() [1/3]

amrex::HypreNodeLap::HypreNodeLap ( const BoxArray grids_,
const DistributionMapping dmap_,
const Geometry geom_,
const FabFactory< FArrayBox > &  factory_,
const iMultiFab owner_mask_,
const iMultiFab dirichlet_mask_,
MPI_Comm  comm_,
MLNodeLinOp const *  linop_,
int  verbose_,
std::string  options_namespace_ 
)

Construct an IJ-based nodal Laplacian mirroring MLNodeLinOp.

Parameters
grids_Cell-centered grids that define the nodal mesh.
dmap_Distribution mapping for grids_.
geom_Geometry describing the level.
factory_Fab factory referenced when creating workspace.
owner_mask_Ownership mask used to deduplicate shared nodes.
dirichlet_mask_Mask describing Dirichlet nodes.
comm_MPI communicator supplied to HYPRE.
linop_MLNodeLinOp used as the reference discretization.
verbose_Verbosity forwarded to HYPRE.
options_namespace_ParmParse namespace for runtime options.

◆ ~HypreNodeLap()

amrex::HypreNodeLap::~HypreNodeLap ( )
default

◆ HypreNodeLap() [2/3]

amrex::HypreNodeLap::HypreNodeLap ( HypreNodeLap const &  )
delete

◆ HypreNodeLap() [3/3]

amrex::HypreNodeLap::HypreNodeLap ( HypreNodeLap &&  )
delete

Member Function Documentation

◆ adjust_singular_matrix()

void amrex::HypreNodeLap::adjust_singular_matrix ( Int const *  ncols,
Int const *  cols,
Int const *  rows,
Real mat 
)
static

Apply the fix-up HYPRE expects for singular matrices (Dirichlet pinning).

Parameters
ncolsNumber of columns in each CSR row.
colsColumn indices.
rowsRow indices.
matMatrix entries updated in place.

◆ fill_global_node_id()

void amrex::HypreNodeLap::fill_global_node_id ( )

Convert local ids to globally unique ids recognized by HYPRE.

◆ fill_local_node_id()

HypreNodeLap::Int amrex::HypreNodeLap::fill_local_node_id ( )

Assign local ids to each owned node.

Returns
Total owned-node count on this rank.

◆ fill_local_node_id_cpu()

HypreNodeLap::Int amrex::HypreNodeLap::fill_local_node_id_cpu ( )

CPU fallback local-id fill routine; returns the owned-node count.

◆ fill_local_node_id_gpu()

HypreNodeLap::Int amrex::HypreNodeLap::fill_local_node_id_gpu ( )

GPU-specific local-id fill routine; returns the owned-node count.

◆ getSolution()

void amrex::HypreNodeLap::getSolution ( MultiFab soln)

Copy the solved data soln out of HYPRE and back into AMReX storage.

◆ loadVectors()

void amrex::HypreNodeLap::loadVectors ( MultiFab soln,
const MultiFab rhs 
)

Copy AMReX solution guess soln and RHS rhs into HYPRE's IJ vectors prior to solving.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ setHypreOptionsNamespace()

void amrex::HypreNodeLap::setHypreOptionsNamespace ( const std::string &  ns)
inline

Override the ParmParse namespace used when configuring HYPRE (ns).

◆ solve()

void amrex::HypreNodeLap::solve ( MultiFab soln,
const MultiFab rhs,
Real  rel_tol,
Real  abs_tol,
int  max_iter 
)

Solve the nodal Laplacian using HYPRE's IJ interface.

Parameters
solnSolution MultiFab (nodal) updated on return.
rhsRHS MultiFab (nodal).
rel_tolRelative tolerance.
abs_tolAbsolute tolerance.
max_iterMaximum allowed iterations.

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