v0.14.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
MoFEM::SnesCtx Struct Reference

Interface for nonlinear (SNES) solver. More...

#include <src/petsc/SnesCtx.hpp>

Collaboration diagram for MoFEM::SnesCtx:
[legend]

Public Types

typedef MoFEM::PairNameFEMethodPtr PairNameFEMethodPtr
 
typedef MoFEM::FEMethodsSequence FEMethodsSequence
 
typedef MoFEM::BasicMethodsSequence BasicMethodsSequence
 

Public Member Functions

 SnesCtx (Interface &m_field, const std::string &problem_name)
 
virtual ~SnesCtx ()=default
 
FEMethodsSequencegetSetOperators ()
 
FEMethodsSequencegetComputeRhs ()
 
BasicMethodsSequencegetPreProcComputeRhs ()
 
BasicMethodsSequencegetPostProcComputeRhs ()
 
BasicMethodsSequencegetPreProcSetOperators ()
 
BasicMethodsSequencegetPostProcSetOperators ()
 
MoFEMErrorCode copyLoops (const SnesCtx &snes_ctx)
 Copy sequences from other SNES contex. More...
 
MoFEMErrorCode clearLoops ()
 Clear loops. More...
 
DEPRECATED FEMethodsSequenceget_loops_to_do_Mat ()
 
DEPRECATED FEMethodsSequenceget_loops_to_do_Rhs ()
 
DEPRECATED BasicMethodsSequenceget_preProcess_to_do_Rhs ()
 
DEPRECATED BasicMethodsSequenceget_postProcess_to_do_Rhs ()
 
DEPRECATED BasicMethodsSequenceget_preProcess_to_do_Mat ()
 
DEPRECATED BasicMethodsSequenceget_postProcess_to_do_Mat ()
 

Public Attributes

MoFEM::InterfacemField
 database Interface More...
 
moab::Interface & moab
 moab Interface More...
 
std::string problemName
 problem name More...
 
MoFEMTypes bH
 If set to MF_EXIST check if element exist, default MF_EXIST. More...
 
bool zeroPreCondMatrixB
 
MatAssemblyType typeOfAssembly
 type of assembly at the end More...
 
bool vErify
 If true verify vector. More...
 
FEMethodsSequence loops_to_do_Mat
 
FEMethodsSequence loops_to_do_Rhs
 
BasicMethodsSequence preProcess_Mat
 
BasicMethodsSequence postProcess_Mat
 
BasicMethodsSequence preProcess_Rhs
 Sequence of methods run before residual is assembled. More...
 
BasicMethodsSequence postProcess_Rhs
 Sequence of methods run after residual is assembled. More...
 

Private Attributes

boost::movelib::unique_ptr< boolvecAssembleSwitch
 
boost::movelib::unique_ptr< boolmatAssembleSwitch
 
PetscLogEvent MOFEM_EVENT_SnesRhs
 Log events to assemble residual. More...
 
PetscLogEvent MOFEM_EVENT_SnesMat
 Log events to assemble tangent matrix. More...
 

Friends

PetscErrorCode SnesRhs (SNES snes, Vec x, Vec f, void *ctx)
 This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver. More...
 
PetscErrorCode SnesMat (SNES snes, Vec x, Mat A, Mat B, void *ctx)
 This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver. More...
 
MoFEMErrorCode SNESMoFEMSetAssmblyType (SNES snes, MatAssemblyType type)
 
MoFEMErrorCode SnesMoFEMSetBehavior (SNES snes, MoFEMTypes bh)
 Set behavior if finite element in sequence does not exist. More...
 

Detailed Description

Interface for nonlinear (SNES) solver.

Examples
testing_jacobian_of_hook_element.cpp, and testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 13 of file SnesCtx.hpp.

Member Typedef Documentation

◆ BasicMethodsSequence

Definition at line 28 of file SnesCtx.hpp.

