v0.13.1
Public Member Functions | Public Attributes | Friends | List of all members
ConvectiveMassElement::MatShellCtx Struct Reference

#include <users_modules/basic_finite_elements/src/ConvectiveMassElement.hpp>

Collaboration diagram for ConvectiveMassElement::MatShellCtx:
[legend]

Public Member Functions

 MatShellCtx ()
 
virtual ~MatShellCtx ()
 
MoFEMErrorCode iNit ()
 
MoFEMErrorCode dEstroy ()
 

Public Attributes

Mat K
 
Mat M
 
VecScatter scatterU
 
VecScatter scatterV
 
double ts_a
 
bool iNitialized
 
Mat barK
 
Vec u
 
Vec v
 
Vec Ku
 
Vec Mv
 

Friends

MoFEMErrorCode MultOpA (Mat A, Vec x, Vec f)
 
MoFEMErrorCode ZeroEntriesOp (Mat A)
 

Detailed Description

Examples
nonlinear_dynamics.cpp.

Definition at line 502 of file ConvectiveMassElement.hpp.

Constructor & Destructor Documentation

◆ MatShellCtx()

ConvectiveMassElement::MatShellCtx::MatShellCtx ( )

◆ ~MatShellCtx()

ConvectiveMassElement::MatShellCtx::~MatShellCtx ( )
virtual

Definition at line 2349 of file ConvectiveMassElement.cpp.

2349 {
2350 if (iNitialized) {
2351
2352 CHKERR dEstroy();
2353 CHKERRABORT(PETSC_COMM_WORLD, ierr);
2354 }
2355}
#define CHKERR
Inline error check.
Definition: definitions.h:535
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76

Member Function Documentation

◆ dEstroy()

MoFEMErrorCode ConvectiveMassElement::MatShellCtx::dEstroy ( )

Definition at line 2374 of file ConvectiveMassElement.cpp.

2374 {
2376 if (iNitialized) {
2377
2378 CHKERR VecDestroy(&u);
2379 CHKERR VecDestroy(&Ku);
2380 CHKERR VecDestroy(&v);
2381 CHKERR VecDestroy(&Mv);
2382 CHKERR MatDestroy(&barK);
2383 iNitialized = false;
2384 }
2386}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440

◆ iNit()

MoFEMErrorCode ConvectiveMassElement::MatShellCtx::iNit ( )
Examples
nonlinear_dynamics.cpp.

Definition at line 2357 of file ConvectiveMassElement.cpp.

2357 {
2359 if (!iNitialized) {
2360
2361#if PETSC_VERSION_GE(3, 5, 3)
2362 CHKERR MatCreateVecs(K, &u, &Ku);
2363 CHKERR MatCreateVecs(M, &v, &Mv);
2364#else
2365 CHKERR MatGetVecs(K, &u, &Ku);
2366 CHKERR MatGetVecs(M, &v, &Mv);
2367#endif
2368 CHKERR MatDuplicate(K, MAT_SHARE_NONZERO_PATTERN, &barK);
2369 iNitialized = true;
2370 }
2372}

Friends And Related Function Documentation

◆ MultOpA

MoFEMErrorCode MultOpA ( Mat  A,
Vec  x,
Vec  f 
)
friend

◆ ZeroEntriesOp

MoFEMErrorCode ZeroEntriesOp ( Mat  A)
friend

Member Data Documentation

◆ barK

Mat ConvectiveMassElement::MatShellCtx::barK
Examples
nonlinear_dynamics.cpp.

Definition at line 512 of file ConvectiveMassElement.hpp.

◆ iNitialized

bool ConvectiveMassElement::MatShellCtx::iNitialized

Definition at line 508 of file ConvectiveMassElement.hpp.

◆ K

Mat ConvectiveMassElement::MatShellCtx::K
Examples
nonlinear_dynamics.cpp.

Definition at line 504 of file ConvectiveMassElement.hpp.

◆ Ku

Vec ConvectiveMassElement::MatShellCtx::Ku

Definition at line 513 of file ConvectiveMassElement.hpp.

◆ M

Mat ConvectiveMassElement::MatShellCtx::M
Examples
nonlinear_dynamics.cpp.

Definition at line 504 of file ConvectiveMassElement.hpp.

◆ Mv

Vec ConvectiveMassElement::MatShellCtx::Mv

Definition at line 513 of file ConvectiveMassElement.hpp.

◆ scatterU

VecScatter ConvectiveMassElement::MatShellCtx::scatterU
Examples
nonlinear_dynamics.cpp.

Definition at line 505 of file ConvectiveMassElement.hpp.

◆ scatterV

VecScatter ConvectiveMassElement::MatShellCtx::scatterV
Examples
nonlinear_dynamics.cpp.

Definition at line 505 of file ConvectiveMassElement.hpp.

◆ ts_a

double ConvectiveMassElement::MatShellCtx::ts_a

Definition at line 506 of file ConvectiveMassElement.hpp.

◆ u

Vec ConvectiveMassElement::MatShellCtx::u
Examples
nonlinear_dynamics.cpp.

Definition at line 513 of file ConvectiveMassElement.hpp.

◆ v

Vec ConvectiveMassElement::MatShellCtx::v
Examples
nonlinear_dynamics.cpp.

Definition at line 513 of file ConvectiveMassElement.hpp.


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