v0.9.1
Public Types | Public Member Functions | Public Attributes | List of all members
MoFEM::TSMethod Struct Reference

data structure for TS (time stepping) contextStructure stores context data which are set in functions run by PETSc Time Stepping functions. More...

#include <src/interfaces/LoopMethods.hpp>

Inheritance diagram for MoFEM::TSMethod:
[legend]
Collaboration diagram for MoFEM::TSMethod:
[legend]

Public Types

enum  TSContext {
  CTX_TSSETRHSFUNCTION, CTX_TSSETRHSJACOBIAN, CTX_TSSETIFUNCTION, CTX_TSSETIJACOBIAN,
  CTX_TSTSMONITORSET, CTX_TSNONE
}
 

Public Member Functions

MoFEMErrorCode query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const
 
 TSMethod ()
 
virtual ~TSMethod ()=default
 
MoFEMErrorCode copyTs (const TSMethod &ts)
 Copy TS solver data. More...
 
DEPRECATED MoFEMErrorCode setTsCtx (TSContext ctx)
 

Public Attributes

TS ts
 time solver More...
 
TSContext ts_ctx
 
PetscInt ts_step
 time step More...
 
PetscReal ts_a
 shift for U_tt (see PETSc Time Solver) More...
 
PetscReal ts_v
 shift for U_t shift for U_t More...
 
PetscReal ts_t
 time More...
 
Vec & ts_u
 state vector More...
 
Vec & ts_u_t
 time derivative of state vector More...
 
Vec & ts_u_tt
 second time derivative of state vector More...
 
Vec & ts_F
 residual vector More...
 
Mat & ts_A
 
Mat & ts_B
 Preconditioner for ts_A. More...
 

Additional Inherited Members

- Protected Types inherited from MoFEM::PetscData
enum  DataContext {
  CTX_SET_NONE = 0, CTX_SET_F = 1 << 0, CTX_SET_A = 1 << 1, CTX_SET_B = 1 << 2,
  CTX_SET_X = 1 << 3, CTX_SET_X_T = 1 << 4, CTX_SET_X_TT = 1 << 6, CTX_SET_TIME = 1 << 7
}
 
using Switches = std::bitset< 8 >
 
- Protected Member Functions inherited from MoFEM::PetscData
 PetscData ()
 
virtual ~PetscData ()=default
 
- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. More...
 
template<class IFACE >
MoFEMErrorCode registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 
- Protected Attributes inherited from MoFEM::PetscData
Switches data_ctx
 
Vec f
 
Mat A
 
Mat B
 
Vec x
 
Vec x_t
 
Vec x_tt
 
- Static Protected Attributes inherited from MoFEM::PetscData
static constexpr Switches CtxSetNone = PetscData::Switches(CTX_SET_NONE)
 
static constexpr Switches CtxSetF = PetscData::Switches(CTX_SET_F)
 
static constexpr Switches CtxSetA = PetscData::Switches(CTX_SET_A)
 
static constexpr Switches CtxSetB = PetscData::Switches(CTX_SET_B)
 
static constexpr Switches CtxSetX = PetscData::Switches(CTX_SET_X)
 
static constexpr Switches CtxSetX_T = PetscData::Switches(CTX_SET_X_T)
 
static constexpr Switches CtxSetX_TT = PetscData::Switches(CTX_SET_X_TT)
 
static constexpr Switches CtxSetTime = PetscData::Switches(CTX_SET_TIME)
 

Detailed Description

data structure for TS (time stepping) context

Structure stores context data which are set in functions run by PETSc Time Stepping functions.

Definition at line 167 of file LoopMethods.hpp.

Member Enumeration Documentation

◆ TSContext

Enumerator
CTX_TSSETRHSFUNCTION 
CTX_TSSETRHSJACOBIAN 
CTX_TSSETIFUNCTION 
CTX_TSSETIJACOBIAN 
CTX_TSTSMONITORSET 
CTX_TSNONE 

Definition at line 172 of file LoopMethods.hpp.

Constructor & Destructor Documentation

◆ TSMethod()

MoFEM::TSMethod::TSMethod ( )

Definition at line 105 of file LoopMethods.cpp.

106  : ts_ctx(CTX_TSNONE), ts_step(-1), ts_a(0), ts_t(0), ts_u(PetscData::x),
Mat & ts_B
Preconditioner for ts_A.
PetscReal ts_t
time
Vec & ts_u_t
time derivative of state vector
PetscReal ts_a
shift for U_tt (see PETSc Time Solver)
PetscInt ts_step
time step
Vec & ts_F
residual vector
Vec & ts_u
state vector
TSContext ts_ctx
Vec & ts_u_tt
second time derivative of state vector