◆ FEMethodsSequence

Definition at line 27 of file SnesCtx.hpp.

◆ PairNameFEMethodPtr

Definition at line 26 of file SnesCtx.hpp.

Constructor & Destructor Documentation

◆ SnesCtx()

MoFEM::SnesCtx::SnesCtx ( Interface m_field,
const std::string &  problem_name 
)
inline

Definition at line 43 of file SnesCtx.hpp.

44 : mField(m_field), moab(m_field.get_moab()), problemName(problem_name),
46 typeOfAssembly(MAT_FINAL_ASSEMBLY), vErify(false) {
47 PetscLogEventRegister("LoopSNESRhs", 0, &MOFEM_EVENT_SnesRhs);
48 PetscLogEventRegister("LoopSNESMat", 0, &MOFEM_EVENT_SnesMat);
49 if (!LogManager::checkIfChannelExist("SNES_WORLD")) {
50 auto core_log = logging::core::get();
51 core_log->add_sink(
53 LogManager::setLog("SNES_WORLD");
54 MOFEM_LOG_TAG("SNES_WORLD", "SNES");
55 }
56 }
@ MF_EXIST
Definition: definitions.h:100
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:389
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
Definition: LogManager.cpp:298
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:344
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
Definition: LogManager.cpp:399
PetscLogEvent MOFEM_EVENT_SnesMat
Log events to assemble tangent matrix.
Definition: SnesCtx.hpp:158
MoFEMTypes bH
If set to MF_EXIST check if element exist, default MF_EXIST.
Definition: SnesCtx.hpp:20
moab::Interface & moab
moab Interface
Definition: SnesCtx.hpp:16
MatAssemblyType typeOfAssembly
type of assembly at the end
Definition: SnesCtx.hpp:23
bool zeroPreCondMatrixB
Definition: SnesCtx.hpp:21
bool vErify
If true verify vector.
Definition: SnesCtx.hpp:24
std::string problemName
problem name
Definition: SnesCtx.hpp:18
MoFEM::Interface & mField
database Interface
Definition: SnesCtx.hpp:15
PetscLogEvent MOFEM_EVENT_SnesRhs
Log events to assemble residual.
Definition: SnesCtx.hpp:157

◆ ~SnesCtx()

virtual MoFEM::SnesCtx::~SnesCtx ( )
virtualdefault

Member Function Documentation

◆ clearLoops()

MoFEMErrorCode SnesCtx::clearLoops ( )

Clear loops.

Returns
MoFEMErrorCode

Definition at line 16 of file SnesCtx.cpp.

16 {
18 loops_to_do_Mat.clear();
19 loops_to_do_Rhs.clear();
20 preProcess_Mat.clear();
21 postProcess_Mat.clear();
22 preProcess_Rhs.clear();
23 postProcess_Rhs.clear();
25}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
BasicMethodsSequence preProcess_Rhs
Sequence of methods run before residual is assembled.
Definition: SnesCtx.hpp:39
BasicMethodsSequence postProcess_Mat
Definition: SnesCtx.hpp:36
BasicMethodsSequence postProcess_Rhs
Sequence of methods run after residual is assembled.
Definition: SnesCtx.hpp:41
BasicMethodsSequence preProcess_Mat
Definition: SnesCtx.hpp:34
FEMethodsSequence loops_to_do_Mat
Definition: SnesCtx.hpp:30
FEMethodsSequence loops_to_do_Rhs
Definition: SnesCtx.hpp:32

◆ copyLoops()

MoFEMErrorCode SnesCtx::copyLoops ( const SnesCtx snes_ctx)

Copy sequences from other SNES contex.

Parameters
snes_ctxSNES contex from which Sequence is copied from
Returns
error code

Definition at line 5 of file SnesCtx.cpp.

5 {
7 loops_to_do_Mat = snes_ctx.loops_to_do_Mat;
8 loops_to_do_Rhs = snes_ctx.loops_to_do_Rhs;
9 preProcess_Mat = snes_ctx.preProcess_Mat;
10 postProcess_Mat = snes_ctx.postProcess_Mat;
11 preProcess_Rhs = snes_ctx.preProcess_Rhs;
12 postProcess_Rhs = snes_ctx.postProcess_Rhs;
14}

◆ get_loops_to_do_Mat()

DEPRECATED FEMethodsSequence & MoFEM::SnesCtx::get_loops_to_do_Mat ( )
inline
Deprecated:
use getSetOperators

Definition at line 125 of file SnesCtx.hpp.

125 {
126 return getSetOperators();
127 }
FEMethodsSequence & getSetOperators()
Definition: SnesCtx.hpp:64

◆ get_loops_to_do_Rhs()

DEPRECATED FEMethodsSequence & MoFEM::SnesCtx::get_loops_to_do_Rhs ( )
inline
Deprecated:
use getComputeRhs

Definition at line 130 of file SnesCtx.hpp.

130 {
131 return getComputeRhs();
132 }
FEMethodsSequence & getComputeRhs()
Definition: SnesCtx.hpp:69

◆ get_postProcess_to_do_Mat()

DEPRECATED BasicMethodsSequence & MoFEM::SnesCtx::get_postProcess_to_do_Mat ( )
inline
Deprecated:
use getPostProcSetOperators

Definition at line 150 of file SnesCtx.hpp.

150 {
152 }
BasicMethodsSequence & getPostProcSetOperators()
Definition: SnesCtx.hpp:101

◆ get_postProcess_to_do_Rhs()

DEPRECATED BasicMethodsSequence & MoFEM::SnesCtx::get_postProcess_to_do_Rhs ( )
inline
Deprecated:
use getPostProcComputeRhs

Definition at line 140 of file SnesCtx.hpp.

140 {
141 return getPostProcComputeRhs();
142 }
BasicMethodsSequence & getPostProcComputeRhs()
Definition: SnesCtx.hpp:87

◆ get_preProcess_to_do_Mat()

DEPRECATED BasicMethodsSequence & MoFEM::SnesCtx::get_preProcess_to_do_Mat ( )
inline
Deprecated:
use getPreProcSetOperators

Definition at line 145 of file SnesCtx.hpp.

145 {
146 return getPreProcSetOperators();
147 }
BasicMethodsSequence & getPreProcSetOperators()
Definition: SnesCtx.hpp:92

◆ get_preProcess_to_do_Rhs()

DEPRECATED BasicMethodsSequence & MoFEM::SnesCtx::get_preProcess_to_do_Rhs ( )
inline
Deprecated:
use getPreProcComputeRhs

Definition at line 135 of file SnesCtx.hpp.

135 {
136 return getPreProcComputeRhs();
137 }
BasicMethodsSequence & getPreProcComputeRhs()
Definition: SnesCtx.hpp:78

◆ getComputeRhs()

FEMethodsSequence & MoFEM::SnesCtx::getComputeRhs ( )
inline
Returns
return vector to vector with FEMethod to calculate residual

Definition at line 69 of file SnesCtx.hpp.

69{ return loops_to_do_Rhs; }

◆ getPostProcComputeRhs()

BasicMethodsSequence & MoFEM::SnesCtx::getPostProcComputeRhs ( )
inline

The sequence of BasicMethod is executed after residual is calculated. It can be used to setup data structures, e.g. aggregate data from processors or to apply essential boundary conditions.

Returns
reference to BasicMethod for postprocessing

Definition at line 87 of file SnesCtx.hpp.

87{ return postProcess_Rhs; }

◆ getPostProcSetOperators()

BasicMethodsSequence & MoFEM::SnesCtx::getPostProcSetOperators ( )
inline

The sequence of BasicMethod is executed after tangent matrix is calculated. It can be used to setup data structures, e.g. aggregate data from processors or to apply essential boundary conditions.

Returns
reference to BasicMethod for postprocessing

Definition at line 101 of file SnesCtx.hpp.

101{ return postProcess_Mat; }

◆ getPreProcComputeRhs()

BasicMethodsSequence & MoFEM::SnesCtx::getPreProcComputeRhs ( )
inline

The sequence of BasicMethod is executed before residual is calculated. It can be used to setup data structures, e.g. zero global variable which is integrated in domain, e.g. for calculation of strain energy.

Returns
reference to BasicMethod for preprocessing

Definition at line 78 of file SnesCtx.hpp.

78{ return preProcess_Rhs; }

◆ getPreProcSetOperators()

BasicMethodsSequence & MoFEM::SnesCtx::getPreProcSetOperators ( )
inline
Returns
reference to BasicMethod for preprocessing

Definition at line 92 of file SnesCtx.hpp.

92{ return preProcess_Mat; }

◆ getSetOperators()

FEMethodsSequence & MoFEM::SnesCtx::getSetOperators ( )
inline
Returns
return reference to vector with FEMethod to calculate tangent matrix

Definition at line 64 of file SnesCtx.hpp.

64{ return loops_to_do_Mat; }

Friends And Related Function Documentation

◆ SnesMat

PetscErrorCode SnesMat ( SNES  snes,
Vec  x,
Mat  A,
Mat  B,
void *  ctx 
)
friend

This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver.

For more information pleas look to PETSc manual, i.e. SNESSetJacobian http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetJacobian.html#SNESSetJacobian

Parameters
snesSNES solver
xSolution vector at current iteration
ATangent matrix
BPreconditioner tangent matrix
ctxPointer to context i.e. SnesCtx
Returns
Error code

Definition at line 136 of file SnesCtx.cpp.

136 {
137 SnesCtx *snes_ctx = (SnesCtx *)ctx;
138 // PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
140 PetscLogEventBegin(snes_ctx->MOFEM_EVENT_SnesMat, 0, 0, 0, 0);
141 if (snes_ctx->zeroPreCondMatrixB)
142 CHKERR MatZeroEntries(B);
143
144 snes_ctx->matAssembleSwitch = boost::movelib::make_unique<bool>(true);
145 auto cache_ptr = boost::make_shared<CacheTuple>();
146 CHKERR snes_ctx->mField.cache_problem_entities(snes_ctx->problemName,
147 cache_ptr);
148
149 auto set = [&](auto &fe) {
150 fe.snes = snes;
151 fe.snes_x = x;
152 fe.snes_A = A;
153 fe.snes_B = B;
155 fe.ksp_ctx = KspMethod::CTX_OPERATORS;
157 fe.cacheWeakPtr = cache_ptr;
158 };
159
160 auto unset = [&](auto &fe) {
161 fe.snes_ctx = SnesMethod::CTX_SNESNONE;
162 fe.ksp_ctx = KspMethod::CTX_KSPNONE;
163 fe.data_ctx = PetscData::CtxSetNone;
164 };
165
166
167 CHKERR VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
168 CHKERR VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
169 CHKERR snes_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
170 snes_ctx->problemName, COL, x, INSERT_VALUES, SCATTER_REVERSE);
171 for (auto &bit : snes_ctx->preProcess_Mat) {
172 bit->matAssembleSwitch = boost::move(snes_ctx->matAssembleSwitch);
173 set(*bit);
174 CHKERR snes_ctx->mField.problem_basic_method_preProcess(
175 snes_ctx->problemName, *bit);
176 unset(*bit);
177 snes_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
178 }
179
180
181
182 for (auto &lit : snes_ctx->loops_to_do_Mat) {
183 lit.second->matAssembleSwitch = boost::move(snes_ctx->matAssembleSwitch);
184 set(*lit.second);
185 CHKERR snes_ctx->mField.loop_finite_elements(
186 snes_ctx->problemName, lit.first, *(lit.second), nullptr, snes_ctx->bH,
187 cache_ptr);
188 unset(*lit.second);
189 snes_ctx->matAssembleSwitch = boost::move(lit.second->matAssembleSwitch);
190 }
191
192 for (auto &bit : snes_ctx->postProcess_Mat) {
193 bit->matAssembleSwitch = boost::move(snes_ctx->matAssembleSwitch);
194 set(*bit);
195 CHKERR snes_ctx->mField.problem_basic_method_postProcess(
196 snes_ctx->problemName, *bit);
197 unset(*bit);
198 snes_ctx->matAssembleSwitch = boost::move(bit->matAssembleSwitch);
199 }
200
201 if (*snes_ctx->matAssembleSwitch) {
202 CHKERR MatAssemblyBegin(B, snes_ctx->typeOfAssembly);
203 CHKERR MatAssemblyEnd(B, snes_ctx->typeOfAssembly);
204 }
205 PetscLogEventEnd(snes_ctx->MOFEM_EVENT_SnesMat, 0, 0, 0, 0);
207}
@ COL
Definition: definitions.h:123
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
auto bit
set bit
constexpr AssemblyType A
static constexpr Switches CtxSetA
Definition: LoopMethods.hpp:37
static constexpr Switches CtxSetX
Definition: LoopMethods.hpp:39
static constexpr Switches CtxSetNone
Definition: LoopMethods.hpp:35
static constexpr Switches CtxSetB
Definition: LoopMethods.hpp:38

