SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::solver::preconditioner::backend::mfem Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  Inverse
 An owning approximate inverse and the application guarantee required by its compositions. More...
 
class  Solver
 Expose one accepted inverse to MFEM while binding it to exactly its accepted physical Jacobian. More...
 
class  SparseDirectCache
 The symbolic analysis (fill-reducing ordering) of the last matrix factored through this cache. More...
 
struct  TwoBlockCouplings
 The two Jacobian actions between independently ordered equation and unknown groups. More...
 

Typedefs

using OperatorHandle = std::shared_ptr<const ::mfem::Operator>
 

Enumerations

enum class  SERiFErrorCode
 
enum class  CouplingOrder
 Choose how the two groups of physical unknowns respond to each other's corrections. More...
 
enum class  SERiFErrorCode
 
enum class  SERiFErrorCode
 

Functions

std::expected< Inverse, Failure > try_bordered_inverse (Inverse fields, TwoBlockCouplings couplings, OperatorHandle border_diagonal, const strategies::inverse::DenseDirect &options={})
 Probe and factor the complete small border Schur complement, retaining nonzero border-to-border couplings.
 
std::expected< OperatorHandle, Failure > try_restrict_operator (OperatorHandle operation, std::span< const int > rows, std::span< const int > columns)
 Select equation rows and unknown columns without assuming their coordinate orders coincide.
 
std::expected< Inverse, Failure > try_coupled_inverse (Inverse first, Inverse second, TwoBlockCouplings couplings, strategies::coupling::CouplingOrder order)
 Compose two inverses with the requested treatment of their cross couplings.
 
std::expected< OperatorHandle, Failure > try_schur_operator (OperatorHandle retained_diagonal, Inverse eliminated, TwoBlockCouplings couplings)
 Form the retained Jacobian minus its response through a fixed linear eliminated inverse.
 
std::expected< Inverse, Failure > try_amg_inverse (std::shared_ptr< const ::mfem::SparseMatrix > matrix, const strategies::inverse::FixedAMG &options={})
 Prepare fixed-cycle BoomerAMG on this process; MPI must already be initialized and remains caller-owned.
 
std::expected< Inverse, Failure > try_dense_inverse (const ::mfem::DenseMatrix &matrix, const strategies::inverse::DenseDirect &options={})
 Copy and scale a dense matrix, check its pivoted LU and infinity-norm reciprocal condition, then own the factorization.
 
std::expected< Inverse, Failure > try_diagonal_inverse (std::span< const double > diagonal)
 Own the reciprocal of every finite nonzero entry, including signed diagonals.
 
std::string_view sparse_direct_backend () noexcept
 The sparse LU backend compiled into this library (Meson option sparse_direct): "accelerate", "umfpack" or "none".
 
bool sparse_direct_available () noexcept
 True when SparseDirect can be prepared on this machine; with "none", or Accelerate before macOS 15.5, it cannot.
 
std::expected< Inverse, Failure > try_sparse_direct_inverse (std::shared_ptr< const ::mfem::SparseMatrix > matrix, const strategies::inverse::SparseDirect &options={}, SparseDirectCache *cache=nullptr)
 Factor a finalized square sparse matrix with a pivoted sparse LU; every application is one exact solve.
 
std::expected< Inverse, Failure > try_coupled_inverse (Inverse first, Inverse second, TwoBlockCouplings couplings, CouplingOrder order)
 
template<utils::errors::SERiFErrorCode Code, typename... Arguments>
std::unexpected< Failure > failure (const std::string_view message, Arguments... arguments)
 Keep preparation failures typed while using the common SERiF diagnostic formatter.
 
template<utils::errors::SERiFErrorCode Code, typename... Arguments>
std::unexpected< Failure > failure (const std::string_view message, Arguments... arguments)
 Keep preparation failures typed while using the common SERiF diagnostic formatter.
 
template<utils::errors::SERiFErrorCode Code, typename... Arguments>
std::unexpected< Failure > failure (const std::string_view message, Arguments... arguments)
 Keep preparation failures typed while using the common SERiF diagnostic formatter.
 

Typedef Documentation

◆ OperatorHandle

using serif::solver::preconditioner::backend::mfem::OperatorHandle = std::shared_ptr<const ::mfem::Operator>

Enumeration Type Documentation

◆ CouplingOrder

Choose how the two groups of physical unknowns respond to each other's corrections.

◆ SERiFErrorCode [1/3]

enum class serif::utils::errors::SERiFErrorCode : uint16_t
strong

◆ SERiFErrorCode [2/3]

enum class serif::utils::errors::SERiFErrorCode : uint16_t
strong

◆ SERiFErrorCode [3/3]

enum class serif::utils::errors::SERiFErrorCode : uint16_t
strong

Function Documentation

◆ failure() [1/3]

template<utils::errors::SERiFErrorCode Code, typename... Arguments>
std::unexpected< Failure > serif::solver::preconditioner::backend::mfem::detail::failure ( const std::string_view message,
Arguments... arguments )
nodiscard

Keep preparation failures typed while using the common SERiF diagnostic formatter.

◆ failure() [2/3]

