SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
serif::polytrope::SchurCompliment Class Referencefinal

Represents the Schur complement operator used in the solution process. More...

#include <polytropeOperator.h>

Inheritance diagram for serif::polytrope::SchurCompliment:

Public Member Functions

 SchurCompliment (const mfem::SparseMatrix &QOp, const mfem::SparseMatrix &DOp, const mfem::SparseMatrix &MOp, const mfem::Solver &GradInvOp)
 Constructs a SchurCompliment operator.
 
 SchurCompliment (const mfem::SparseMatrix &QOp, const mfem::SparseMatrix &DOp, const mfem::SparseMatrix &MOp)
 Constructs a SchurCompliment operator without the inverse gradient initially. The inverse gradient must be set later using updateInverseNonlinearJacobian.
 
 ~SchurCompliment () override=default
 Destructor.
 
void Mult (const mfem::Vector &x, mfem::Vector &y) const override
 Applies the Schur complement operator: y = (D - Q * GradInv * M) * x.
 
void SetOperator (const mfem::SparseMatrix &QOp, const mfem::SparseMatrix &DOp, const mfem::SparseMatrix &MOp, const mfem::Solver &GradInvOp)
 Sets all operators for the Schur complement.
 
void updateInverseNonlinearJacobian (const mfem::Solver &gradInv)
 Updates the inverse of the nonlinear Jacobian (GradInv).
 

Private Member Functions

void updateConstantTerms (const mfem::SparseMatrix &QOp, const mfem::SparseMatrix &DOp, const mfem::SparseMatrix &MOp)
 Updates the constant matrix terms (Q, D, M).
 

Private Attributes

const mfem::SparseMatrix * m_QOp = nullptr
 Pointer to the Q matrix operator.
 
const mfem::SparseMatrix * m_DOp = nullptr
 Pointer to the D matrix operator.
 
const mfem::SparseMatrix * m_MOp = nullptr
 Pointer to the M matrix operator.
 
const mfem::Solver * m_GradInvOp = nullptr
 Pointer to the inverse of the gradient operator.
 
int m_nPhi = 0
 Dimension related to the phi variable (typically number of rows/cols of D).
 
int m_nTheta = 0
 Dimension related to the theta variable (typically number of rows of M).
 
std::unique_ptr< mfem::SparseMatrix > m_matrixForm
 Optional: if a matrix representation is ever explicitly formed.
 

Detailed Description

Represents the Schur complement operator used in the solution process.

This class computes S = D - Q * GradInv * M.

Definition at line 36 of file polytropeOperator.h.

Constructor & Destructor Documentation

◆ SchurCompliment() [1/2]

serif::polytrope::SchurCompliment::SchurCompliment ( const mfem::SparseMatrix & QOp,
const mfem::SparseMatrix & DOp,
const mfem::SparseMatrix & MOp,
const mfem::Solver & GradInvOp )

Constructs a SchurCompliment operator.

Parameters
QOpThe Q matrix operator.
DOpThe D matrix operator.
MOpThe M matrix operator.
GradInvOpThe inverse of the gradient operator.

Definition at line 36 of file polytropeOperator.cpp.

◆ SchurCompliment() [2/2]

serif::polytrope::SchurCompliment::SchurCompliment ( const mfem::SparseMatrix & QOp,
const mfem::SparseMatrix & DOp,
const mfem::SparseMatrix & MOp )

Constructs a SchurCompliment operator without the inverse gradient initially. The inverse gradient must be set later using updateInverseNonlinearJacobian.

Parameters
QOpThe Q matrix operator.
DOpThe D matrix operator.
MOpThe M matrix operator.

Definition at line 48 of file polytropeOperator.cpp.

◆ ~SchurCompliment()

serif::polytrope::SchurCompliment::~SchurCompliment ( )
overridedefault

Destructor.

Member Function Documentation

◆ Mult()

void serif::polytrope::SchurCompliment::Mult ( const mfem::Vector & x,
mfem::Vector & y ) const
override

Applies the Schur complement operator: y = (D - Q * GradInv * M) * x.

Parameters
xThe input vector.
yThe output vector.

Definition at line 60 of file polytropeOperator.cpp.

◆ SetOperator()

void serif::polytrope::SchurCompliment::SetOperator ( const mfem::SparseMatrix & QOp,
const mfem::SparseMatrix & DOp,
const mfem::SparseMatrix & MOp,
const mfem::Solver & GradInvOp )

Sets all operators for the Schur complement.

Parameters
QOpThe Q matrix operator.
DOpThe D matrix operator.
MOpThe M matrix operator.
GradInvOpThe inverse of the gradient operator.

Definition at line 98 of file polytropeOperator.cpp.

◆ updateConstantTerms()

void serif::polytrope::SchurCompliment::updateConstantTerms ( const mfem::SparseMatrix & QOp,
const mfem::SparseMatrix & DOp,
const mfem::SparseMatrix & MOp )
private

Updates the constant matrix terms (Q, D, M).

Parameters
QOpThe Q matrix operator.
DOpThe D matrix operator.
MOpThe M matrix operator.

Definition at line 108 of file polytropeOperator.cpp.

◆ updateInverseNonlinearJacobian()

void serif::polytrope::SchurCompliment::updateInverseNonlinearJacobian ( const mfem::Solver & gradInv)

Updates the inverse of the nonlinear Jacobian (GradInv).

Parameters
gradInvThe new inverse gradient solver.

Definition at line 103 of file polytropeOperator.cpp.

Member Data Documentation

◆ m_DOp

const mfem::SparseMatrix* serif::polytrope::SchurCompliment::m_DOp = nullptr
private

Pointer to the D matrix operator.

Definition at line 104 of file polytropeOperator.h.

◆ m_GradInvOp

const mfem::Solver* serif::polytrope::SchurCompliment::m_GradInvOp = nullptr
private

Pointer to the inverse of the gradient operator.

Definition at line 106 of file polytropeOperator.h.

◆ m_matrixForm

std::unique_ptr<mfem::SparseMatrix> serif::polytrope::SchurCompliment::m_matrixForm
mutableprivate

Optional: if a matrix representation is ever explicitly formed.

Definition at line 113 of file polytropeOperator.h.

◆ m_MOp

const mfem::SparseMatrix* serif::polytrope::SchurCompliment::m_MOp = nullptr
private

Pointer to the M matrix operator.

Definition at line 105 of file polytropeOperator.h.

◆ m_nPhi

int serif::polytrope::SchurCompliment::m_nPhi = 0
private

Dimension related to the phi variable (typically number of rows/cols of D).

Definition at line 109 of file polytropeOperator.h.

◆ m_nTheta

int serif::polytrope::SchurCompliment::m_nTheta = 0
private

Dimension related to the theta variable (typically number of rows of M).

Definition at line 110 of file polytropeOperator.h.

◆ m_QOp

const mfem::SparseMatrix* serif::polytrope::SchurCompliment::m_QOp = nullptr
private

Pointer to the Q matrix operator.

Definition at line 103 of file polytropeOperator.h.


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