◆ ~TSMethod()

virtual MoFEM::TSMethod::~TSMethod ( )
virtualdefault

Member Function Documentation

◆ copyTs()

MoFEMErrorCode MoFEM::TSMethod::copyTs ( const TSMethod ts)

Copy TS solver data.

Definition at line 110 of file LoopMethods.cpp.

110  {
112  this->ts_ctx = ts.ts_ctx;
113  this->ts = ts.ts;
114  this->ts_u = ts.ts_u;
115  this->ts_u_t = ts.ts_u_t;
116  this->ts_u_tt = ts.ts_u_tt;
117  this->ts_F = ts.ts_F;
118  this->ts_A = ts.ts_A;
119  this->ts_B = ts.ts_B;
120  this->ts_step = ts.ts_step;
121  this->ts_a = ts.ts_a;
122  this->ts_t = ts.ts_t;
124 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
Mat & ts_B
Preconditioner for ts_A.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
PetscReal ts_t
time
Vec & ts_u_t
time derivative of state vector
PetscReal ts_a
shift for U_tt (see PETSc Time Solver)
PetscInt ts_step
time step
TS ts
time solver
Vec & ts_F
residual vector
Vec & ts_u
state vector
TSContext ts_ctx
Vec & ts_u_tt
second time derivative of state vector

◆ query_interface()

MoFEMErrorCode MoFEM::TSMethod::query_interface ( const MOFEMuuid uuid,
UnknownInterface **  iface 
) const
virtual

Reimplemented from MoFEM::PetscData.

Reimplemented in MoFEM::DofMethod, MoFEM::EntityMethod, MoFEM::FEMethod, and MoFEM::BasicMethod.

Definition at line 96 of file LoopMethods.cpp.

97  {
98  if (uuid == IDD_MOFEMTsMethod) {
99  *iface = const_cast<TSMethod *>(this);
101  }
102  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
103  }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
static const MOFEMuuid IDD_MOFEMTsMethod
Definition: LoopMethods.hpp:30

◆ setTsCtx()

MoFEMErrorCode MoFEM::TSMethod::setTsCtx ( TSContext  ctx)
Deprecated:
Avoid using values by hand.

Definition at line 212 of file LoopMethods.hpp.

212  {
213  ts_ctx = ctx;
214  return 0;
215 }
TSContext ts_ctx

Member Data Documentation

◆ ts

TS MoFEM::TSMethod::ts

time solver

Examples
UnsaturatedFlow.hpp.

Definition at line 188 of file LoopMethods.hpp.

◆ ts_a

PetscReal MoFEM::TSMethod::ts_a

shift for U_tt (see PETSc Time Solver)

Examples
UnsaturatedFlow.hpp.

Definition at line 198 of file LoopMethods.hpp.

◆ ts_A

Mat& MoFEM::TSMethod::ts_A

Jacobian of G(U) = F(t,U,W+v*U,W'+a*U), equivalent to dF/dU + v*dF/dU_t + a*dF/dU_tt

Definition at line 207 of file LoopMethods.hpp.

◆ ts_B

Mat& MoFEM::TSMethod::ts_B

Preconditioner for ts_A.

Examples
UnsaturatedFlow.hpp.

Definition at line 209 of file LoopMethods.hpp.

◆ ts_ctx

TSContext MoFEM::TSMethod::ts_ctx

Definition at line 190 of file LoopMethods.hpp.

◆ ts_F

Vec& MoFEM::TSMethod::ts_F

residual vector

Examples
UnsaturatedFlow.hpp.

Definition at line 205 of file LoopMethods.hpp.

◆ ts_step

PetscInt MoFEM::TSMethod::ts_step

time step

Definition at line 197 of file LoopMethods.hpp.

◆ ts_t

PetscReal MoFEM::TSMethod::ts_t

time

Examples
UnsaturatedFlow.hpp.

Definition at line 200 of file LoopMethods.hpp.

◆ ts_u

Vec& MoFEM::TSMethod::ts_u

state vector

Definition at line 202 of file LoopMethods.hpp.

◆ ts_u_t

Vec& MoFEM::TSMethod::ts_u_t

time derivative of state vector

Definition at line 203 of file LoopMethods.hpp.

◆ ts_u_tt

Vec& MoFEM::TSMethod::ts_u_tt

second time derivative of state vector

Definition at line 204 of file LoopMethods.hpp.

◆ ts_v

PetscReal MoFEM::TSMethod::ts_v

shift for U_t shift for U_t

Definition at line 199 of file LoopMethods.hpp.


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