◆ SNESMoFEMSetAssmblyType

MoFEMErrorCode SNESMoFEMSetAssmblyType ( SNES  snes,
MatAssemblyType  type 
)
friend

◆ SnesMoFEMSetBehavior

MoFEMErrorCode SnesMoFEMSetBehavior ( SNES  snes,
MoFEMTypes  bh 
)
friend

Set behavior if finite element in sequence does not exist.

Parameters
snes
bhIf set to MF_EXIST check if element exist, default MF_EXIST. Otherwise set MF_ZERO
Returns
error code

Definition at line 218 of file SnesCtx.cpp.

218 {
219 SnesCtx *snes_ctx;
221 CHKERR SNESGetApplicationContext(snes, &snes_ctx);
222 snes_ctx->bH = bh;
224}

◆ SnesRhs

PetscErrorCode SnesRhs ( SNES  snes,
Vec  x,
Vec  f,
void *  ctx 
)
friend

This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver.

For more information pleas look to PETSc manual, i.e. SNESSetFunction http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetFunction.html

Parameters
snesSNES solver
xSolution vector at current iteration
fThe right hand side vector
ctxPointer to context i.e. SnesCtx
Returns
Error code

Definition at line 27 of file SnesCtx.cpp.

27 {
28 SnesCtx *snes_ctx = (SnesCtx *)ctx;
29 // PetscValidHeaderSpecific(snes,SNES_CLASSID,1);
31 PetscLogEventBegin(snes_ctx->MOFEM_EVENT_SnesRhs, 0, 0, 0, 0);
32 CHKERR VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
33 CHKERR VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
34 if (snes_ctx->vErify) {
35 // Verify finite elements, check for not a number
36 CHKERR VecAssemblyBegin(f);
37 CHKERR VecAssemblyEnd(f);
38 MPI_Comm comm = PetscObjectComm((PetscObject)f);
39 PetscSynchronizedPrintf(comm, "SNES Verify x\n");
40 const Problem *prb_ptr;
41 CHKERR snes_ctx->mField.get_problem(snes_ctx->problemName, &prb_ptr);
42 CHKERR snes_ctx->mField.getInterface<Tools>()->checkVectorForNotANumber(
43 prb_ptr, COL, x);
44 }
45 CHKERR snes_ctx->mField.getInterface<VecManager>()->setLocalGhostVector(
46 snes_ctx->problemName, COL, x, INSERT_VALUES, SCATTER_REVERSE);
47
48 auto zero_ghost_vec = [](Vec g) {
50 Vec l;
51 CHKERR VecGhostGetLocalForm(g, &l);
52 double *a;
53 CHKERR VecGetArray(l, &a);
54 int s;
55 CHKERR VecGetLocalSize(l, &s);
56 for (int i = 0; i != s; ++i)
57 a[i] = 0;
58 CHKERR VecRestoreArray(l, &a);
59 CHKERR VecGhostRestoreLocalForm(g, &l);
61 };
62 CHKERR zero_ghost_vec(f);
63
64 snes_ctx->vecAssembleSwitch = boost::movelib::make_unique<bool>(true);
65 auto cache_ptr = boost::make_shared<CacheTuple>();
66 CHKERR snes_ctx->mField.cache_problem_entities(snes_ctx->problemName,
67 cache_ptr);
68
69 auto set = [&](auto &fe) {
70 fe.snes = snes;
71 fe.snes_x = x;
72 fe.snes_f = f;
74 fe.ksp_ctx = KspMethod::CTX_SETFUNCTION;
76 fe.cacheWeakPtr = cache_ptr;
77 };
78
79 auto unset = [&](auto &fe) {
80 fe.snes_ctx = SnesMethod::CTX_SNESNONE;
81 fe.ksp_ctx = KspMethod::CTX_KSPNONE;
82 fe.data_ctx = PetscData::CtxSetNone;
83 };
84
85 for (auto &bit : snes_ctx->preProcess_Rhs) {
86 bit->vecAssembleSwitch = boost::move(snes_ctx->vecAssembleSwitch);
87 set(*bit);
88 CHKERR snes_ctx->mField.problem_basic_method_preProcess(
89 snes_ctx->problemName, *bit);
90 unset(*bit);
91 snes_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
92 }
93
94 for (auto &lit : snes_ctx->loops_to_do_Rhs) {
95 lit.second->vecAssembleSwitch = boost::move(snes_ctx->vecAssembleSwitch);
96 set(*lit.second);
97 CHKERR snes_ctx->mField.loop_finite_elements(
98 snes_ctx->problemName, lit.first, *lit.second, nullptr, snes_ctx->bH,
99 cache_ptr);
100 unset(*lit.second);
101 if (snes_ctx->vErify) {
102 // Verify finite elements, check for not a number
103 CHKERR VecAssemblyBegin(f);
104 CHKERR VecAssemblyEnd(f);
105 MPI_Comm comm = PetscObjectComm((PetscObject)f);
106 PetscSynchronizedPrintf(comm, "SNES Verify f FE < %s >\n",
107 lit.first.c_str());
108 const Problem *prb_ptr;
109 CHKERR snes_ctx->mField.get_problem(snes_ctx->problemName, &prb_ptr);
110 CHKERR snes_ctx->mField.getInterface<Tools>()->checkVectorForNotANumber(
111 prb_ptr, ROW, f);
112 }
113
114 snes_ctx->vecAssembleSwitch = boost::move(lit.second->vecAssembleSwitch);
115 }
116
117 for (auto &bit : snes_ctx->postProcess_Rhs) {
118 bit->vecAssembleSwitch = boost::move(snes_ctx->vecAssembleSwitch);
119 set(*bit);
120 CHKERR snes_ctx->mField.problem_basic_method_postProcess(
121 snes_ctx->problemName, *bit);
122 unset(*bit);
123 snes_ctx->vecAssembleSwitch = boost::move(bit->vecAssembleSwitch);
124 }
125
126 if (*(snes_ctx->vecAssembleSwitch)) {
127 CHKERR VecGhostUpdateBegin(f, ADD_VALUES, SCATTER_REVERSE);
128 CHKERR VecGhostUpdateEnd(f, ADD_VALUES, SCATTER_REVERSE);
129 CHKERR VecAssemblyBegin(f);
130 CHKERR VecAssemblyEnd(f);
131 }
132 PetscLogEventEnd(snes_ctx->MOFEM_EVENT_SnesRhs, 0, 0, 0, 0);
134}
constexpr double a
@ ROW
Definition: definitions.h:123
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
const FTensor::Tensor2< T, Dim, Dim > Vec
constexpr double g
static constexpr Switches CtxSetF
Definition: LoopMethods.hpp:36

