SERiF 0.0.1a
3+1D Stellar Structure and Evolution
|
Represents the Schur complement operator used in the solution process. More...
#include <polytropeOperator.h>
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. | |
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.
serif::polytrope::SchurCompliment::SchurCompliment | ( | const mfem::SparseMatrix & | QOp, |
const mfem::SparseMatrix & | DOp, | ||
const mfem::SparseMatrix & | MOp, | ||
const mfem::Solver & | GradInvOp ) |
Constructs a SchurCompliment operator.
QOp | The Q matrix operator. |
DOp | The D matrix operator. |
MOp | The M matrix operator. |
GradInvOp | The inverse of the gradient operator. |
Definition at line 36 of file polytropeOperator.cpp.
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.
QOp | The Q matrix operator. |
DOp | The D matrix operator. |
MOp | The M matrix operator. |
Definition at line 48 of file polytropeOperator.cpp.
|
overridedefault |
Destructor.
|
override |
Applies the Schur complement operator: y = (D - Q * GradInv * M) * x.
x | The input vector. |
y | The output vector. |
Definition at line 60 of file polytropeOperator.cpp.
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.
QOp | The Q matrix operator. |
DOp | The D matrix operator. |
MOp | The M matrix operator. |
GradInvOp | The inverse of the gradient operator. |
Definition at line 98 of file polytropeOperator.cpp.
|
private |
Updates the constant matrix terms (Q, D, M).
QOp | The Q matrix operator. |
DOp | The D matrix operator. |
MOp | The M matrix operator. |
Definition at line 108 of file polytropeOperator.cpp.
void serif::polytrope::SchurCompliment::updateInverseNonlinearJacobian | ( | const mfem::Solver & | gradInv | ) |
Updates the inverse of the nonlinear Jacobian (GradInv).
gradInv | The new inverse gradient solver. |
Definition at line 103 of file polytropeOperator.cpp.
|
private |
Pointer to the D matrix operator.
Definition at line 104 of file polytropeOperator.h.
|
private |
Pointer to the inverse of the gradient operator.
Definition at line 106 of file polytropeOperator.h.
|
mutableprivate |
Optional: if a matrix representation is ever explicitly formed.
Definition at line 113 of file polytropeOperator.h.
|
private |
Pointer to the M matrix operator.
Definition at line 105 of file polytropeOperator.h.
|
private |
Dimension related to the phi variable (typically number of rows/cols of D).
Definition at line 109 of file polytropeOperator.h.
|
private |
Dimension related to the theta variable (typically number of rows of M).
Definition at line 110 of file polytropeOperator.h.
|
private |
Pointer to the Q matrix operator.
Definition at line 103 of file polytropeOperator.h.