SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT > Class Template Referencefinal

#include <prepared_point_border.hpp>

Inheritance diagram for serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >:
[legend]
Collaboration diagram for serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >:
[legend]

Public Types

using RowBinding = typename Base::RowBinding
 
using BorderBinding = discretization::backend::mfem::TermBinding<typename EquationT::Border, SchemaT>
 

Public Member Functions

 PreparedPointBorder (EquationT equation, const RowBinding &row, const BorderBinding &border)
 Borrow one carrier point and one global scalar border on the same mesh.
 
template<typename StateT>
std::expected< void, PreparationRejection > try_prepare (const StateT &state, const PreparationMode mode=PreparationMode::rebuild)
 Freeze both the point condition and its border coefficient.
 
template<typename StateT>
void prepare (const StateT &state, const PreparationMode mode=PreparationMode::rebuild)
 Prepare or translate numerical rejection into a caller-visible exception.
 
void invalidate () noexcept
 Invalidate both the point preparation and its work report.
 
const PreparationReport & preparation_report () const noexcept
 Report independent refreshes of the carrier point and global border.
 
void add_residual (::mfem::Vector &carrier, ::mfem::Vector &phase) const
 Add the border to the carrier residual and set the scalar phase residual.
 
template<typename StateT>
void apply_jacobian (const StateT &direction, ::mfem::Vector &carrier, ::mfem::Vector &phase) const
 Apply the two off-diagonal blocks of the affine point border.
 
void apply_jacobian_transpose (const ::mfem::Vector &carrier_dual, const ::mfem::Vector &phase_dual, ::mfem::Vector &carrier_result, ::mfem::Vector &border_result) const
 Add the coordinate transpose of both border blocks to coefficient duals.
 

Private Types

using Base = PreparedPointConstraint<EquationT, SchemaT>
 
- Private Types inherited from serif::operators::backend::mfem::PreparedPointConstraint< EquationT, SchemaT >
using RowBinding = typename Base::RowBinding
 
- Private Types inherited from serif::operators::backend::mfem::PreparedNodalConstraint< EquationT, SchemaT >
using Test = EquationT::Test
 
using Value = discretization::forms::OperandValue<equations::TestOperandOf<EquationT>>
 
using RowBinding = discretization::backend::mfem::TermBinding<Test, SchemaT>
 

Private Member Functions

int point_dof () const noexcept
 Retrieve the unique carrier coordinate selected during construction.
 
void validate_outputs (const ::mfem::Vector &carrier, const ::mfem::Vector &phase) const
 Validate preparation, carrier size, and the single scalar output.
 
- Private Member Functions inherited from serif::operators::backend::mfem::PreparedPointConstraint< EquationT, SchemaT >
 PreparedPointConstraint (EquationT equation, const RowBinding &row)
 The equation specifies a point in the fixed computational mesh.
 
- Private Member Functions inherited from serif::operators::backend::mfem::PreparedNodalConstraint< EquationT, SchemaT >
 PreparedNodalConstraint (EquationT equation, const RowBinding &row, discretization::backend::mfem::DofSelection rows)
 Borrow selected nodal rows; vector selections contain exactly one point in component order.
 
template<typename StateT>
std::expected< void, PreparationRejection > try_prepare (const StateT &state, const PreparationMode mode=PreparationMode::rebuild)
 Freeze the local equation and derivative; rejection invalidates the previous preparation.
 
template<typename StateT>
void prepare (const StateT &state, const PreparationMode mode=PreparationMode::rebuild)
 Prepare or translate a numerical rejection to a caller-visible exception.
 
void apply_residual_rows (::mfem::Vector &result) const
 Replace the selected entries of an assembled residual.
 
template<typename StateT>
void apply_jacobian_rows (const StateT &direction, ::mfem::Vector &result) const
 Replace complete row actions, removing every unconstrained coupling at these rows.
 
void apply_jacobian_rows (const ::mfem::Vector &direction, ::mfem::Vector &result) const
 Apply the same row replacement to a coefficient vector without a state wrapper.
 
void mask_residual_dual (const ::mfem::Vector &dual, ::mfem::Vector &volume_dual) const
 Remove constrained rows BEFORE applying the volume Jacobian transpose.
 
void add_jacobian_transpose_rows (const ::mfem::Vector &dual, ::mfem::Vector &result) const
 Add the nodal transpose AFTER the volume transpose of the masked residual dual.
 
void invalidate () noexcept
 Invalidate frozen residuals and derivatives.
 
bool is_prepared () const noexcept
 Report whether a complete preparation exists.
 
