 |
| v0.14.0
|
structure for projection matrices
More...
#include <users_modules/basic_finite_elements/src/ConstrainMatrixCtx.hpp>
|
| ConstrainMatrixCtx (MoFEM::Interface &m_field, string x_problem, string y_problem, bool create_ksp=true, bool own_contrain_matrix=false) |
|
| ConstrainMatrixCtx (MoFEM::Interface &m_field, VecScatter scatter, bool create_ksp=true, bool own_contrain_matrix=false) |
|
virtual | ~ConstrainMatrixCtx () |
|
MoFEMErrorCode | initializeQorP (Vec x) |
| initialize vectors and matrices for Q and P shell matrices, scattering is set based on x_problem and y_problem More...
|
|
MoFEMErrorCode | initializeQTKQ () |
| initialize vectors and matrices for CTC+QTKQ shell matrices, scattering is set based on x_problem and y_problem More...
|
|
MoFEMErrorCode | recalculateCTandCCT () |
| re-calculate CT and CCT if C matrix has been changed since initialization More...
|
|
MoFEMErrorCode | recalculateCTC () |
| re-calculate CTC matrix has been changed since initialization More...
|
|
MoFEMErrorCode | destroyQorP () |
| destroy sub-matrices used for shell matrices P, Q, R, RT More...
|
|
MoFEMErrorCode | destroyQTKQ () |
| destroy sub-matrices used for shell matrix QTKQ More...
|
|
|
MoFEMErrorCode | ProjectionMatrixMultOpQ (Mat Q, Vec x, Vec f) |
| Multiplication operator for Q = I-CTC(CCT)^-1C. More...
|
|
MoFEMErrorCode | ConstrainMatrixMultOpP (Mat P, Vec x, Vec f) |
| Multiplication operator for P = CT(CCT)^-1C. More...
|
|
MoFEMErrorCode | ConstrainMatrixMultOpR (Mat R, Vec x, Vec f) |
| Multiplication operator for R = CT(CCT)^-1. More...
|
|
MoFEMErrorCode | ConstrainMatrixMultOpRT (Mat RT, Vec x, Vec f) |
| Multiplication operator for RT = (CCT)^-TC. More...
|
|
MoFEMErrorCode | ConstrainMatrixMultOpCTC_QTKQ (Mat CTC_QTKQ, Vec x, Vec f) |
| Multiplication operator for RT = (CCT)^-TC. More...
|
|
MoFEMErrorCode | ConstrainMatrixDestroyOpPorQ () |
|
MoFEMErrorCode | ConstrainMatrixDestroyOpQTKQ () |
|
structure for projection matrices
Definition at line 16 of file ConstrainMatrixCtx.hpp.
◆ ConstrainMatrixCtx() [1/2]
ConstrainMatrixCtx::ConstrainMatrixCtx |
( |
MoFEM::Interface & |
m_field, |
|
|
string |
x_problem, |
|
|
string |
y_problem, |
|
|
bool |
create_ksp = true , |
|
|
bool |
own_contrain_matrix = false |
|
) |
| |
Construct data structure to build operators for projection matrices
User need to set matrix C to make it work
- Parameters
-
x_problem | problem on which vector is projected |
y_problem | problem used to construct projection matrices |
create_ksp | create ksp solver otherwise user need to set it up |
◆ ConstrainMatrixCtx() [2/2]
ConstrainMatrixCtx::ConstrainMatrixCtx |
( |
MoFEM::Interface & |
m_field, |
|
|
VecScatter |
scatter, |
|
|
bool |
create_ksp = true , |
|
|
bool |
own_contrain_matrix = false |
|
) |
| |
◆ ~ConstrainMatrixCtx()
virtual ConstrainMatrixCtx::~ConstrainMatrixCtx |
( |
| ) |
|
|
inlinevirtual |
◆ destroyQorP()
MoFEMErrorCode ConstrainMatrixCtx::destroyQorP |
( |
| ) |
|
destroy sub-matrices used for shell matrices P, Q, R, RT
◆ destroyQTKQ()
MoFEMErrorCode ConstrainMatrixCtx::destroyQTKQ |
( |
| ) |
|
destroy sub-matrices used for shell matrix QTKQ
◆ initializeQorP()
MoFEMErrorCode ConstrainMatrixCtx::initializeQorP |
( |
Vec |
x | ) |
|
initialize vectors and matrices for Q and P shell matrices, scattering is set based on x_problem and y_problem
- Parameters
-
x | is a vector from problem x |
◆ initializeQTKQ()
MoFEMErrorCode ConstrainMatrixCtx::initializeQTKQ |
( |
| ) |
|
initialize vectors and matrices for CTC+QTKQ shell matrices, scattering is set based on x_problem and y_problem
◆ recalculateCTandCCT()
MoFEMErrorCode ConstrainMatrixCtx::recalculateCTandCCT |
( |
| ) |
|
re-calculate CT and CCT if C matrix has been changed since initialization
◆ recalculateCTC()
MoFEMErrorCode ConstrainMatrixCtx::recalculateCTC |
( |
| ) |
|
re-calculate CTC matrix has been changed since initialization
◆ ConstrainMatrixDestroyOpPorQ
MoFEMErrorCode ConstrainMatrixDestroyOpPorQ |
( |
| ) |
|
|
friend |
◆ ConstrainMatrixDestroyOpQTKQ
MoFEMErrorCode ConstrainMatrixDestroyOpQTKQ |
( |
| ) |
|
|
friend |
◆ ConstrainMatrixMultOpCTC_QTKQ
MoFEMErrorCode ConstrainMatrixMultOpCTC_QTKQ |
( |
Mat |
CTC_QTKQ, |
|
|
Vec |
x, |
|
|
Vec |
f |
|
) |
| |
|
friend |
Multiplication operator for RT = (CCT)^-TC.
Mat CTC_QTKQ;
projection_matrix_ctx(m_field,problem_name,contrains_problem_name);
MatCreateShell(PETSC_COMM_WORLD,
m,
m,
M,
M,&projection_matrix_ctx,&CTC_QTKQ);
Definition at line 261 of file ConstrainMatrixCtx.cpp.
264 CHKERR MatShellGetContext(CTC_QTKQ, &void_ctx);
272 CHKERR MatShellSetOperation(Q, MATOP_MULT,
280 CHKERR VecScatterEnd(ctx->
sCatter, x, ctx->
X, INSERT_VALUES, SCATTER_FORWARD);
◆ ConstrainMatrixMultOpP
MoFEMErrorCode ConstrainMatrixMultOpP |
( |
Mat |
P, |
|
|
Vec |
x, |
|
|
Vec |
f |
|
) |
| |
|
friend |
Multiplication operator for P = CT(CCT)^-1C.
projection_matrix_ctx(m_field,problem_name,contrains_problem_name);
CHKERR MatCreateShell(PETSC_COMM_WORLD,
m,
m,
M,
M,&projection_matrix_ctx,&
P);
Definition at line 197 of file ConstrainMatrixCtx.cpp.
200 CHKERR MatShellGetContext(
P, &void_ctx);
206 CHKERR VecScatterEnd(ctx->
sCatter, x, ctx->
X, INSERT_VALUES, SCATTER_FORWARD);
211 CHKERR VecGhostUpdateBegin(
f, INSERT_VALUES, SCATTER_FORWARD);
212 CHKERR VecGhostUpdateEnd(
f, INSERT_VALUES, SCATTER_FORWARD);
◆ ConstrainMatrixMultOpR
MoFEMErrorCode ConstrainMatrixMultOpR |
( |
Mat |
R, |
|
|
Vec |
x, |
|
|
Vec |
f |
|
) |
| |
|
friend |
Multiplication operator for R = CT(CCT)^-1.
projection_matrix_ctx(m_field,problem_name,contrains_problem_name);
CHKERR MatCreateShell(PETSC_COMM_WORLD,
m,
m,
M,
M,&projection_matrix_ctx,&
R);
Definition at line 221 of file ConstrainMatrixCtx.cpp.
224 CHKERR MatShellGetContext(
R, &void_ctx);
229 "you have to call first initQorP or use Q matrix");
233 CHKERR VecGhostUpdateBegin(
f, INSERT_VALUES, SCATTER_FORWARD);
234 CHKERR VecGhostUpdateEnd(
f, INSERT_VALUES, SCATTER_FORWARD);
◆ ConstrainMatrixMultOpRT
MoFEMErrorCode ConstrainMatrixMultOpRT |
( |
Mat |
RT, |
|
|
Vec |
x, |
|
|
Vec |
f |
|
) |
| |
|
friend |
Multiplication operator for RT = (CCT)^-TC.
Mat RT;
projection_matrix_ctx(m_field,problem_name,contrains_problem_name);
CHKERR MatCreateShell(PETSC_COMM_WORLD,
m,
m,
M,
M,&projection_matrix_ctx,&RT);
Definition at line 243 of file ConstrainMatrixCtx.cpp.
246 CHKERR MatShellGetContext(RT, &void_ctx);
251 "you have to call first initQorP or use Q matrix");
254 CHKERR VecScatterEnd(ctx->
sCatter, x, ctx->
X, INSERT_VALUES, SCATTER_FORWARD);
◆ ProjectionMatrixMultOpQ
MoFEMErrorCode ProjectionMatrixMultOpQ |
( |
Mat |
Q, |
|
|
Vec |
x, |
|
|
Vec |
f |
|
) |
| |
|
friend |
Multiplication operator for Q = I-CTC(CCT)^-1C.
Mat Q;
projection_matrix_ctx(m_field,problem_name,contrains_problem_name);
CHKERR MatCreateShell(PETSC_COMM_WORLD,
m,
m,
M,
M,&projection_matrix_ctx,&Q);
Definition at line 163 of file ConstrainMatrixCtx.cpp.
166 CHKERR MatShellGetContext(Q, &void_ctx);
173 CHKERR VecScatterEnd(ctx->
sCatter, x, ctx->
X, INSERT_VALUES, SCATTER_FORWARD);
182 if (flg == PETSC_FALSE)
◆ absTol
PetscReal ConstrainMatrixCtx::absTol |
Mat ConstrainMatrixCtx::C |
◆ cancelKSPMonitor
bool ConstrainMatrixCtx::cancelKSPMonitor |
◆ CCT
Mat ConstrainMatrixCtx::CCT |
◆ CCTm1_Cx
Vec ConstrainMatrixCtx::CCTm1_Cx |
◆ createKSP
bool ConstrainMatrixCtx::createKSP |
◆ createScatter
bool ConstrainMatrixCtx::createScatter |
◆ CT
Mat ConstrainMatrixCtx::CT |
◆ CT_CCTm1_Cx
Vec ConstrainMatrixCtx::CT_CCTm1_Cx |
◆ CTC
Mat ConstrainMatrixCtx::CTC |
◆ CTCx
Vec ConstrainMatrixCtx::CTCx |
◆ Cx
Vec ConstrainMatrixCtx::Cx |
◆ dTol
PetscReal ConstrainMatrixCtx::dTol |
◆ initQorP
bool ConstrainMatrixCtx::initQorP |
◆ initQTKQ
bool ConstrainMatrixCtx::initQTKQ |
Mat ConstrainMatrixCtx::K |
◆ KQx
Vec ConstrainMatrixCtx::KQx |
◆ kSP
KSP ConstrainMatrixCtx::kSP |
◆ maxIts
PetscInt ConstrainMatrixCtx::maxIts |
◆ mField
◆ MOFEM_EVENT_projCTC_QTKQ
PetscLogEvent ConstrainMatrixCtx::MOFEM_EVENT_projCTC_QTKQ |
◆ MOFEM_EVENT_projInit
PetscLogEvent ConstrainMatrixCtx::MOFEM_EVENT_projInit |
◆ MOFEM_EVENT_projP
PetscLogEvent ConstrainMatrixCtx::MOFEM_EVENT_projP |
◆ MOFEM_EVENT_projQ
PetscLogEvent ConstrainMatrixCtx::MOFEM_EVENT_projQ |
◆ MOFEM_EVENT_projR
PetscLogEvent ConstrainMatrixCtx::MOFEM_EVENT_projR |
◆ MOFEM_EVENT_projRT
PetscLogEvent ConstrainMatrixCtx::MOFEM_EVENT_projRT |
◆ ownConstrainMatrix
bool ConstrainMatrixCtx::ownConstrainMatrix |
◆ Qx
Vec ConstrainMatrixCtx::Qx |
◆ rTol
PetscReal ConstrainMatrixCtx::rTol |
◆ sCatter
VecScatter ConstrainMatrixCtx::sCatter |
Vec ConstrainMatrixCtx::X |
◆ xProblem
string ConstrainMatrixCtx::xProblem |
◆ yProblem
string ConstrainMatrixCtx::yProblem |
The documentation for this struct was generated from the following file:
MoFEMErrorCode initializeQorP(Vec x)
initialize vectors and matrices for Q and P shell matrices, scattering is set based on x_problem and ...
MoFEMErrorCode destroyQorP()
destroy sub-matrices used for shell matrices P, Q, R, RT
virtual MPI_Comm & get_comm() const =0
PetscLogEvent MOFEM_EVENT_projCTC_QTKQ
friend MoFEMErrorCode ConstrainMatrixMultOpCTC_QTKQ(Mat CTC_QTKQ, Vec x, Vec f)
Multiplication operator for RT = (CCT)^-TC.
friend MoFEMErrorCode ConstrainMatrixMultOpRT(Mat RT, Vec x, Vec f)
Multiplication operator for RT = (CCT)^-TC.
friend MoFEMErrorCode ConstrainMatrixDestroyOpPorQ()
MoFEMErrorCode destroyQTKQ()
destroy sub-matrices used for shell matrix QTKQ
FTensor::Index< 'M', 3 > M
friend MoFEMErrorCode ConstrainMatrixMultOpR(Mat R, Vec x, Vec f)
Multiplication operator for R = CT(CCT)^-1.
#define CHKERR
Inline error check.
PetscLogEvent MOFEM_EVENT_projR
friend MoFEMErrorCode ConstrainMatrixMultOpP(Mat P, Vec x, Vec f)
Multiplication operator for P = CT(CCT)^-1C.
friend MoFEMErrorCode ProjectionMatrixMultOpQ(Mat Q, Vec x, Vec f)
Multiplication operator for Q = I-CTC(CCT)^-1C.
PetscLogEvent MOFEM_EVENT_projRT
friend MoFEMErrorCode ConstrainMatrixDestroyOpQTKQ()
PetscLogEvent MOFEM_EVENT_projP
MoFEM::Interface & mField
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscLogEvent MOFEM_EVENT_projQ
FTensor::Index< 'm', 3 > m
structure for projection matrices
MoFEMErrorCode initializeQTKQ()
initialize vectors and matrices for CTC+QTKQ shell matrices, scattering is set based on x_problem and...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...