template<utils::errors::SERiFErrorCode Code, typename... Arguments>
std::unexpected< Failure > serif::solver::preconditioner::backend::mfem::detail::failure ( const std::string_view message,
Arguments... arguments )
nodiscard

Keep preparation failures typed while using the common SERiF diagnostic formatter.

◆ failure() [3/3]

template<utils::errors::SERiFErrorCode Code, typename... Arguments>
std::unexpected< Failure > serif::solver::preconditioner::backend::mfem::detail::failure ( const std::string_view message,
Arguments... arguments )
nodiscard

Keep preparation failures typed while using the common SERiF diagnostic formatter.

◆ sparse_direct_available()

bool serif::solver::preconditioner::backend::mfem::sparse_direct_available ( )
nodiscardnoexcept

True when SparseDirect can be prepared on this machine; with "none", or Accelerate before macOS 15.5, it cannot.

◆ sparse_direct_backend()

std::string_view serif::solver::preconditioner::backend::mfem::sparse_direct_backend ( )
nodiscardnoexcept

The sparse LU backend compiled into this library (Meson option sparse_direct): "accelerate", "umfpack" or "none".

◆ try_amg_inverse()

std::expected< Inverse, Failure > serif::solver::preconditioner::backend::mfem::try_amg_inverse ( std::shared_ptr< const ::mfem::SparseMatrix > matrix,
const strategies::inverse::FixedAMG & options = {} )
nodiscard

Prepare fixed-cycle BoomerAMG on this process; MPI must already be initialized and remains caller-owned.

◆ try_bordered_inverse()

std::expected< Inverse, Failure > serif::solver::preconditioner::backend::mfem::try_bordered_inverse ( Inverse fields,
TwoBlockCouplings couplings,
OperatorHandle border_diagonal,
const strategies::inverse::DenseDirect & options = {} )
nodiscard

Probe and factor the complete small border Schur complement, retaining nonzero border-to-border couplings.

Note
The first group contains fields; the second contains the border unknowns. Fixed linear field inverses cache their responses. Variable inverses solve the corrected field right-hand side afresh. Empty borders return the field inverse unchanged. Child actions must remain fixed throughout preparation.

◆ try_coupled_inverse() [1/2]

std::expected< Inverse, Failure > serif::solver::preconditioner::backend::mfem::try_coupled_inverse ( Inverse first,
Inverse second,
TwoBlockCouplings couplings,
CouplingOrder order )

◆ try_coupled_inverse() [2/2]

std::expected< Inverse, Failure > serif::solver::preconditioner::backend::mfem::try_coupled_inverse ( Inverse first,
Inverse second,
TwoBlockCouplings couplings,
strategies::coupling::CouplingOrder order )
nodiscard

Compose two inverses with the requested treatment of their cross couplings.

Note
For lower_diagonal_upper the second inverse approximates the Schur complement. The returned action owns its prerequisites and reuses scratch; serialize applications to one instance. Inputs and outputs must be preallocated; overlapping buffers are supported.

◆ try_dense_inverse()

std::expected< Inverse, Failure > serif::solver::preconditioner::backend::mfem::try_dense_inverse ( const ::mfem::DenseMatrix & matrix,
const strategies::inverse::DenseDirect & options = {} )
nodiscard

Copy and scale a dense matrix, check its pivoted LU and infinity-norm reciprocal condition, then own the factorization.

◆ try_diagonal_inverse()

std::expected< Inverse, Failure > serif::solver::preconditioner::backend::mfem::try_diagonal_inverse ( std::span< const double > diagonal)
nodiscard

Own the reciprocal of every finite nonzero entry, including signed diagonals.

◆ try_restrict_operator()

std::expected< OperatorHandle, Failure > serif::solver::preconditioner::backend::mfem::try_restrict_operator ( OperatorHandle operation,
std::span< const int > rows,
std::span< const int > columns )
nodiscard

Select equation rows and unknown columns without assuming their coordinate orders coincide.

Note
This owns the operator and copied indices; it borrows no caller index arrays or numerical vectors. Applications require preallocated vectors and support overlapping input and output.

◆ try_schur_operator()

std::expected< OperatorHandle, Failure > serif::solver::preconditioner::backend::mfem::try_schur_operator ( OperatorHandle retained_diagonal,
Inverse eliminated,
TwoBlockCouplings couplings )
nodiscard

Form the retained Jacobian minus its response through a fixed linear eliminated inverse.

Note
The eliminated group is first and the retained group second: D - C K B. This prepares an owning action, without probing or assembling its entries.

◆ try_sparse_direct_inverse()

std::expected< Inverse, Failure > serif::solver::preconditioner::backend::mfem::try_sparse_direct_inverse ( std::shared_ptr< const ::mfem::SparseMatrix > matrix,
const strategies::inverse::SparseDirect & options = {},
SparseDirectCache * cache = nullptr )
nodiscard

Factor a finalized square sparse matrix with a pivoted sparse LU; every application is one exact solve.

Note
With a cache, the symbolic analysis is reused while the sparsity pattern is unchanged. ArrayMult solves a batch of right-hand sides together, which agrees with Mult to rounding (not bit for bit) on Accelerate.