std::size_t preparation_count () const noexcept
 Count successful preparations.
 
const PreparationReport & preparation_report () const noexcept
 Report whether the selected nodal equations were reevaluated.
 
const discretization::backend::mfem::DofSelection & rows () const noexcept
 Return the selected supported coefficient indices.
 
const EquationT & equation () const noexcept
 Expose immutable physics metadata to constraint diagnostics.
 
void validate_result (const ::mfem::Vector &result) const
 Reject missing preparation, stale selection, and incorrect output sizes.
 
const NodalData & prepared_data () const
 Read frozen nodal values shared by row replacement and point borders.
 

Private Attributes

const BorderBinding & m_border_binding
 
double m_border {0.0}
 
PreparationReport m_report
 
- Private Attributes inherited from serif::operators::backend::mfem::PreparedNodalConstraint< EquationT, SchemaT >
std::unique_ptr< const EquationT > m_equation
 
const RowBinding & m_row
 
discretization::backend::mfem::DofSelection m_rows
 

Additional Inherited Members

- Static Private Attributes inherited from serif::operators::backend::mfem::PreparedNodalConstraint< EquationT, SchemaT >
static constexpr int components = discretization::forms::component_count<Value>
 

Detailed Description

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
requires (discretization::blocks::SpatialTermTraits<typename EquationT::Test>::rank == 0 && discretization::blocks::GlobalScalarTerm<typename EquationT::Border> && EquationT::affine)
class serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >

An affine scalar point condition F(u_c)=0 with border R_u += lambda dF/du_c. The coordinate functional and its transpose share the same selected DOF.

Member Typedef Documentation

◆ Base

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
using serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::Base = PreparedPointConstraint<EquationT, SchemaT>
private

◆ BorderBinding

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
using serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::BorderBinding = discretization::backend::mfem::TermBinding<typename EquationT::Border, SchemaT>

◆ RowBinding

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
using serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::RowBinding = typename Base::RowBinding

Constructor & Destructor Documentation

◆ PreparedPointBorder()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::PreparedPointBorder ( EquationT equation,
const RowBinding & row,
const BorderBinding & border )
inline

Borrow one carrier point and one global scalar border on the same mesh.

Member Function Documentation

◆ add_residual()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
void serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::add_residual ( ::mfem::Vector & carrier,
::mfem::Vector & phase ) const
inline

Add the border to the carrier residual and set the scalar phase residual.

◆ apply_jacobian()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
template<typename StateT>
void serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::apply_jacobian ( const StateT & direction,
::mfem::Vector & carrier,
::mfem::Vector & phase ) const
inline

Apply the two off-diagonal blocks of the affine point border.

◆ apply_jacobian_transpose()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
void serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::apply_jacobian_transpose ( const ::mfem::Vector & carrier_dual,
const ::mfem::Vector & phase_dual,
::mfem::Vector & carrier_result,
::mfem::Vector & border_result ) const
inline

Add the coordinate transpose of both border blocks to coefficient duals.

◆ invalidate()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
void serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::invalidate ( )
inlinenoexcept

Invalidate both the point preparation and its work report.

◆ point_dof()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
int serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::point_dof ( ) const
inlinenodiscardprivatenoexcept

Retrieve the unique carrier coordinate selected during construction.

◆ preparation_report()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
const PreparationReport & serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::preparation_report ( ) const
inlinenodiscardnoexcept

Report independent refreshes of the carrier point and global border.

◆ prepare()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
template<typename StateT>
void serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::prepare ( const StateT & state,
const PreparationMode mode = PreparationMode::rebuild )
inline

Prepare or translate numerical rejection into a caller-visible exception.

◆ try_prepare()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
template<typename StateT>
std::expected< void, PreparationRejection > serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::try_prepare ( const StateT & state,
const PreparationMode mode = PreparationMode::rebuild )
inlinenodiscard

Freeze both the point condition and its border coefficient.

◆ validate_outputs()

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
void serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::validate_outputs ( const ::mfem::Vector & carrier,
const ::mfem::Vector & phase ) const
inlineprivate

Validate preparation, carrier size, and the single scalar output.

Member Data Documentation

◆ m_border

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
double serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::m_border {0.0}
private

◆ m_border_binding

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
const BorderBinding& serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::m_border_binding
private

◆ m_report

template<NodalValueEquation EquationT, discretization::domain::schema::IsSchema SchemaT>
PreparationReport serif::operators::backend::mfem::PreparedPointBorder< EquationT, SchemaT >::m_report
private

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