![]() |
v0.15.0 |
Base data structure for PETSc-related contexts. More...
#include "src/interfaces/LoopMethods.hpp"
Public Types | |
| 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_DX = 1 << 4 , CTX_SET_X_T = 1 << 5 , CTX_SET_X_TT = 1 << 6 , CTX_SET_TIME = 1 << 7 } |
| Enumeration for data context flags. More... | |
| using | Switches = std::bitset< 8 > |
| Bitset type for context switches. | |
Public Member Functions | |
| MoFEMErrorCode | query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const |
| Query interface for type casting. | |
| PetscData () | |
| Default constructor. | |
| virtual | ~PetscData ()=default |
| Virtual destructor. | |
| MoFEMErrorCode | copyPetscData (const PetscData &petsc_data) |
| Copy PETSc data from another instance. | |
Public Member Functions inherited from MoFEM::UnknownInterface | |
| template<class IFACE > | |
| MoFEMErrorCode | registerInterface (bool error_if_registration_failed=true) |
| Register interface. | |
| template<class IFACE > | |
| MoFEMErrorCode | getInterface (IFACE *&iface) const |
| Get interface reference to pointer of interface. | |
| template<class IFACE > | |
| MoFEMErrorCode | getInterface (IFACE **const iface) const |
| Get interface pointer to pointer of interface. | |
| template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0> | |
| IFACE | getInterface () const |
| Get interface pointer to pointer of interface. | |
| template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0> | |
| IFACE | getInterface () const |
| Get reference to interface. | |
| template<class IFACE > | |
| IFACE * | getInterface () const |
| Function returning pointer to interface. | |
| virtual | ~UnknownInterface ()=default |
Public Attributes | |
| Switches | data_ctx |
| Current data context switches. | |
| Vec | f |
| PETSc residual vector. | |
| Mat | A |
| PETSc Jacobian matrix. | |
| Mat | B |
| PETSc preconditioner matrix. | |
| Vec | x |
| PETSc solution vector. | |
| Vec | dx |
| PETSc solution increment vector. | |
| Vec | x_t |
| PETSc first time derivative vector. | |
| Vec | x_tt |
| PETSc second time derivative vector. | |
Static Public Attributes | |
| static constexpr Switches | CtxSetNone = PetscData::Switches(CTX_SET_NONE) |
| No data switch. | |
| static constexpr Switches | CtxSetF = PetscData::Switches(CTX_SET_F) |
| Residual vector switch. | |
| static constexpr Switches | CtxSetA = PetscData::Switches(CTX_SET_A) |
| Jacobian matrix switch. | |
| static constexpr Switches | CtxSetB = PetscData::Switches(CTX_SET_B) |
| Preconditioner matrix switch. | |
| static constexpr Switches | CtxSetX = PetscData::Switches(CTX_SET_X) |
| Solution vector switch. | |
| static constexpr Switches | CtxSetDX = PetscData::Switches(CTX_SET_DX) |
| Solution increment switch. | |
| static constexpr Switches | CtxSetX_T = PetscData::Switches(CTX_SET_X_T) |
| First time derivative switch. | |
| static constexpr Switches | CtxSetX_TT = PetscData::Switches(CTX_SET_X_TT) |
| Second time derivative switch. | |
| static constexpr Switches | CtxSetTime = PetscData::Switches(CTX_SET_TIME) |
| Time value switch. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MoFEM::UnknownInterface | |
| static MoFEMErrorCode | getLibVersion (Version &version) |
| Get library version. | |
| static MoFEMErrorCode | getFileVersion (moab::Interface &moab, Version &version) |
| Get database major version. | |
| static MoFEMErrorCode | setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD)) |
| Get database major version. | |
| static MoFEMErrorCode | getInterfaceVersion (Version &version) |
| Get database major version. | |
Base data structure for PETSc-related contexts.
This structure provides a foundation for managing PETSc data objects and contexts used throughout MoFEM finite element computations. It handles vectors, matrices, and context information needed for various PETSc solvers (KSP, SNES, TS, TAO).
Definition at line 66 of file LoopMethods.hpp.
| using MoFEM::PetscData::Switches = std::bitset<8> |
Bitset type for context switches.
Definition at line 106 of file LoopMethods.hpp.
Enumeration for data context flags.
These flags indicate which PETSc data structures are currently set and available for use in computations. Multiple flags can be combined using bitwise operations.
Definition at line 94 of file LoopMethods.hpp.
| MoFEM::PetscData::PetscData | ( | ) |
Default constructor.
Definition at line 27 of file LoopMethods.cpp.
|
virtualdefault |
Virtual destructor.
| MoFEMErrorCode MoFEM::PetscData::copyPetscData | ( | const PetscData & | petsc_data | ) |
Copy PETSc data from another instance.
| petsc_data | Source PETSc data structure |
Definition at line 32 of file LoopMethods.cpp.
|
virtual |
Query interface for type casting.
| type_index | Type information for interface querying |
| iface | Pointer to interface object |
Implements MoFEM::UnknownInterface.
Reimplemented in MoFEM::SnesMethod, MoFEM::TSMethod, and MoFEM::TaoMethod.
Definition at line 21 of file LoopMethods.cpp.
| Mat MoFEM::PetscData::A |
PETSc Jacobian matrix.
Definition at line 128 of file LoopMethods.hpp.
| Mat MoFEM::PetscData::B |
PETSc preconditioner matrix.
Definition at line 129 of file LoopMethods.hpp.
|
staticconstexpr |
Jacobian matrix switch.
Definition at line 110 of file LoopMethods.hpp.
|
staticconstexpr |
Preconditioner matrix switch.
Definition at line 111 of file LoopMethods.hpp.
|
staticconstexpr |
Solution increment switch.
Definition at line 113 of file LoopMethods.hpp.
|
staticconstexpr |
Residual vector switch.
Definition at line 109 of file LoopMethods.hpp.
|
staticconstexpr |
No data switch.
Definition at line 108 of file LoopMethods.hpp.
|
staticconstexpr |
Time value switch.
Definition at line 116 of file LoopMethods.hpp.
|
staticconstexpr |
Solution vector switch.
Definition at line 112 of file LoopMethods.hpp.
|
staticconstexpr |
First time derivative switch.
Definition at line 114 of file LoopMethods.hpp.
|
staticconstexpr |
Second time derivative switch.
Definition at line 115 of file LoopMethods.hpp.
| Switches MoFEM::PetscData::data_ctx |
Current data context switches.
Definition at line 118 of file LoopMethods.hpp.
| Vec MoFEM::PetscData::dx |
PETSc solution increment vector.
Definition at line 131 of file LoopMethods.hpp.
| Vec MoFEM::PetscData::f |
PETSc residual vector.
Definition at line 127 of file LoopMethods.hpp.
| Vec MoFEM::PetscData::x |
PETSc solution vector.
Definition at line 130 of file LoopMethods.hpp.
| Vec MoFEM::PetscData::x_t |
PETSc first time derivative vector.
Definition at line 132 of file LoopMethods.hpp.
| Vec MoFEM::PetscData::x_tt |
PETSc second time derivative vector.
Definition at line 133 of file LoopMethods.hpp.