v0.14.0
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 ( )

Definition at line 2343 of file ConvectiveMassElement.cpp.

2343 : iNitialized(false) {}

◆ ~MatShellCtx()

ConvectiveMassElement::MatShellCtx::~MatShellCtx ( )
virtual

Definition at line 2344 of file ConvectiveMassElement.cpp.

2344  {
2345  if (iNitialized) {
2346 
2347  CHKERR dEstroy();
2348  CHKERRABORT(PETSC_COMM_WORLD, ierr);
2349  }
2350 }

Member Function Documentation

◆ dEstroy()

MoFEMErrorCode ConvectiveMassElement::MatShellCtx::dEstroy ( )

Definition at line 2369 of file ConvectiveMassElement.cpp.

2369  {
2371  if (iNitialized) {
2372 
2373  CHKERR VecDestroy(&u);
2374  CHKERR VecDestroy(&Ku);
2375  CHKERR VecDestroy(&v);
2376  CHKERR VecDestroy(&Mv);
2377  CHKERR MatDestroy(&barK);
2378  iNitialized = false;
2379  }
2381 }

◆ iNit()

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

Definition at line 2352 of file ConvectiveMassElement.cpp.

2352  {
2354  if (!iNitialized) {
2355 
2356 #if PETSC_VERSION_GE(3, 5, 3)
2357  CHKERR MatCreateVecs(K, &u, &Ku);
2358  CHKERR MatCreateVecs(M, &v, &Mv);
2359 #else
2360  CHKERR MatGetVecs(K, &u, &Ku);
2361  CHKERR MatGetVecs(M, &v, &Mv);
2362 #endif
2363  CHKERR MatDuplicate(K, MAT_SHARE_NONZERO_PATTERN, &barK);
2364  iNitialized = true;
2365  }
2367 }

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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
ConvectiveMassElement::MatShellCtx::Mv
Vec Mv
Definition: ConvectiveMassElement.hpp:513
ConvectiveMassElement::MatShellCtx::u
Vec u
Definition: ConvectiveMassElement.hpp:513
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
ConvectiveMassElement::MatShellCtx::Ku
Vec Ku
Definition: ConvectiveMassElement.hpp:513
ConvectiveMassElement::MatShellCtx::M
Mat M
Definition: ConvectiveMassElement.hpp:504
ConvectiveMassElement::MatShellCtx::v
Vec v
Definition: ConvectiveMassElement.hpp:513
ConvectiveMassElement::MatShellCtx::K
Mat K
Definition: ConvectiveMassElement.hpp:504
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
ConvectiveMassElement::MatShellCtx::barK
Mat barK
Definition: ConvectiveMassElement.hpp:512
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
ConvectiveMassElement::MatShellCtx::dEstroy
MoFEMErrorCode dEstroy()
Definition: ConvectiveMassElement.cpp:2369
ConvectiveMassElement::MatShellCtx::iNitialized
bool iNitialized
Definition: ConvectiveMassElement.hpp:508