v0.15.0
Loading...
Searching...
No Matches
Simple.hpp
Go to the documentation of this file.
1/** \file Simple.hpp
2 * \brief Header file for simple interface
3 * \ingroup mofem_simple_interface
4 *
5 * Make simplified interface, to speedup problem setup and analysts.
6 * See discussion here
7 * <a
8 * href=https://groups.google.com/d/msg/mofem-group/Vkc00aia4dU/o9RF3ZmPAAAJ>link
9 * to google groups</a>
10 *
11 */
12
13#ifndef __SIMPLE_HPP__
14#define __SIMPLE_HPP__
15
16#include "UnknownInterface.hpp"
17
18namespace MoFEM {
19
20template <int DIM> struct ParentFiniteElementAdjacencyFunction;
22
23/**
24 * \brief Simple interface for fast problem set-up
25 * \ingroup mofem_simple_interface
26 */
27struct Simple : public UnknownInterface {
28
29 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
30 UnknownInterface **iface) const;
31
32 Simple(const MoFEM::Core &core);
33 virtual ~Simple() = default;
34
35 /**
36 * \brief get options
37 * @return error code
38 */
40
41 typedef boost::function<MoFEMErrorCode(Interface &, const char *,
42 const char *)>
44 /**
45 * \brief Set function for loading mesh file
46 * @param m_field interface
47 * @param file_name file name
48 * @param options loader options
49 * @return error code
50 */
52 const char *file_name,
53 const char *options) {
54 // Default behavior using the member moab.load_file
55 return m_field.get_moab().load_file(file_name, 0, options);
56 }
57
58 /**
59 * \brief Load mesh file
60 * @param options file load options
61 * @param mesh_file_name file name if not set default or set by command line
62 * @param loadFunc function for loading mesh file
63 * is used.
64 *
65 * \note If bitRefLevel is set to any, bit ref level of loaded entities is not
66 * changed. After mesh is load, bit ref level should be set to create problem.
67 * Default setting of bit ref level is on first bit, and if is set all mesh
68 * entities on load are set to set level.
69 *
70 * @return error code
71 */
72 MoFEMErrorCode loadFile(const std::string options,
73 const std::string mesh_file_name,
75 /**
76 * \brief Load mesh file with parallel options if number of cores > 1
77 * @param mesh_file_name file name if not set default or set by command line
78 * is used.
79 * @return error code
80 */
81 MoFEMErrorCode loadFile(const std::string mesh_file_name = "");
82
83 /**
84 * \brief Add field on domain
85 * @param name name of the field
86 * @param space space (L2,H1,Hdiv,Hcurl)
87 * @param base approximation base, see FieldApproximationBase
88 * @param nb_of_coefficients number of field coefficients
89 * @param tag_type type of the tag MB_TAG_DENSE or MB_TAG_SPARSE
90 * (DENSE is faster and uses less memory, SPARSE is more flexible if you
91 * define field on subdomains)
92 * @param bh if MF_EXCL throws error if field exits, MF_ZERO
93 * no error if field exist
94 * @param verb verbosity level
95 * @return error code
96 */
98 addDomainField(const std::string name, const FieldSpace space,
99 const FieldApproximationBase base,
100 const FieldCoefficientsNumber nb_of_coefficients,
101 const TagType tag_type = MB_TAG_SPARSE,
102 const enum MoFEMTypes bh = MF_ZERO, int verb = -1);
103
104 /**
105 * \brief Add broken field on domain
106 * @param name name of the field
107 * @param space space (L2,H1,Hdiv,Hcurl)
108 * @param base approximation base, see FieldApproximationBase
109 * @param nb_of_coefficients number of field coefficients
110 * @param tag_type type of the tag MB_TAG_DENSE or MB_TAG_SPARSE
111 * (DENSE is faster and uses less memory, SPARSE is more flexible if you
112 * define field on subdomains)
113 * @param bh if MF_EXCL throws error if field exits, MF_ZERO
114 * no error if field exist
115 * @param verb verbosity level
116 * @return error code
117 */
119 addDomainBrokenField(const std::string name, const FieldSpace space,
120 const FieldApproximationBase base,
121 const FieldCoefficientsNumber nb_of_coefficients,
122 const TagType tag_type = MB_TAG_SPARSE,
123 const enum MoFEMTypes bh = MF_ZERO, int verb = -1);
124
125 /**
126 * \brief Add field on boundary
127 * @param name name of the field
128 * @param space space (L2,H1,Hdiv,Hcurl)
129 * @param base approximation base, see FieldApproximationBase
130 * @param nb_of_coefficients number of field coefficients
131 * @param tag_type type of the tag MB_TAG_DENSE or MB_TAG_SPARSE
132 * (DENSE is faster and uses less memory, SPARSE is more flexible if you
133 * define field on subdomains)
134 * @param bh if MF_EXCL throws error if field exits, MF_ZERO
135 * no error if field exist
136 * @param verb verbosity level
137 * @return error code
138 */
140 addBoundaryField(const std::string name, const FieldSpace space,
141 const FieldApproximationBase base,
142 const FieldCoefficientsNumber nb_of_coefficients,
143 const TagType tag_type = MB_TAG_SPARSE,
144 const enum MoFEMTypes bh = MF_ZERO, int verb = -1);
145
146 /**
147 * \brief Add field on skeleton
148 * @param name name of the field
149 * @param space space (L2,H1,Hdiv,Hcurl)
150 * @param base approximation base, see FieldApproximationBase
151 * @param nb_of_coefficients number of field coefficients
152 * @param tag_type type of the tag MB_TAG_DENSE or MB_TAG_SPARSE
153 * (DENSE is faster and uses less memory, SPARSE is more flexible if you
154 * define field on subdomains)
155 * @param bh if MF_EXCL throws error if field exits, MF_ZERO
156 * no error if field exist
157 * @param verb verbosity level
158 * @return error code
159 */
161 addSkeletonField(const std::string name, const FieldSpace space,
162 const FieldApproximationBase base,
163 const FieldCoefficientsNumber nb_of_coefficients,
164 const TagType tag_type = MB_TAG_SPARSE,
165 const enum MoFEMTypes bh = MF_ZERO, int verb = -1);
166
167 /**
168 * \brief Add field on domain
169 * @param name name of the field
170 * @param space space (L2,H1,Hdiv,Hcurl)
171 * @param base approximation base, see FieldApproximationBase
172 * @param nb_of_coefficients number of field coefficients
173 * @param tag_type type of the tag MB_TAG_DENSE or MB_TAG_SPARSE
174 * (DENSE is faster and uses less memory, SPARSE is more flexible if you
175 * define field on subdomains)
176 * @param bh if MF_EXCL throws error if field exits, MF_ZERO
177 * no error if field exist
178 * @param verb verbosity level
179 * @return error code
180 */
181 MoFEMErrorCode addDataField(const std::string name, const FieldSpace space,
182 const FieldApproximationBase base,
183 const FieldCoefficientsNumber nb_of_coefficients,
184 const TagType tag_type = MB_TAG_SPARSE,
185 const enum MoFEMTypes bh = MF_ZERO,
186 int verb = -1);
187
188 /**
189 * @brief Add meshset field
190 *
191 * Add fields managed by meshset finite element
192 *
193 * @param name
194 * @param space
195 * @param base
196 * @param nb_of_coefficients
197 * @param tag_type
198 * @param bh
199 * @param verb
200 * @return MoFEMErrorCode
201 */
203 addMeshsetField(const std::string name, const FieldSpace space,
204 const FieldApproximationBase base,
205 const FieldCoefficientsNumber nb_of_coefficients,
206 const TagType tag_type = MB_TAG_SPARSE,
207 const enum MoFEMTypes bh = MF_ZERO, int verb = -1);
208
209 /**
210 * @brief Remove field form domain
211 *
212 * @param name
213 * @return MoFEMErrorCode
214 */
215 MoFEMErrorCode removeDomainField(const std::string name);
216
217 /**
218 * @brief Remove field form boundary
219 *
220 * @param name
221 * @return MoFEMErrorCode
222 */
223 MoFEMErrorCode removeBoundaryField(const std::string name);
224
225 /**
226 * @brief Remove field form skeleton
227 *
228 * @param name
229 * @return MoFEMErrorCode
230 */
231 MoFEMErrorCode removeSkeletonField(const std::string name);
232
233 /**
234 * \brief Define finite elements
235 * @return Error code
236 */
238
239 /**
240 * \brief define problem
241 * @return error code
242 */
243 MoFEMErrorCode defineProblem(const PetscBool is_partitioned = PETSC_TRUE);
244
245 /**
246 * \brief Set field order
247 * @param std::field_name field name
248 * @param order order
249 * @param range of entities to which order is set (If null it sat to all
250 * entities)
251 * @return error code
252 */
253 MoFEMErrorCode setFieldOrder(const std::string field_name, const int order,
254 const Range *ents = NULL);
255
256 /**
257 * \brief Build fields
258 * @return error code
259 */
261
262 /**
263 * \brief Build finite elements
264 * @return error code
265 */
267
268 /**
269 * @brief Set the skeleton adjacency object
270 *
271 * @param dim
272 * @param fe_name
273 * @return MoFEMErrorCode
274 */
275 MoFEMErrorCode setSkeletonAdjacency(int dim = -1, std::string fe_name = "");
276
277 /**
278 * \brief Build problem
279 * @return error code
280 */
282
283 /**
284 * \brief Setup problem
285 * @return error code
286 */
287 MoFEMErrorCode setUp(const PetscBool is_partitioned = PETSC_TRUE);
288
289 /**
290 * @brief Rebuild internal MoFEM data structures
291 *
292 * Call this function after you add field or remove it.
293 *
294 * \note If you add field, or remove it, finite element and problem needs to
295 * be rebuild. However DM can remain the same.
296 *
297 * @return MoFEMErrorCode
298 */
299 MoFEMErrorCode reSetUp(bool only_dm = false);
300
301 /**
302 * \brief Get DM
303 * @param dm discrete manager
304 * @return error code
305 */
306 MoFEMErrorCode getDM(DM *dm);
307
308 /**
309 * @brief Return smart DM object
310 *
311 * \code
312 * {
313 * auto dm = simple_interface->getDM();
314 *
315 * // ...
316 *
317 * // dm is automatically destroyed when out of the scope
318 * }
319 * \endcode
320 *
321 * @return SmartPetscObj<DM>
322 */
323 inline SmartPetscObj<DM> getDM() { return dM; }
324
325 /**
326 * @brief Get the problem dimension
327 *
328 * Problem dimension is determined by highest dimension of entities on the
329 * mesh.
330 *
331 * @return int
332 */
333 inline int getDim() const { return dIm; }
334
335 /**
336 * @brief Set the problem dimension
337 *
338 * @return int
339 */
340 void setDim(int dim) { dIm = dim; };
341
342 /**
343 * @deprecated Use getMeshset
344 *
345 * @return EntityHandle&
346 */
348
349 /**
350 * @brief Get the MeshSet object
351 *
352 * @return EntityHandle&
353 */
354 inline EntityHandle &getMeshset() { return meshSet; }
355
356 /**
357 * @brief Get the BoundaryMeshSet object
358 *
359 * @return EntityHandle&
360 */
362
363 /**
364 * @brief Get the SkeletonMeshSet object
365 *
366 * @return EntityHandle&
367 */
369
370 /**
371 * @brief Get the BitRefLevel
372 *
373 * @return BitRefLevel
374 */
375 inline BitRefLevel &getBitRefLevel() { return bitLevel; }
376
377 /**
378 * @brief Get the BitRefLevel
379 *
380 * @return BitRefLevel
381 */
383
384 /**
385 * @brief Get the Domain FE Name
386 *
387 * @return const std::string
388 */
389 inline const std::string getDomainFEName() const { return domainFE; }
390
391 /**
392 * @brief Get the Boundary FE Name
393 *
394 * @return const std::string
395 */
396 inline const std::string getBoundaryFEName() const { return boundaryFE; }
397
398 /**
399 * @brief Get the Skeleton FE Name
400 *
401 * @return const std::string
402 */
403 inline const std::string getSkeletonFEName() const { return skeletonFE; }
404
405 /**
406 * @brief Get the Problem Name
407 *
408 * @return const std::string
409 */
410 inline const std::string getProblemName() const { return nameOfProblem; }
411
412 /**
413 * @brief Get the Domain FE Name
414 *
415 * @return std::string&
416 */
417 inline std::string &getDomainFEName() { return domainFE; }
418
419 /**
420 * @brief Get the Boundary FE Name
421 *
422 * @return std::string&
423 */
424 inline std::string &getBoundaryFEName() { return boundaryFE; }
425
426 /**
427 * @brief Get the Skeleton FE Name
428 *
429 * @return std::string&
430 */
431 inline std::string &getSkeletonFEName() { return skeletonFE; }
432
433 /**
434 * @brief Get the Skeleton FE Name
435 *
436 * @return std::string&
437 */
438 inline std::string &getMeshsetFEName() { return meshsetFE; }
439
440 /**
441 * @brief Range of entities added to meshset finite element
442 *
443 * Meshset element have not defined integration rule, if you like to integrate
444 * you have to add mesh entity to meshset finite element. In principle
445 * meshset element become standard FE.
446 *
447 * @return std::vector<std::string>&
448 */
452
453 /**
454 * @brief Get the Problem Name
455 *
456 * @return std::string&
457 */
458 inline std::string &getProblemName() { return nameOfProblem; }
459
460 /**
461 * @brief Get the Other Finite Elements
462 *
463 * User can create finite elements using directly core interface and
464 * and them to simple problem by this function
465 *
466 * @return std::vector<std::string>&
467 */
468 inline std::vector<std::string> &getOtherFiniteElements() { return otherFEs; }
469
470 /**
471 * @brief Delete dm
472 *
473 * @return MoFEMErrorCode
474 */
476
477 /**
478 * @brief Delete finite elements
479 *
480 * @return MoFEMErrorCode
481 */
483
484 /**
485 * @brief Get the addSkeletonFE
486 *
487 * If variable set to true, skeleton element is created regardless field on
488 * skelton is added or not.
489 *
490 * @return true
491 * @return false
492 */
493 bool &getAddSkeletonFE() { return addSkeletonFE; }
494
495 /**
496 * @brief Get the addSkeletonFE
497 *
498 * If variable set to true, boundary element is created regardless field on
499 * skelton is added or not.
500 *
501 * @return true
502 * @return false
503 */
504 bool &getAddBoundaryFE() { return addBoundaryFE; }
505
506 /**
507 * @brief Get the addParentAdjacencies
508 *
509 * If set true add parent adjacencies
510 *
511 * @return true
512 * @return false
513 */
515
516 /**
517 * @brief bit ref level for parent
518 *
519 * @return auto&
520 */
521 auto &getBitAdjParent() { return bitAdjParent; }
522
523 /**
524 * @brief bit ref level for parent parent
525 *
526 * @return auto&
527 */
529
530 /**
531 * @brief bit ref level for parent
532 *
533 * @return auto&
534 */
535 auto &getBitAdjEnt() { return bitAdjEnt; }
536
537 /**
538 * @brief bit ref level for parent parent
539 *
540 * @return auto&
541 */
542 auto &getBitAdjEntMask() { return bitAdjEntMask; }
543
544 /**
545 * @brief add empty block to problem
546 *
547 * MatrixManager assumes that all blocks, i.e. all fields combinations are non
548 * zero. This is not always the case, to optimise code and reduce memory usage
549 * user can specifi which blocks are empty.
550 *
551 * @param row_field row field name
552 * @param col_field col field name
553 * @return MoFEMErrorCode
554 */
555 MoFEMErrorCode addFieldToEmptyFieldBlocks(const std::string row_field,
556 const std::string col_field) const;
557
558private:
560
561 BitRefLevel bitLevel; ///< BitRefLevel of the problem
562 BitRefLevel bitLevelMask; ///< BitRefLevel of the problem
563
570
571 EntityHandle meshSet; ///< domain meshset
572 EntityHandle boundaryMeshset; ///< meshset with boundary
573 EntityHandle skeletonMeshset; ///< skeleton meshset with boundary
574
575 bool addSkeletonFE; ///< Add skeleton FE
576 bool addBoundaryFE; ///< Add boundary FE
577 bool addParentAdjacencies; ///< If set to true parent adjacencies are build
578
579 BitRefLevel bitAdjParent; ///< bit ref level for parent
580 BitRefLevel bitAdjParentMask; ///< bit ref level for parent parent
581 BitRefLevel bitAdjEnt; ///< bit ref level for parent
582 BitRefLevel bitAdjEntMask; ///< bit ref level for parent parent
583
584 std::vector<std::string> domainFields; ///< domain fields
585 std::vector<std::string> boundaryFields; ///< boundary fields
586 std::vector<std::string> skeletonFields; ///< fields on the skeleton
587 std::vector<std::string> dataFields; ///< Data fields
588 std::vector<std::string> meshsetFields; ///< meshset fields
589 std::vector<std::string> noFieldFields; ///< NOFIELD field name
590 std::vector<std::string> noFieldDataFields; ///< NOFIELD field name
591
592 std::list<std::tuple<std::string, int, Range, bool>>
593 fieldsOrder; ///< fields order. 1: field name, order, range, set by range
594 ///< if true
595
596 std::string nameOfProblem = "SimpleProblem"; ///< problem name
597 std::string domainFE = "dFE"; ///< domain finite element
598 std::string boundaryFE = "bFE"; ///< boundary finite element
599 std::string skeletonFE = "sFE"; ///< skeleton finite element
600 std::string meshsetFE = "mFE"; ///< meshset finite element
601
602 std::vector<std::string> otherFEs; ///< Other finite elements
603
604 std::vector<Range> meshsetFiniteElementEntities; ///< Meshset element entities
605
606 char meshFileName[255]; ///< mesh file name
607 int dIm; ///< dimension of problem
608
610 dM; ///< Discrete manager (interface to PETSc/MoFEM functions)
611
615
616 template <int DIM = -1>
617 MoFEMErrorCode setSkeletonAdjacency(std::string fe_name);
618
619 template <int DIM = -1> MoFEMErrorCode setParentAdjacency();
620
621 boost::shared_ptr<ParentFiniteElementAdjacencyFunction<3>>
623 boost::shared_ptr<ParentFiniteElementAdjacencyFunction<2>>
625 boost::shared_ptr<ParentFiniteElementAdjacencyFunction<1>>
627
628 boost::shared_ptr<ParentFiniteElementAdjacencyFunctionSkeleton<2>>
630 boost::shared_ptr<ParentFiniteElementAdjacencyFunctionSkeleton<1>>
632};
633
634} // namespace MoFEM
635
636#endif // __SIMPLE_HPP__
637
638/**
639 * \defgroup mofem_simple_interface Simple interface
640 * \brief Implementation of simple interface for fast problem set-up.
641 *
642 * \ingroup mofem
643 **/
MoFEM interface.
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
@ MF_ZERO
FieldApproximationBase
approximation base
Definition definitions.h:58
FieldSpace
approximation spaces
Definition definitions.h:82
#define DEPRECATED
Definition definitions.h:17
constexpr int order
char mesh_file_name[255]
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
int FieldCoefficientsNumber
Number of field coefficients.
Definition Types.hpp:27
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
constexpr auto field_name
virtual moab::Interface & get_moab()=0
Core (interface) class.
Definition Core.hpp:82
Deprecated interface functions.
Create adjacency to parent skeleton elements.
Definition Simple.hpp:21
Create adjacency to parent elements.
Definition Simple.hpp:20
Simple interface for fast problem set-up.
Definition Simple.hpp:27
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 2 > > parentAdjFunctionDim2
Definition Simple.hpp:624
EntityHandle boundaryMeshset
meshset with boundary
Definition Simple.hpp:572
MoFEMErrorCode buildProblem()
Build problem.
Definition Simple.cpp:722
std::string & getDomainFEName()
Get the Domain FE Name.
Definition Simple.hpp:417
MoFEMErrorCode addDomainField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
Definition Simple.cpp:261
bool & getAddBoundaryFE()
Get the addSkeletonFE.
Definition Simple.hpp:504
const std::string getBoundaryFEName() const
Get the Boundary FE Name.
Definition Simple.hpp:396
std::vector< std::string > dataFields
Data fields.
Definition Simple.hpp:587
MoFEMErrorCode setParentAdjacency()
Definition Simple.cpp:67
std::list< std::tuple< std::string, int, Range, bool > > fieldsOrder
Definition Simple.hpp:593
std::vector< std::string > domainFields
domain fields
Definition Simple.hpp:584
MoFEMErrorCode defineFiniteElements()
Define finite elements.
Definition Simple.cpp:471
MoFEM::Core & cOre
Definition Simple.hpp:559
BitRefLevel bitAdjEnt
bit ref level for parent
Definition Simple.hpp:581
EntityHandle & getMeshset()
Get the MeshSet object.
Definition Simple.hpp:354
char meshFileName[255]
mesh file name
Definition Simple.hpp:606
EntityHandle meshSet
domain meshset
Definition Simple.hpp:571
auto & getBitAdjParent()
bit ref level for parent
Definition Simple.hpp:521
int getDim() const
Get the problem dimension.
Definition Simple.hpp:333
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
Definition Simple.cpp:191
std::vector< std::string > otherFEs
Other finite elements.
Definition Simple.hpp:602
MoFEMErrorCode buildFiniteElements()
Build finite elements.
Definition Simple.cpp:660
MoFEMErrorCode addMeshsetField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add meshset field.
Definition Simple.cpp:411
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 2 > > parentAdjSkeletonFunctionDim2
Definition Simple.hpp:629
MoFEMErrorCode exchangeGhostCells()
Definition Simple.cpp:925
PetscLogEvent MOFEM_EVENT_SimpleBuildFields
Definition Simple.hpp:566
const std::string getSkeletonFEName() const
Get the Skeleton FE Name.
Definition Simple.hpp:403
PetscLogEvent MOFEM_EVENT_SimpleLoadMesh
Definition Simple.hpp:565
static MoFEMErrorCode defaultLoadFileFunc(Interface &m_field, const char *file_name, const char *options)
Set function for loading mesh file.
Definition Simple.hpp:51
MoFEMErrorCode reSetUp(bool only_dm=false)
Rebuild internal MoFEM data structures.
Definition Simple.cpp:762
MoFEMErrorCode addBoundaryField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on boundary.
Definition Simple.cpp:355
std::vector< std::string > noFieldFields
NOFIELD field name.
Definition Simple.hpp:589
std::string meshsetFE
meshset finite element
Definition Simple.hpp:600
bool addSkeletonFE
Add skeleton FE.
Definition Simple.hpp:575
BitRefLevel bitAdjParent
bit ref level for parent
Definition Simple.hpp:579
bool addBoundaryFE
Add boundary FE.
Definition Simple.hpp:576
std::vector< std::string > & getOtherFiniteElements()
Get the Other Finite Elements.
Definition Simple.hpp:468
MoFEMErrorCode addFieldToEmptyFieldBlocks(const std::string row_field, const std::string col_field) const
add empty block to problem
Definition Simple.cpp:835
std::string skeletonFE
skeleton finite element
Definition Simple.hpp:599
std::vector< std::string > noFieldDataFields
NOFIELD field name.
Definition Simple.hpp:590
std::vector< std::string > meshsetFields
meshset fields
Definition Simple.hpp:588
EntityHandle & getSkeletonMeshSet()
Get the SkeletonMeshSet object.
Definition Simple.hpp:368
std::string boundaryFE
boundary finite element
Definition Simple.hpp:598
std::string nameOfProblem
problem name
Definition Simple.hpp:596
void setDim(int dim)
Set the problem dimension.
Definition Simple.hpp:340
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 3 > > parentAdjFunctionDim3
Definition Simple.hpp:622
MoFEMErrorCode getOptions()
get options
Definition Simple.cpp:180
virtual ~Simple()=default
std::string domainFE
domain finite element
Definition Simple.hpp:597
std::vector< std::string > boundaryFields
boundary fields
Definition Simple.hpp:585
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 1 > > parentAdjSkeletonFunctionDim1
Definition Simple.hpp:631
std::string & getBoundaryFEName()
Get the Boundary FE Name.
Definition Simple.hpp:424
MoFEMErrorCode removeSkeletonField(const std::string name)
Remove field form skeleton.
Definition Simple.cpp:457
BitRefLevel bitAdjEntMask
bit ref level for parent parent
Definition Simple.hpp:582
auto & getBitAdjEnt()
bit ref level for parent
Definition Simple.hpp:535
DEPRECATED EntityHandle & getMeshSet()
Definition Simple.hpp:347
SmartPetscObj< DM > dM
Discrete manager (interface to PETSc/MoFEM functions)
Definition Simple.hpp:610
MoFEMErrorCode removeDomainField(const std::string name)
Remove field form domain.
Definition Simple.cpp:429
MoFEMErrorCode buildFields()
Build fields.
Definition Simple.cpp:584
SmartPetscObj< DM > getDM()
Return smart DM object.
Definition Simple.hpp:323
std::string & getMeshsetFEName()
Get the Skeleton FE Name.
Definition Simple.hpp:438
std::vector< Range > meshsetFiniteElementEntities
Meshset element entities.
Definition Simple.hpp:604
BitRefLevel bitLevel
BitRefLevel of the problem.
Definition Simple.hpp:561
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Definition Simple.cpp:575
auto & getMeshsetFiniteElementEntities()
Range of entities added to meshset finite element.
Definition Simple.hpp:449
MoFEMErrorCode defineProblem(const PetscBool is_partitioned=PETSC_TRUE)
define problem
Definition Simple.cpp:551
BitRefLevel & getBitRefLevelMask()
Get the BitRefLevel.
Definition Simple.hpp:382
std::vector< std::string > skeletonFields
fields on the skeleton
Definition Simple.hpp:586
MoFEMErrorCode addDataField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
Definition Simple.cpp:393
EntityHandle & getBoundaryMeshSet()
Get the BoundaryMeshSet object.
Definition Simple.hpp:361
boost::function< MoFEMErrorCode(Interface &, const char *, const char *)> LoadFileFunc
Definition Simple.hpp:43
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition Simple.cpp:8
auto & getBitAdjEntMask()
bit ref level for parent parent
Definition Simple.hpp:542
bool & getAddSkeletonFE()
Get the addSkeletonFE.
Definition Simple.hpp:493
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
Definition Simple.cpp:736
MoFEMErrorCode removeBoundaryField(const std::string name)
Remove field form boundary.
Definition Simple.cpp:443
std::string & getSkeletonFEName()
Get the Skeleton FE Name.
Definition Simple.hpp:431
const std::string getProblemName() const
Get the Problem Name.
Definition Simple.hpp:410
const std::string getDomainFEName() const
Get the Domain FE Name.
Definition Simple.hpp:389
int dIm
dimension of problem
Definition Simple.hpp:607
MoFEMErrorCode setSkeletonAdjacency(int dim=-1, std::string fe_name="")
Set the skeleton adjacency object.
Definition Simple.cpp:143
MoFEMErrorCode deleteDM()
Delete dm.
Definition Simple.cpp:812
std::string & getProblemName()
Get the Problem Name.
Definition Simple.hpp:458
PetscLogEvent MOFEM_EVENT_SimpleSetUP
Definition Simple.hpp:564
PetscLogEvent MOFEM_EVENT_SimpleKSPSolve
Definition Simple.hpp:569
MoFEMErrorCode createBoundaryMeshset()
Definition Simple.cpp:844
PetscLogEvent MOFEM_EVENT_SimpleBuildFiniteElements
Definition Simple.hpp:567
BitRefLevel bitLevelMask
BitRefLevel of the problem.
Definition Simple.hpp:562
auto & getBitAdjParentMask()
bit ref level for parent parent
Definition Simple.hpp:528
BitRefLevel bitAdjParentMask
bit ref level for parent parent
Definition Simple.hpp:580
PetscLogEvent MOFEM_EVENT_SimpleBuildProblem
Definition Simple.hpp:568
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 1 > > parentAdjFunctionDim1
Definition Simple.hpp:626
BitRefLevel & getBitRefLevel()
Get the BitRefLevel.
Definition Simple.hpp:375
bool & getParentAdjacencies()
Get the addParentAdjacencies.
Definition Simple.hpp:514
MoFEMErrorCode deleteFiniteElements()
Delete finite elements.
Definition Simple.cpp:823
Simple(const MoFEM::Core &core)
Definition Simple.cpp:162
EntityHandle skeletonMeshset
skeleton meshset with boundary
Definition Simple.hpp:573
MoFEMErrorCode createSkeletonMeshset()
Definition Simple.cpp:891
bool addParentAdjacencies
If set to true parent adjacencies are build.
Definition Simple.hpp:577
MoFEMErrorCode addDomainBrokenField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add broken field on domain.
Definition Simple.cpp:282
MoFEMErrorCode addSkeletonField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on skeleton.
Definition Simple.cpp:373
intrusive_ptr for managing petsc objects
base class for all interface classes