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

data structure for ksp (linear solver) context More...

#include <src/interfaces/LoopMethods.hpp>

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

Public Types

enum  KSPContext { CTX_SETFUNCTION, CTX_OPERATORS, CTX_KSPNONE }
 pass information about context of KSP/DM for with finite element is computed More...
 
- Public 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 >
 

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 KspMethod ()
 
virtual ~KspMethod ()=default
 
MoFEMErrorCode copyKsp (const KspMethod &ksp)
 copy data form another method More...
 
- Public Member Functions inherited from MoFEM::PetscData
 PetscData ()
 
virtual ~PetscData ()=default
 
MoFEMErrorCode copyPetscData (const PetscData &petsc_data)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface reference 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
 

Public Attributes

KSPContext ksp_ctx
 Context. More...
 
KSP ksp
 KSP solver. More...
 
Vec & ksp_f
 
Mat & ksp_A
 
Mat & ksp_B
 
- Public Attributes inherited from MoFEM::PetscData
Switches data_ctx
 
Vec f
 
Mat A
 
Mat B
 
Vec x
 
Vec x_t
 
Vec x_tt
 

Additional Inherited Members

- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version. More...
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version. More...
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version. More...
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version. More...
 
- Static Public 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 ksp (linear solver) context

Struture stores context data which are set in functions run by PETSc SNES functions.

Definition at line 64 of file LoopMethods.hpp.

Member Enumeration Documentation

◆ KSPContext

pass information about context of KSP/DM for with finite element is computed

Enumerator
CTX_SETFUNCTION 
CTX_OPERATORS 
CTX_KSPNONE 

Definition at line 73 of file LoopMethods.hpp.

Constructor & Destructor Documentation

◆ KspMethod()

MoFEM::KspMethod::KspMethod ( )

Definition at line 51 of file LoopMethods.cpp.

◆ ~KspMethod()

virtual MoFEM::KspMethod::~KspMethod ( )
virtualdefault

Member Function Documentation

◆ copyKsp()

MoFEMErrorCode MoFEM::KspMethod::copyKsp ( const KspMethod ksp)

copy data form another method

Parameters
kspksp method
Returns
error code

Definition at line 55 of file LoopMethods.cpp.

55  {
58  this->ksp_ctx = ksp.ksp_ctx;
59  this->ksp = ksp.ksp;
61 }

◆ query_interface()

MoFEMErrorCode MoFEM::KspMethod::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Reimplemented from MoFEM::PetscData.

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

Definition at line 45 of file LoopMethods.cpp.

46  {
47  *iface = const_cast<KspMethod *>(this);
48  return 0;
49 };

Member Data Documentation

◆ ksp

KSP MoFEM::KspMethod::ksp

KSP solver.

Definition at line 87 of file LoopMethods.hpp.

◆ ksp_A

Mat& MoFEM::KspMethod::ksp_A

Definition at line 90 of file LoopMethods.hpp.

◆ ksp_B

Mat& MoFEM::KspMethod::ksp_B
Examples
analytical_poisson_field_split.cpp.

Definition at line 91 of file LoopMethods.hpp.

◆ ksp_ctx

KSPContext MoFEM::KspMethod::ksp_ctx

Context.

Definition at line 86 of file LoopMethods.hpp.

◆ ksp_f

Vec& MoFEM::KspMethod::ksp_f

Definition at line 89 of file LoopMethods.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
MoFEM::KspMethod::CTX_KSPNONE
@ CTX_KSPNONE
Definition: LoopMethods.hpp:73
MoFEM::KspMethod::ksp_B
Mat & ksp_B
Definition: LoopMethods.hpp:91
MoFEM::PetscData::copyPetscData
MoFEMErrorCode copyPetscData(const PetscData &petsc_data)
Definition: LoopMethods.cpp:31
MoFEM::PetscData::B
Mat B
Definition: LoopMethods.hpp:50
MoFEM::KspMethod::CTX_SETFUNCTION
@ CTX_SETFUNCTION
Definition: LoopMethods.hpp:73
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::PetscData::A
Mat A
Definition: LoopMethods.hpp:49
MoFEM::KspMethod::KspMethod
KspMethod()
Definition: LoopMethods.cpp:51
MoFEM::KspMethod::ksp
KSP ksp
KSP solver.
Definition: LoopMethods.hpp:87
MoFEM::PetscData::f
Vec f
Definition: LoopMethods.hpp:48
MoFEM::KspMethod::ksp_A
Mat & ksp_A
Definition: LoopMethods.hpp:90
MoFEM::KspMethod::ksp_f
Vec & ksp_f
Definition: LoopMethods.hpp:89
MoFEM::KspMethod::CTX_OPERATORS
@ CTX_OPERATORS
Definition: LoopMethods.hpp:73
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::KspMethod::ksp_ctx
KSPContext ksp_ctx
Context.
Definition: LoopMethods.hpp:86