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

data structure for snes (nonlinear solver) contextStructure stores context data which are set in functions run by PETSc SNES functions. 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 (const MOFEMuuid &uuid, UnknownInterface **iface) const
 
 SnesMethod ()
 
virtual ~SnesMethod ()
 
MoFEMErrorCode setSnesCtx (const SNESContext &ctx)
 Set SNES context. More...
 
MoFEMErrorCode setSnes (SNES snes)
 Set SNES instance. More...
 
MoFEMErrorCode copySnes (const SnesMethod &snes)
 Copy snes data. More...
 
- Public Member Functions inherited from MoFEM::UnknownInterface
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 ()
 
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
 

Public Attributes

SNESContext snes_ctx
 
SNES snes
 
Vec snes_x
 
Vec snes_f
 
Mat snes_A
 
Mat snes_B
 

Additional Inherited Members

- 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...
 

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 105 of file LoopMethods.hpp.

Member Enumeration Documentation

◆ SNESContext

Constructor & Destructor Documentation

◆ SnesMethod()

MoFEM::SnesMethod::SnesMethod ( )

Definition at line 119 of file LoopMethods.hpp.

120  : snes_ctx(CTX_SNESNONE), snes_x(PETSC_NULL), snes_f(PETSC_NULL),
121  snes_A(PETSC_NULL), snes_B(PETSC_NULL) {}
SNESContext snes_ctx

◆ ~SnesMethod()

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

Definition at line 123 of file LoopMethods.hpp.

123 {}

Member Function Documentation

◆ copySnes()

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

Copy snes data.

Definition at line 53 of file LoopMethods.cpp.

53  {
55  this->snes_ctx = snes.snes_ctx;
56  this->snes = snes.snes;
57  this->snes_x = snes.snes_x;
58  this->snes_f = snes.snes_f;
59  this->snes_A = snes.snes_A;
60  this->snes_B = snes.snes_B;
62 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490
SNESContext snes_ctx

◆ query_interface()

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

Implements MoFEM::UnknownInterface.

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

Definition at line 107 of file LoopMethods.hpp.

108  {
109  if (uuid == IDD_MOFEMSnesMethod) {
110  *iface = const_cast<SnesMethod *>(this);
112  }
113  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
114  }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490
static const MOFEMuuid IDD_MOFEMSnesMethod
Definition: LoopMethods.hpp:26

◆ setSnes()

MoFEMErrorCode MoFEM::SnesMethod::setSnes ( SNES  snes)

Set SNES instance.

Definition at line 48 of file LoopMethods.cpp.

48  {
50  snes = _snes;
52 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

◆ setSnesCtx()

MoFEMErrorCode MoFEM::SnesMethod::setSnesCtx ( const SNESContext ctx)

Set SNES context.

Definition at line 43 of file LoopMethods.cpp.

43  {
45  snes_ctx = ctx;
47 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490
SNESContext snes_ctx

Member Data Documentation

◆ snes

SNES MoFEM::SnesMethod::snes

Definition at line 140 of file LoopMethods.hpp.

◆ snes_A

Mat MoFEM::SnesMethod::snes_A

Definition at line 142 of file LoopMethods.hpp.

◆ snes_B

Mat MoFEM::SnesMethod::snes_B
Examples:
analytical_poisson_field_split.cpp.

Definition at line 142 of file LoopMethods.hpp.

◆ snes_ctx

SNESContext MoFEM::SnesMethod::snes_ctx

Definition at line 118 of file LoopMethods.hpp.

◆ snes_f

Vec MoFEM::SnesMethod::snes_f

Definition at line 141 of file LoopMethods.hpp.

◆ snes_x

Vec MoFEM::SnesMethod::snes_x

Definition at line 141 of file LoopMethods.hpp.


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