v0.15.0
Loading...
Searching...
No Matches
LoopMethods.hpp
Go to the documentation of this file.
1/** \file LoopMethods.hpp
2 * \brief MoFEM interface
3 * \author Anonymous author(s) committing under MIT license
4 *
5 * Data structures for making loops over finite elements and entities in the
6 * problem or MoFEM database.
7 *
8 */
9
10#ifndef __LOOPMETHODS_HPP__
11#define __LOOPMETHODS_HPP__
12
13namespace MoFEM {
14struct PetscData : public UnknownInterface {
15
16 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
17 UnknownInterface **iface) const;
18
19 PetscData();
20
21 virtual ~PetscData() = default;
22
25 CTX_SET_F = 1 << 0,
26 CTX_SET_A = 1 << 1,
27 CTX_SET_B = 1 << 2,
28 CTX_SET_X = 1 << 3,
29 CTX_SET_DX = 1 << 4,
30 CTX_SET_X_T = 1 << 5,
31 CTX_SET_X_TT = 1 << 6,
32 CTX_SET_TIME = 1 << 7
33 };
34
35 using Switches = std::bitset<8>;
36
46
48
49 MoFEMErrorCode copyPetscData(const PetscData &petsc_data);
50
51 Vec f;
52 Mat A;
53 Mat B;
54 Vec x;
55 Vec dx;
56 Vec x_t;
57 Vec x_tt;
58};
59
60/**
61 * \brief data structure for ksp (linear solver) context
62 * \ingroup mofem_loops
63 *
64 * Struture stores context data which are set in functions run by PETSc SNES
65 * functions.
66 *
67 */
68struct KspMethod : virtual public PetscData {
69
70 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
71 UnknownInterface **iface) const;
72
73 /**
74 * \brief pass information about context of KSP/DM for with finite element is
75 * computed
76 */
78
79 KspMethod();
80
81 virtual ~KspMethod() = default;
82
83 /**
84 * \brief copy data form another method
85 * @param ksp ksp method
86 * @return error code
87 */
89
90 KSPContext ksp_ctx; ///< Context
91 KSP ksp; ///< KSP solver
92
93 Vec &ksp_f;
94 Mat &ksp_A;
95 Mat &ksp_B;
96};
97
98/**
99 * \brief data structure for snes (nonlinear solver) context
100 * \ingroup mofem_loops
101 *
102 * Structure stores context data which are set in functions run by PETSc SNES
103 * functions.
104 *
105 */
106struct SnesMethod : virtual protected PetscData {
107
108 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
109 UnknownInterface **iface) const;
110
112
113 SnesMethod();
114
115 virtual ~SnesMethod() = default;
116
117 /**
118 * \brief Copy snes data
119 */
121
123
124 SNES snes; ///< snes solver
125 Vec &snes_x; ///< state vector
126 Vec &snes_dx; ///< solution update
127 Vec &snes_f; ///< residual
128 Mat &snes_A; ///< jacobian matrix
129 Mat &snes_B; ///< preconditioner of jacobian matrix
130};
131
132/**
133 * \brief data structure for TS (time stepping) context
134 * \ingroup mofem_loops
135 *
136 * Structure stores context data which are set in functions run by PETSc Time
137 * Stepping functions.
138 */
139struct TSMethod : virtual protected PetscData {
140
141 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
142 UnknownInterface **iface) const;
143
152
153 TSMethod();
154
155 virtual ~TSMethod() = default;
156
157 /// \brief Copy TS solver data
159
160 TS ts; ///< time solver
161
163
164 PetscInt ts_step; ///< time step number
165 PetscReal ts_a; ///< shift for U_t (see PETSc Time Solver)
166 PetscReal ts_aa; ///< shift for U_tt shift for U_tt
167 PetscReal ts_t; ///< time
168 PetscReal ts_dt; ///< time step size
169
170 Vec &ts_u; ///< state vector
171 Vec &ts_u_t; ///< time derivative of state vector
172 Vec &ts_u_tt; ///< second time derivative of state vector
173 Vec &ts_F; ///< residual vector
174
175 Mat &ts_A; ///< Jacobian of G(U) = F(t,U,W+v*U,W'+a*U), equivalent to dF/dU +
176 ///< v*dF/dU_t + a*dF/dU_tt
177 Mat &ts_B; ///< Preconditioner for ts_A
178};
179
180struct TaoMethod : virtual protected PetscData {
181
182 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
183 UnknownInterface **iface) const;
184
191
192 TaoMethod();
193
194 virtual ~TaoMethod() = default;
195
196 /**
197 * \brief Copy TAO data
198 */
200
202
203 Tao tao; ///< tao solver
204 Vec &tao_x; /// state vector
205 Vec &tao_f; /// gradient vector
206 Mat &tao_A; /// hessian matrix
207 Mat &tao_B; /// preconditioner of hessian matrix
208};
209
210/**
211 * \brief Data structure to exchange data between mofem and User Loop Methods.
212 * \ingroup mofem_loops
213 *
214 * It allows to exchange data between MoFEM and user functions. It stores
215 * information about multi-indices.
216 *
217 */
219
220 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
221 UnknownInterface **iface) const {
223 *iface = const_cast<BasicMethod *>(this);
225 }
226
227 BasicMethod();
228 virtual ~BasicMethod() = default;
229
230 /**
231 * @brief number currently of processed method
232 */
234
235 /**
236 * @brief local number oe methods to process
237 */
239
240 /** \brief get number of evaluated element in the loop
241 */
242 inline int getNinTheLoop() const { return nInTheLoop; }
243
244 /** \brief get loop size
245 */
246 inline int getLoopSize() const { return loopSize; }
247
248 /**
249 * @brief Llo and hi processor rank of iterated entities
250 *
251 */
252 std::pair<int, int> loHiFERank;
253
254 /**
255 * @brief Get lo and hi processor rank of iterated entities
256 *
257 * @return raturn std::pair<int, int> loHiFERank
258 */
259 inline auto getLoHiFERank() const { return loHiFERank; }
260
261 /**
262 * @brief Get upper rank in loop for iterating elements
263 *
264 * @return loHiFERank.first
265 */
266 inline auto getLoFERank() const { return loHiFERank.first; }
267
268 /**
269 * @brief Get upper rank in loop for iterating elements
270 *
271 * @return loHiFERank.first
272 */
273 inline auto getHiFERank() const { return loHiFERank.second; }
274
275 int rAnk; ///< processor rank
276
277 int sIze; ///< number of processors in communicator
278
280 *refinedEntitiesPtr; ///< container of mofem dof entities
281
283 *refinedFiniteElementsPtr; ///< container of mofem finite element entities
284
285 const Problem *problemPtr; ///< raw pointer to problem
286
287 const Field_multiIndex *fieldsPtr; ///< raw pointer to fields container
288
290 *entitiesPtr; ///< raw pointer to container of field entities
291
292 const DofEntity_multiIndex *dofsPtr; ///< raw pointer container of dofs
293
295 *finiteElementsPtr; ///< raw pointer to container finite elements
296
298 *finiteElementsEntitiesPtr; ///< raw pointer to container finite elements
299 ///< entities
300
302 *adjacenciesPtr; ///< raw pointer to container to adjacencies between dofs
303 ///< and finite elements
304
305 inline unsigned int getFieldBitNumber(std::string field_name) const {
306 if (fieldsPtr) {
307 auto field_it = fieldsPtr->get<FieldName_mi_tag>().find(field_name);
308 if (field_it != fieldsPtr->get<FieldName_mi_tag>().end())
309 return (*field_it)->getBitNumber();
310 else
311 return BITFEID_SIZE;
312 } else {
313 THROW_MESSAGE("Pointer to fields multi-index is not set");
314 return BITFEID_SIZE;
315 }
316 }
317
318 /**
319 * @brief Copy data from other base method to this base method
320 *
321 * @param basic
322 * @return MoFEMErrorCode
323 */
325
326 /**
327 * @brief Hook function for pre-processing
328 */
329 boost::function<MoFEMErrorCode()> preProcessHook;
330
331 /**
332 * @brief Hook function for post-processing
333 */
334 boost::function<MoFEMErrorCode()> postProcessHook;
335
336 /**
337 * @brief Hook function for operator
338 */
339 boost::function<MoFEMErrorCode()> operatorHook;
340
341 /** \brief function is run at the beginning of loop
342 *
343 * It is used to zeroing matrices and vectors, calculation of shape
344 * functions on reference element, preprocessing boundary conditions, etc.
345 */
346 virtual MoFEMErrorCode preProcess();
347
348 /** \brief function is run for every finite element
349 *
350 * It is used to calculate element local matrices and assembly. It can be
351 * used for post-processing.
352 */
353 virtual MoFEMErrorCode operator()();
354
355 /** \brief function is run at the end of loop
356 *
357 * It is used to assembly matrices and vectors, calculating global variables,
358 * f.e. total internal energy, ect.
359 *
360 * Iterating over dofs:
361 * Example1 iterating over dofs in row by name of the field
362 * for(_IT_GET_FEROW_BY_NAME_DOFS_FOR_LOOP_(this,"DISPLACEMENT",it)) { ... }
363 *
364 *
365 */
366 virtual MoFEMErrorCode postProcess();
367
368 /**
369 * @brief Get the cache weak ptr object
370 *
371 * \note This store problem information on entities about DOFs. Each problem
372 * store different information. If you iterate over finite elements in
373 * preprocessor of TS solve element, us TS cache in the loop. Otherwise you
374 * will create undetermined behaviour or segmentation error. This is necessary
375 * compromise over bug resilience for memory saving and performance.
376 *
377 * @return boost::weak_ptr<CacheTuple>
378 */
379 inline boost::weak_ptr<CacheTuple> getCacheWeakPtr() const {
380 return cacheWeakPtr;
381 }
382
383 boost::movelib::unique_ptr<bool> vecAssembleSwitch;
384 boost::movelib::unique_ptr<bool> matAssembleSwitch;
385
386 boost::weak_ptr<CacheTuple> cacheWeakPtr; // cache pointer entity data
387};
388
389/**
390 * \brief structure for User Loop Methods on finite elements
391 * \ingroup mofem_loops
392 *
393 * It can be used to calculate stiffness matrices, residuals, load vectors etc.
394 * It is low level class however in some class users looking for speed and
395 * efficiency, can use it directly.
396 *
397 * This class is used with Interface::loop_finite_elements, where
398 * user overloaded operator FEMethod::operator() is executed for each element in
399 * the problem. Class have to additional methods which are overloaded by user,
400 * FEMethod::preProcess() and FEMethod::postProcess() executed at beginning and
401 * end of the loop over problem elements, respectively.
402 *
403 */
404struct FEMethod : public BasicMethod {
405
406 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
407 UnknownInterface **iface) const {
409 *iface = const_cast<FEMethod *>(this);
411 }
412
413 FEMethod() = default;
414
415 std::string feName; ///< Name of finite element
416
417 boost::shared_ptr<const NumeredEntFiniteElement>
418 numeredEntFiniteElementPtr; ///< Pointer to finite element database
419 ///< structure
420
421 /**
422 * @brief get finite element name
423 *
424 * @return std::string
425 */
426 inline auto getFEName() const { return feName; }
427
428 /**
429 * @brief Tet if element to skip element
430 *
431 * If is set and return false elemnent us skiped in
432 * MoFEM::Core::loop_finite_elements
433 *
434 * \note That functionality is used to run elements on particular bit levels
435 *
436 */
437 boost::function<bool(FEMethod *fe_method_ptr)> exeTestHook;
438
439 inline auto getDataDofsPtr() const {
440 return numeredEntFiniteElementPtr->getDataDofsPtr();
441 };
442
443 inline auto getDataVectorDofsPtr() const {
444 return numeredEntFiniteElementPtr->getDataVectorDofsPtr();
445 };
446
448 return numeredEntFiniteElementPtr->getDataFieldEnts();
449 }
450
451 inline boost::shared_ptr<FieldEntity_vector_view> &
453 return const_cast<NumeredEntFiniteElement *>(
456 }
457
458 inline auto &getRowFieldEnts() const {
459 return numeredEntFiniteElementPtr->getRowFieldEnts();
460 };
461
462 inline auto &getRowFieldEntsPtr() const {
463 return numeredEntFiniteElementPtr->getRowFieldEntsPtr();
464 };
465
466 inline auto &getColFieldEnts() const {
467 return numeredEntFiniteElementPtr->getColFieldEnts();
468 };
469
470 inline auto &getColFieldEntsPtr() const {
471 return numeredEntFiniteElementPtr->getColFieldEntsPtr();
472 };
473
474 inline auto getRowDofsPtr() const {
475 return numeredEntFiniteElementPtr->getRowDofsPtr();
476 };
477
478 inline auto getColDofsPtr() const {
479 return numeredEntFiniteElementPtr->getColDofsPtr();
480 };
481
482 inline auto getNumberOfNodes() const;
483
484 inline EntityHandle getFEEntityHandle() const;
485
486 MoFEMErrorCode getNodeData(const std::string field_name, VectorDouble &data,
487 const bool reset_dofs = true);
488
489};
490
491inline auto FEMethod::getNumberOfNodes() const {
492 return moab::CN::VerticesPerEntity(numeredEntFiniteElementPtr->getEntType());
493};
494
496 return numeredEntFiniteElementPtr->getEnt();
497}
498
499/**
500 * \brief Data structure to exchange data between mofem and User Loop Methods on
501 * entities. \ingroup mofem_loops
502 *
503 * It allows to exchange data between MoFEM and user functions. It stores
504 * information about multi-indices.
505 */
506struct EntityMethod : public BasicMethod {
507
508 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
509 UnknownInterface **iface) const {
511 *iface = const_cast<EntityMethod *>(this);
513 }
514
515 EntityMethod() = default;
516
517 boost::shared_ptr<Field> fieldPtr;
518 boost::shared_ptr<FieldEntity> entPtr;
519};
520
521/**
522 * \brief Data structure to exchange data between mofem and User Loop Methods on
523 * entities. \ingroup mofem_loops
524 *
525 * It allows to exchange data between MoFEM and user functions. It stores
526 * information about multi-indices.
527 */
528struct DofMethod : public BasicMethod {
529
530 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
531 UnknownInterface **iface) const {
533 *iface = const_cast<DofMethod *>(this);
535 }
536
537 DofMethod() = default;
538
539 boost::shared_ptr<Field> fieldPtr;
540 boost::shared_ptr<DofEntity> dofPtr;
541 boost::shared_ptr<NumeredDofEntity> dofNumeredPtr;
542};
543
544/// \deprecated name changed use DofMethod insead EntMethod
546
547} // namespace MoFEM
548
549#endif // __LOOPMETHODS_HPP__
550
551/**
552 * \defgroup mofem_loops Loops
553 * \ingroup mofem
554 */
multi_index_container< FieldEntityEntFiniteElementAdjacencyMap, indexed_by< ordered_unique< tag< Composite_Unique_mi_tag >, composite_key< FieldEntityEntFiniteElementAdjacencyMap, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getEntUniqueId >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getFeUniqueId > > >, ordered_non_unique< tag< Unique_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getEntUniqueId > >, ordered_non_unique< tag< FE_Unique_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getFeUniqueId > >, ordered_non_unique< tag< FEEnt_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, EntityHandle, &FieldEntityEntFiniteElementAdjacencyMap::getFeHandle > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, EntityHandle, &FieldEntityEntFiniteElementAdjacencyMap::getEntHandle > > > > FieldEntityEntFiniteElementAdjacencyMap_multiIndex
MultiIndex container keeps Adjacencies Element and dof entities adjacencies and vice versa.
multi_index_container< boost::shared_ptr< Field >, indexed_by< hashed_unique< tag< BitFieldId_mi_tag >, const_mem_fun< Field, const BitFieldId &, &Field::getId >, HashBit< BitFieldId >, EqBit< BitFieldId > >, ordered_unique< tag< Meshset_mi_tag >, member< Field, EntityHandle, &Field::meshSet > >, ordered_unique< tag< FieldName_mi_tag >, const_mem_fun< Field, boost::string_ref, &Field::getNameRef > >, ordered_non_unique< tag< BitFieldId_space_mi_tag >, const_mem_fun< Field, FieldSpace, &Field::getSpace > > > > Field_multiIndex
Field_multiIndex for Field.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define DEPRECATED
Definition definitions.h:17
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define BITFEID_SIZE
max number of finite elements
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
multi_index_container< boost::shared_ptr< DofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< DofEntity, UId, &DofEntity::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< DofEntity, EntityHandle, &DofEntity::getEnt > > > > DofEntity_multiIndex
MultiIndex container keeps DofEntity.
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
multi_index_container< boost::shared_ptr< EntFiniteElement >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< EntFiniteElement, UId, &EntFiniteElement::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< EntFiniteElement::interface_type_RefEntity, EntityHandle, &EntFiniteElement::getEnt > > > > EntFiniteElement_multiIndex
MultiIndex container for EntFiniteElement.
multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getEnt > > > > RefElement_multiIndex
multi_index_container< boost::shared_ptr< FiniteElement >, indexed_by< hashed_unique< tag< FiniteElement_Meshset_mi_tag >, member< FiniteElement, EntityHandle, &FiniteElement::meshset > >, hashed_unique< tag< BitFEId_mi_tag >, const_mem_fun< FiniteElement, BitFEId, &FiniteElement::getId >, HashBit< BitFEId >, EqBit< BitFEId > >, ordered_unique< tag< FiniteElement_name_mi_tag >, const_mem_fun< FiniteElement, boost::string_ref, &FiniteElement::getNameRef > > > > FiniteElement_multiIndex
MultiIndex for entities for FiniteElement.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasVector< double > VectorDouble
Definition Types.hpp:68
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
DEPRECATED typedef DofMethod EntMethod
multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, member< FieldEntity, UId, &FieldEntity::localUId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt > > > > FieldEntity_multiIndex
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
constexpr auto field_name
Data structure to exchange data between mofem and User Loop Methods.
int loopSize
local number oe methods to process
boost::movelib::unique_ptr< bool > matAssembleSwitch
const FieldEntity_multiIndex * entitiesPtr
raw pointer to container of field entities
unsigned int getFieldBitNumber(std::string field_name) const
virtual ~BasicMethod()=default
MoFEMErrorCode copyBasicMethod(const BasicMethod &basic)
Copy data from other base method to this base method.
auto getHiFERank() const
Get upper rank in loop for iterating elements.
const FiniteElement_multiIndex * finiteElementsPtr
raw pointer to container finite elements
const RefElement_multiIndex * refinedFiniteElementsPtr
container of mofem finite element entities
int getLoopSize() const
get loop size
std::pair< int, int > loHiFERank
Llo and hi processor rank of iterated entities.
boost::function< MoFEMErrorCode()> preProcessHook
Hook function for pre-processing.
const DofEntity_multiIndex * dofsPtr
raw pointer container of dofs
int rAnk
processor rank
boost::weak_ptr< CacheTuple > getCacheWeakPtr() const
Get the cache weak ptr object.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
const Field_multiIndex * fieldsPtr
raw pointer to fields container
int nInTheLoop
number currently of processed method
auto getLoHiFERank() const
Get lo and hi processor rank of iterated entities.
const RefEntity_multiIndex * refinedEntitiesPtr
container of mofem dof entities
boost::movelib::unique_ptr< bool > vecAssembleSwitch
virtual MoFEMErrorCode postProcess()
function is run at the end of loop
const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * adjacenciesPtr
virtual MoFEMErrorCode operator()()
function is run for every finite element
virtual MoFEMErrorCode preProcess()
function is run at the beginning of loop
const EntFiniteElement_multiIndex * finiteElementsEntitiesPtr
const Problem * problemPtr
raw pointer to problem
auto getLoFERank() const
Get upper rank in loop for iterating elements.
boost::function< MoFEMErrorCode()> operatorHook
Hook function for operator.
int sIze
number of processors in communicator
boost::weak_ptr< CacheTuple > cacheWeakPtr
int getNinTheLoop() const
get number of evaluated element in the loop
boost::function< MoFEMErrorCode()> postProcessHook
Hook function for post-processing.
Data structure to exchange data between mofem and User Loop Methods on entities.
boost::shared_ptr< DofEntity > dofPtr
DofMethod()=default
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
boost::shared_ptr< NumeredDofEntity > dofNumeredPtr
boost::shared_ptr< Field > fieldPtr
Data structure to exchange data between mofem and User Loop Methods on entities.
EntityMethod()=default
boost::shared_ptr< Field > fieldPtr
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
boost::shared_ptr< FieldEntity > entPtr
structure for User Loop Methods on finite elements
std::string feName
Name of finite element.
auto & getColFieldEntsPtr() const
FEMethod()=default
auto & getRowFieldEnts() const
auto getFEName() const
get finite element name
MoFEMErrorCode getNodeData(const std::string field_name, VectorDouble &data, const bool reset_dofs=true)
auto getDataDofsPtr() const
const FieldEntity_vector_view & getDataFieldEnts() const
auto getDataVectorDofsPtr() const
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const
auto getColDofsPtr() const
EntityHandle getFEEntityHandle() const
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
auto & getRowFieldEntsPtr() const
auto getNumberOfNodes() const
auto getRowDofsPtr() const
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
auto & getColFieldEnts() const
boost::function< bool(FEMethod *fe_method_ptr)> exeTestHook
Tet if element to skip element.
MultiIndex Tag for field name.
data structure for ksp (linear solver) context
MoFEMErrorCode copyKsp(const KspMethod &ksp)
copy data form another method
KSPContext ksp_ctx
Context.
virtual ~KspMethod()=default
KSPContext
pass information about context of KSP/DM for with finite element is computed
KSP ksp
KSP solver.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Partitioned (Indexed) Finite Element in Problem.
static constexpr Switches CtxSetA
static constexpr Switches CtxSetX
static constexpr Switches CtxSetX_TT
static constexpr Switches CtxSetNone
static constexpr Switches CtxSetF
std::bitset< 8 > Switches
virtual ~PetscData()=default
static constexpr Switches CtxSetDX
static constexpr Switches CtxSetX_T
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
static constexpr Switches CtxSetB
static constexpr Switches CtxSetTime
MoFEMErrorCode copyPetscData(const PetscData &petsc_data)
keeps basic data about problem
data structure for snes (nonlinear solver) context
MoFEMErrorCode copySnes(const SnesMethod &snes)
Copy snes data.
Vec & snes_f
residual
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Vec & snes_x
state vector
virtual ~SnesMethod()=default
Vec & snes_dx
solution update
Mat & snes_B
preconditioner of jacobian matrix
SNESContext snes_ctx
Mat & snes_A
jacobian matrix
SNES snes
snes solver
data structure for TS (time stepping) context
TS ts
time solver
PetscReal ts_t
time
Vec & ts_F
residual vector
PetscReal ts_dt
time step size
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Vec & ts_u_tt
second time derivative of state vector
PetscReal ts_a
shift for U_t (see PETSc Time Solver)
Vec & ts_u_t
time derivative of state vector
PetscInt ts_step
time step number
Vec & ts_u
state vector
virtual ~TSMethod()=default
PetscReal ts_aa
shift for U_tt shift for U_tt
MoFEMErrorCode copyTs(const TSMethod &ts)
Copy TS solver data.
Mat & ts_B
Preconditioner for ts_A.
Mat & tao_B
hessian matrix
virtual ~TaoMethod()=default
Tao tao
tao solver
Mat & tao_A
gradient vector
MoFEMErrorCode copyTao(const TaoMethod &tao)
Copy TAO data.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Vec & tao_f
state vector
base class for all interface classes
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr()