v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MoFEM::ConstrainMatrixCtx Struct Referenceabstract

API for matrices that project onto, or lift from, a constraint space. More...

#include "src/petsc/ConstrainMatrixCtx.hpp"

Inheritance diagram for MoFEM::ConstrainMatrixCtx:
[legend]

Public Member Functions

virtual ~ConstrainMatrixCtx ()=default
 
virtual MoFEMErrorCode setConstrainMatrix (Mat constrain_matrix, Mat inverse_cct)=0
 
virtual Mat getConstrainMatrix () const =0
 
virtual Mat getInverseCCT () const =0
 
virtual MoFEMErrorCode setSystemMatrix (Mat system_matrix)=0
 
virtual Mat getSystemMatrix () const =0
 
virtual MoFEMErrorCode initializeQorP (Vec x)=0
 
virtual MoFEMErrorCode initializeQTKQ ()=0
 
virtual MoFEMErrorCode recalculateCT ()=0
 
virtual MoFEMErrorCode recalculateCTC ()=0
 
virtual MoFEMErrorCode applyQ (Vec x, Vec f)=0
 
virtual MoFEMErrorCode applyP (Vec x, Vec f)=0
 
virtual MoFEMErrorCode applyR (Vec x, Vec f)=0
 
virtual MoFEMErrorCode applyRT (Vec x, Vec f)=0
 
virtual MoFEMErrorCode applyCTC_QTKQ (Vec x, Vec f)=0
 

Detailed Description

API for matrices that project onto, or lift from, a constraint space.

Definition at line 16 of file ConstrainMatrixCtx.hpp.

Constructor & Destructor Documentation

◆ ~ConstrainMatrixCtx()

virtual MoFEM::ConstrainMatrixCtx::~ConstrainMatrixCtx ( )
virtualdefault

Member Function Documentation

◆ applyCTC_QTKQ()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::applyCTC_QTKQ ( Vec  x,
Vec  f 
)
pure virtual

Apply C^T C + Q^T K Q.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ applyP()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::applyP ( Vec  x,
Vec  f 
)
pure virtual

Apply P = C^T S C for the supplied inverse action S.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ applyQ()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::applyQ ( Vec  x,
Vec  f 
)
pure virtual

Apply Q = I - C^T S C for the supplied inverse action S.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ applyR()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::applyR ( Vec  x,
Vec  f 
)
pure virtual

Apply R = C^T S for the supplied inverse action S.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ applyRT()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::applyRT ( Vec  x,
Vec  f 
)
pure virtual

Apply R^T = S^T C for the supplied inverse action S.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ getConstrainMatrix()

virtual Mat MoFEM::ConstrainMatrixCtx::getConstrainMatrix ( ) const
pure virtual

Get the constraint matrix C.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ getInverseCCT()

virtual Mat MoFEM::ConstrainMatrixCtx::getInverseCCT ( ) const
pure virtual

Get the supplied inverse action for C C^T.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ getSystemMatrix()

virtual Mat MoFEM::ConstrainMatrixCtx::getSystemMatrix ( ) const
pure virtual

Get the matrix K used by C^T C + Q^T K Q.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ initializeQorP()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::initializeQorP ( Vec  x)
pure virtual

Initialize matrices, vectors, and the scatter used by Q, P, R, and R^T. The operation is idempotent until the C/inverse-action pair is replaced.

Parameters
xVector defining the full problem layout.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ initializeQTKQ()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::initializeQTKQ ( )
pure virtual

Initialize matrices and work vectors used by C^T C + Q^T K Q. The operation is idempotent until C or K is replaced.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ recalculateCT()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::recalculateCT ( )
pure virtual

Recalculate C^T after an in-place value change in C. The layout and nonzero structure of C must be unchanged. The caller must update the supplied inverse action in the same transaction. Projection MATSHELL objects already created from this context do not receive a PETSc state increment; recreate them before passing the changed operator to a consumer which caches by matrix state.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ recalculateCTC()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::recalculateCTC ( )
pure virtual

Recalculate C^T C after an in-place value change in C. The layout and nonzero structure of C must be unchanged.

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ setConstrainMatrix()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::setConstrainMatrix ( Mat  constrain_matrix,
Mat  inverse_cct 
)
pure virtual

Set the constraint matrix C and its row-space inverse action atomically.

inverse_cct represents (C C^T)^-1 on the selected constraint space, or the corresponding embedded generalized inverse for a masked full space. It must have the row layout of C in both dimensions and support MatMult(). MatMultTranspose() is additionally required by applyRT() and applyCTC_QTKQ(). Both PETSc objects are retained.

All data derived from the previous pair are invalidated. For in-place value changes which preserve layouts and sparsity, update inverse_cct in the same transaction and call recalculateCT() and recalculateCTC().

Implemented in MoFEM::ConstrainMatrixCtxImpl.

◆ setSystemMatrix()

virtual MoFEMErrorCode MoFEM::ConstrainMatrixCtx::setSystemMatrix ( Mat  system_matrix)
pure virtual

Set the matrix K used by C^T C + Q^T K Q and retain a PETSc reference. Work vectors derived from the previous K are invalidated.

Implemented in MoFEM::ConstrainMatrixCtxImpl.


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