Member Data Documentation

◆ bH

MoFEMTypes MoFEM::SnesCtx::bH

If set to MF_EXIST check if element exist, default MF_EXIST.

Definition at line 20 of file SnesCtx.hpp.

◆ loops_to_do_Mat

FEMethodsSequence MoFEM::SnesCtx::loops_to_do_Mat

Sequence of finite elements instances assembling tangent matrix

Definition at line 30 of file SnesCtx.hpp.

◆ loops_to_do_Rhs

FEMethodsSequence MoFEM::SnesCtx::loops_to_do_Rhs

Sequence of finite elements instances assembling residual vector

Definition at line 32 of file SnesCtx.hpp.

◆ matAssembleSwitch

boost::movelib::unique_ptr<bool> MoFEM::SnesCtx::matAssembleSwitch
private

Definition at line 156 of file SnesCtx.hpp.

◆ mField

MoFEM::Interface& MoFEM::SnesCtx::mField

database Interface

Definition at line 15 of file SnesCtx.hpp.

◆ moab

moab::Interface& MoFEM::SnesCtx::moab

moab Interface

Definition at line 16 of file SnesCtx.hpp.

◆ MOFEM_EVENT_SnesMat

PetscLogEvent MoFEM::SnesCtx::MOFEM_EVENT_SnesMat
private

