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

data structure for snes (nonlinear solver) context More...

#include <src/interfaces/LoopMethods.hpp>

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

Public Types

enum  SNESContext { CTX_SNESSETFUNCTION, CTX_SNESSETJACOBIAN, CTX_SNESNONE }
 

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 SnesMethod ()
 
virtual ~SnesMethod ()=default
 
MoFEMErrorCode copySnes (const SnesMethod &snes)
 Copy snes data. More...
 

Public Attributes

SNESContext snes_ctx
 
SNES snes
 snes solver More...
 
Vec & snes_x
 state vector More...
 
Vec & snes_f
 residual More...
 
Mat & snes_A
 jacobian matrix More...
 
Mat & snes_B
 preconditioner of jacobian matrix 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
 
MoFEMErrorCode copyPetscData (const PetscData &petsc_data)
 
- Protected 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
 
- Static Protected 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...
 
- 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 snes (nonlinear solver) context

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

Definition at line 102 of file LoopMethods.hpp.

Member Enumeration Documentation

◆ SNESContext

Enumerator
CTX_SNESSETFUNCTION 
CTX_SNESSETJACOBIAN 
CTX_SNESNONE 

Definition at line 107 of file LoopMethods.hpp.

Constructor & Destructor Documentation

◆ SnesMethod()

MoFEM::SnesMethod::SnesMethod ( )

◆ ~SnesMethod()

virtual MoFEM::SnesMethod::~SnesMethod ( )
virtualdefault

Member Function Documentation

◆ copySnes()

MoFEMErrorCode MoFEM::SnesMethod::copySnes ( const SnesMethod snes)

Copy snes data.

Definition at line 75 of file LoopMethods.cpp.

75  {
78  this->snes_ctx = snes.snes_ctx;
79  this->snes = snes.snes;
81 }

◆ query_interface()

MoFEMErrorCode MoFEM::SnesMethod::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 65 of file LoopMethods.cpp.

66  {
67  *iface = const_cast<SnesMethod *>(this);
68  return 0;
69 }

Member Data Documentation

◆ snes

SNES MoFEM::SnesMethod::snes

snes solver

Definition at line 120 of file LoopMethods.hpp.

◆ snes_A

Mat& MoFEM::SnesMethod::snes_A

jacobian matrix

Definition at line 123 of file LoopMethods.hpp.

◆ snes_B

Mat& MoFEM::SnesMethod::snes_B

preconditioner of jacobian matrix

Examples
analytical_poisson_field_split.cpp.

Definition at line 124 of file LoopMethods.hpp.

◆ snes_ctx

SNESContext MoFEM::SnesMethod::snes_ctx
Examples
nonlinear_dynamics.cpp.

Definition at line 118 of file LoopMethods.hpp.

◆ snes_f

Vec& MoFEM::SnesMethod::snes_f

residual

Definition at line 122 of file LoopMethods.hpp.

◆ snes_x

Vec& MoFEM::SnesMethod::snes_x

state vector

Definition at line 121 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::PetscData::x
Vec x
Definition: LoopMethods.hpp:51
MoFEM::PetscData::copyPetscData
MoFEMErrorCode copyPetscData(const PetscData &petsc_data)
Definition: LoopMethods.cpp:31
MoFEM::SnesMethod::snes_x
Vec & snes_x
state vector
Definition: LoopMethods.hpp:121
MoFEM::SnesMethod::snes_ctx
SNESContext snes_ctx
Definition: LoopMethods.hpp:118
MoFEM::SnesMethod::snes_B
Mat & snes_B
preconditioner of jacobian matrix
Definition: LoopMethods.hpp:124
MoFEM::PetscData::B
Mat B
Definition: LoopMethods.hpp:50
MoFEM::SnesMethod::snes_A
Mat & snes_A
jacobian matrix
Definition: LoopMethods.hpp:123
MoFEM::SnesMethod::CTX_SNESSETJACOBIAN
@ CTX_SNESSETJACOBIAN
Definition: LoopMethods.hpp:107
MoFEM::SnesMethod::CTX_SNESSETFUNCTION
@ CTX_SNESSETFUNCTION
Definition: LoopMethods.hpp:107
MoFEM::SnesMethod::snes
SNES snes
snes solver
Definition: LoopMethods.hpp:120
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::SnesMethod::CTX_SNESNONE
@ CTX_SNESNONE
Definition: LoopMethods.hpp:107
MoFEM::PetscData::A
Mat A
Definition: LoopMethods.hpp:49
MoFEM::PetscData::f
Vec f
Definition: LoopMethods.hpp:48
MoFEM::SnesMethod::snes_f
Vec & snes_f
residual
Definition: LoopMethods.hpp:122
MoFEM::SnesMethod::SnesMethod
SnesMethod()
Definition: LoopMethods.cpp:71
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453