Log events to assemble tangent matrix.

Definition at line 158 of file SnesCtx.hpp.

◆ MOFEM_EVENT_SnesRhs

PetscLogEvent MoFEM::SnesCtx::MOFEM_EVENT_SnesRhs
private

Log events to assemble residual.

Definition at line 157 of file SnesCtx.hpp.

◆ postProcess_Mat

BasicMethodsSequence MoFEM::SnesCtx::postProcess_Mat

Sequence of methods run after tangent matrix is assembled

Definition at line 36 of file SnesCtx.hpp.

◆ postProcess_Rhs

BasicMethodsSequence MoFEM::SnesCtx::postProcess_Rhs

Sequence of methods run after residual is assembled.

Definition at line 41 of file SnesCtx.hpp.

◆ preProcess_Mat

BasicMethodsSequence MoFEM::SnesCtx::preProcess_Mat

Sequence of methods run before tangent matrix is assembled

Definition at line 34 of file SnesCtx.hpp.

◆ preProcess_Rhs

BasicMethodsSequence MoFEM::SnesCtx::preProcess_Rhs

Sequence of methods run before residual is assembled.

Definition at line 39 of file SnesCtx.hpp.

◆ problemName

std::string MoFEM::SnesCtx::problemName

problem name

Definition at line 18 of file SnesCtx.hpp.

◆ typeOfAssembly

MatAssemblyType MoFEM::SnesCtx::typeOfAssembly

type of assembly at the end

Definition at line 23 of file SnesCtx.hpp.

◆ vecAssembleSwitch

boost::movelib::unique_ptr<bool> MoFEM::SnesCtx::vecAssembleSwitch
private

Definition at line 155 of file SnesCtx.hpp.

◆ vErify

bool MoFEM::SnesCtx::vErify

If true verify vector.

Definition at line 24 of file SnesCtx.hpp.

◆ zeroPreCondMatrixB

bool MoFEM::SnesCtx::zeroPreCondMatrixB

If true zero matrix, otherwise user need to do it, default true

Definition at line 21 of file SnesCtx.hpp.


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