v0.16.3
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
MoFEM::Simple Struct Reference

Simple interface for fast problem set-up. More...

#include "src/interfaces/Simple.hpp"

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

Public Types

typedef boost::function< MoFEMErrorCode(Interface &, const char *, const char *)> LoadFileFunc
 

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 Simple (const MoFEM::Core &core)
 
virtual ~Simple ()=default
 
MoFEMErrorCode getOptions ()
 get options
 
MoFEMErrorCode loadFile (const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
 Load mesh file.
 
MoFEMErrorCode loadFile (const std::string mesh_file_name="")
 Load mesh file with parallel options if number of cores > 1.
 
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.
 
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.
 
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.
 
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.
 
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 data field.
 
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.
 
MoFEMErrorCode removeDomainField (const std::string name)
 Remove field from domain.
 
MoFEMErrorCode removeBoundaryField (const std::string name)
 Remove field from boundary.
 
MoFEMErrorCode removeSkeletonField (const std::string name)
 Remove field from skeleton.
 
MoFEMErrorCode defineFiniteElements ()
 Define finite elements.
 
MoFEMErrorCode defineProblem (const PetscBool is_partitioned=PETSC_TRUE)
 define problem
 
MoFEMErrorCode setFieldOrder (const std::string field_name, const int order, const Range *ents=NULL)
 Set field order.
 
MoFEMErrorCode buildFields ()
 Build fields.
 
MoFEMErrorCode buildFiniteElements ()
 Build finite elements.
 
MoFEMErrorCode setSkeletonAdjacency (int dim=-1, std::string fe_name="")
 Set the skeleton adjacency object.
 
MoFEMErrorCode buildProblem ()
 Build problem.
 
MoFEMErrorCode setUp (const PetscBool is_partitioned=PETSC_TRUE)
 Setup problem.
 
MoFEMErrorCode reSetUp (bool only_dm=false)
 Rebuild internal MoFEM data structures.
 
MoFEMErrorCode getDM (DM *dm)
 Get DM.
 
SmartPetscObj< DM > getDM ()
 Return smart DM object.
 
int getDim () const
 Get the problem dimension.
 
void setDim (int dim)
 Set the problem dimension.
 
DEPRECATED EntityHandle & getMeshSet ()
 
EntityHandle & getMeshset ()
 Get the MeshSet object.
 
EntityHandle & getBoundaryMeshSet ()
 Get the BoundaryMeshSet object.
 
EntityHandle & getSkeletonMeshSet ()
 Get the SkeletonMeshSet object.
 
BitRefLevel & getBitRefLevel ()
 Get the BitRefLevel.
 
BitRefLevel & getBitRefLevelMask ()
 Get the BitRefLevelMask.
 
const std::string getDomainFEName () const
 Get the Domain FE Name.
 
const std::string getBoundaryFEName () const
 Get the Boundary FE Name.
 
const std::string getSkeletonFEName () const
 Get the Skeleton FE Name.
 
const std::string getProblemName () const
 Get the Problem Name.
 
std::string & getDomainFEName ()
 Get the Domain FE Name.
 
std::string & getBoundaryFEName ()
 Get the Boundary FE Name.
 
std::string & getSkeletonFEName ()
 Get the Skeleton FE Name.
 
std::string & getMeshsetFEName ()
 Get the Skeleton FE Name.
 
auto & getMeshsetFiniteElementEntities ()
 Range of entities added to meshset finite element.
 
std::string & getProblemName ()
 Get the Problem Name.
 
std::vector< std::string > & getOtherFiniteElements ()
 Get the Other Finite Elements.
 
MoFEMErrorCode deleteDM ()
 Delete dm.
 
MoFEMErrorCode deleteFiniteElements ()
 Delete finite elements.
 
bool & getAddSkeletonFE ()
 Get the addSkeletonFE flag.
 
bool & getAddBoundaryFE ()
 Get the addBoundaryFE flag.
 
bool & getParentAdjacencies ()
 Get the addParentAdjacencies flag.
 
auto & getBitAdjParent ()
 Get bit ref level for parent.
 
auto & getBitAdjParentMask ()
 Get bit ref level mask for parent.
 
auto & getBitAdjEnt ()
 Get bit ref level for entities.
 
auto & getBitAdjEntMask ()
 Get bit ref level mask for entities.
 
MoFEMErrorCode addFieldToEmptyFieldBlocks (const std::string row_field, const std::string col_field) const
 Add empty block to problem.
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface reference to pointer of interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface.
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface.
 
virtual ~UnknownInterface ()=default
 

Static Public Member Functions

static MoFEMErrorCode defaultLoadFileFunc (Interface &m_field, const char *file_name, const char *options)
 Set function for loading mesh file.
 
- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version.
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version.
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version.
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version.
 

Private Member Functions

MoFEMErrorCode createBoundaryMeshset ()
 
MoFEMErrorCode createSkeletonMeshset ()
 
MoFEMErrorCode exchangeGhostCells ()
 
template<int DIM = -1>
MoFEMErrorCode setSkeletonAdjacency (std::string fe_name)
 
template<int DIM = -1>
MoFEMErrorCode setParentAdjacency ()
 
template<>
MoFEMErrorCode setSkeletonAdjacency (std::string fe_name)
 
template<>
MoFEMErrorCode setSkeletonAdjacency (std::string fe_name)
 
template<>
MoFEMErrorCode setSkeletonAdjacency (std::string fe_name)
 
template<>
MoFEMErrorCode setParentAdjacency ()
 
template<>
MoFEMErrorCode setParentAdjacency ()
 
template<>
MoFEMErrorCode setParentAdjacency ()
 

Private Attributes

MoFEM::Core & cOre
 
BitRefLevel bitLevel
 BitRefLevel of the problem.
 
BitRefLevel bitLevelMask
 BitRefLevel of the problem.
 
PetscLogEvent MOFEM_EVENT_SimpleSetUP
 
PetscLogEvent MOFEM_EVENT_SimpleLoadMesh
 
PetscLogEvent MOFEM_EVENT_SimpleBuildFields
 
PetscLogEvent MOFEM_EVENT_SimpleBuildFiniteElements
 
PetscLogEvent MOFEM_EVENT_SimpleBuildProblem
 
PetscLogEvent MOFEM_EVENT_SimpleKSPSolve
 
EntityHandle meshSet
 domain meshset
 
EntityHandle boundaryMeshset
 meshset with boundary
 
EntityHandle skeletonMeshset
 skeleton meshset with boundary
 
bool addSkeletonFE
 Add skeleton FE.
 
bool addBoundaryFE
 Add boundary FE.
 
bool addParentAdjacencies
 If set to true parent adjacencies are build.
 
BitRefLevel bitAdjParent
 bit ref level for parent
 
BitRefLevel bitAdjParentMask
 bit ref level for parent parent
 
BitRefLevel bitAdjEnt
 bit ref level for parent
 
BitRefLevel bitAdjEntMask
 bit ref level for parent parent
 
std::vector< std::string > domainFields
 domain fields
 
std::vector< std::string > boundaryFields
 boundary fields
 
std::vector< std::string > skeletonFields
 fields on the skeleton
 
std::vector< std::string > dataFields
 Data fields.
 
std::vector< std::string > meshsetFields
 meshset fields
 
std::vector< std::string > noFieldFields
 NOFIELD field name.
 
std::vector< std::string > noFieldDataFields
 NOFIELD field name.
 
std::list< std::tuple< std::string, int, Range, bool > > fieldsOrder
 
std::string nameOfProblem = "SimpleProblem"
 problem name
 
std::string domainFE = "dFE"
 domain finite element
 
std::string boundaryFE = "bFE"
 boundary finite element
 
std::string skeletonFE = "sFE"
 skeleton finite element
 
std::string meshsetFE = "mFE"
 meshset finite element
 
std::vector< std::string > otherFEs
 Other finite elements.
 
std::vector< Range > meshsetFiniteElementEntities
 Meshset element entities.
 
char meshFileName [PETSC_MAX_PATH_LEN]
 mesh file name
 
int dIm
 dimension of problem
 
SmartPetscObj< DM > dM
 Discrete manager (interface to PETSc/MoFEM functions)
 
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 3 > > parentAdjFunctionDim3
 
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 2 > > parentAdjFunctionDim2
 
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 1 > > parentAdjFunctionDim1
 
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 2 > > parentAdjSkeletonFunctionDim2
 
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 1 > > parentAdjSkeletonFunctionDim1
 

Detailed Description

Simple interface for fast problem set-up.

Examples
mofem/atom_tests/boundary_marker.cpp, mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_check_approx_in_3d.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/loop_entities.cpp, mofem/atom_tests/operators_tester_direction.cpp, mofem/atom_tests/operators_tests.cpp, mofem/atom_tests/partition_mesh.cpp, mofem/atom_tests/rebuild_problem_hybrid.cpp, mofem/atom_tests/scalar_check_approximation.cpp, mofem/atom_tests/schur_test_diag_mat.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/simple_l2_only.cpp, mofem/atom_tests/tensor_divergence_operator.cpp, mofem/atom_tests/test_broken_space.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-3_level_set/level_set.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-5_poroelasticity/seepage.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/fun-0_hello_world/hello_world.cpp, mofem/tutorials/fun-1_integration/integration.cpp, mofem/tutorials/fun-2_plot_base/plot_base.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-6_heat_equation/heat_equation.cpp, mofem/tutorials/scl-7_wave_equation/wave_equation.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-10_elasticity_schur/schur_elastic.cpp, mofem/tutorials/vec-11_elastic_tie_mesh/elastic_tie_mesh.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-5_free_surface/free_surface.cpp, mofem/tutorials/vec-6_dg_kirchhoff_plate/plate.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/adolc-plasticity/adolc_plasticity.cpp, mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_element.cpp, and mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 27 of file Simple.hpp.

Member Typedef Documentation

◆ LoadFileFunc

typedef boost::function<MoFEMErrorCode(Interface &, const char *, const char *)> MoFEM::Simple::LoadFileFunc

Definition at line 46 of file Simple.hpp.

Constructor & Destructor Documentation

◆ Simple()

MoFEM::Simple::Simple ( const MoFEM::Core &  core)

Definition at line 162 of file Simple.cpp.

163 : cOre(const_cast<Core &>(core)), bitLevel(BitRefLevel().set(0)),
165 skeletonMeshset(0), nameOfProblem("SimpleProblem"), domainFE("dFE"),
166 boundaryFE("bFE"), skeletonFE("sFE"), dIm(-1), addSkeletonFE(false),
167 addBoundaryFE(false), addParentAdjacencies(false),
170 PetscLogEventRegister("SimpSetUp", 0, &MOFEM_EVENT_SimpleSetUP);
171 PetscLogEventRegister("SimpLoadMesh", 0, &MOFEM_EVENT_SimpleLoadMesh);
172 PetscLogEventRegister("SimpBuildFields", 0, &MOFEM_EVENT_SimpleBuildFields);
173 PetscLogEventRegister("SimpBuildFEs", 0,
175 PetscLogEventRegister("SimpSetUp", 0, &MOFEM_EVENT_SimpleBuildProblem);
176 PetscLogEventRegister("SimpKSPSolve", 0, &MOFEM_EVENT_SimpleKSPSolve);
177 strcpy(meshFileName, "mesh.h5m");
178}
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40
CoreTmp< 0 > Core
Definition Core.hpp:1161
EntityHandle boundaryMeshset
meshset with boundary
Definition Simple.hpp:613
MoFEM::Core & cOre
Definition Simple.hpp:600
BitRefLevel bitAdjEnt
bit ref level for parent
Definition Simple.hpp:622
EntityHandle meshSet
domain meshset
Definition Simple.hpp:612
PetscLogEvent MOFEM_EVENT_SimpleBuildFields
Definition Simple.hpp:607
PetscLogEvent MOFEM_EVENT_SimpleLoadMesh
Definition Simple.hpp:606
bool addSkeletonFE
Add skeleton FE.
Definition Simple.hpp:616
BitRefLevel bitAdjParent
bit ref level for parent
Definition Simple.hpp:620
bool addBoundaryFE
Add boundary FE.
Definition Simple.hpp:617
std::string skeletonFE
skeleton finite element
Definition Simple.hpp:640
std::string boundaryFE
boundary finite element
Definition Simple.hpp:639
std::string nameOfProblem
problem name
Definition Simple.hpp:637
std::string domainFE
domain finite element
Definition Simple.hpp:638
BitRefLevel bitAdjEntMask
bit ref level for parent parent
Definition Simple.hpp:623
BitRefLevel bitLevel
BitRefLevel of the problem.
Definition Simple.hpp:602
char meshFileName[PETSC_MAX_PATH_LEN]
mesh file name
Definition Simple.hpp:647
int dIm
dimension of problem
Definition Simple.hpp:648
PetscLogEvent MOFEM_EVENT_SimpleSetUP
Definition Simple.hpp:605
PetscLogEvent MOFEM_EVENT_SimpleKSPSolve
Definition Simple.hpp:610
PetscLogEvent MOFEM_EVENT_SimpleBuildFiniteElements
Definition Simple.hpp:608
BitRefLevel bitLevelMask
BitRefLevel of the problem.
Definition Simple.hpp:603
BitRefLevel bitAdjParentMask
bit ref level for parent parent
Definition Simple.hpp:621
PetscLogEvent MOFEM_EVENT_SimpleBuildProblem
Definition Simple.hpp:609
EntityHandle skeletonMeshset
skeleton meshset with boundary
Definition Simple.hpp:614
bool addParentAdjacencies
If set to true parent adjacencies are build.
Definition Simple.hpp:618

◆ ~Simple()

virtual MoFEM::Simple::~Simple ( )
virtualdefault

Member Function Documentation

◆ addBoundaryField()

MoFEMErrorCode MoFEM::Simple::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.

Adds a field to the boundary entities (entities on the mesh boundary)

Parameters
nameName of the field
spaceFunction space (L2, H1, Hdiv, Hcurl)
baseApproximation base (see FieldApproximationBase)
nb_of_coefficientsNumber of field coefficients per DOF
tag_typeTag storage type (MB_TAG_DENSE is faster, MB_TAG_SPARSE more flexible)
bhBehavior if field exists (MF_EXCL throws error, MF_ZERO ignores)
verbVerbosity level (-1 for default)
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/simple_interface.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, and mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp.

Definition at line 358 of file Simple.cpp.

362 {
363 Interface &m_field = cOre;
365 CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
366 verb);
367 boundaryFields.push_back(name);
368 if (space == NOFIELD)
369 SETERRQ(
370 PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
371 "NOFIELD space for boundary field not implemented in Simple interface");
373}
WorkMesh base
std::string name
@ NOFIELD
scalar or vector of scalars describe (no true field)
Definition definitions.h:84
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
DeprecatedCoreInterface Interface
virtual MoFEMErrorCode add_field(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)
Add field.
std::vector< std::string > boundaryFields
boundary fields
Definition Simple.hpp:626

◆ addDataField()

MoFEMErrorCode MoFEM::Simple::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 data field.

Adds a field for storing data values (typically for material properties or constants)

Parameters
nameName of the field
spaceFunction space (L2, H1, Hdiv, Hcurl)
baseApproximation base (see FieldApproximationBase)
nb_of_coefficientsNumber of field coefficients per DOF
tag_typeTag storage type (MB_TAG_DENSE is faster, MB_TAG_SPARSE more flexible)
bhBehavior if field exists (MF_EXCL throws error, MF_ZERO ignores)
verbVerbosity level (-1 for default)
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, and mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp.

Definition at line 396 of file Simple.cpp.

400 {
401
402 Interface &m_field = cOre;
404 CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
405 verb);
406 if (space == NOFIELD)
407 noFieldDataFields.push_back(name);
408 else
409 dataFields.push_back(name);
411}
std::vector< std::string > dataFields
Data fields.
Definition Simple.hpp:628
std::vector< std::string > noFieldDataFields
NOFIELD field name.
Definition Simple.hpp:631

◆ addDomainBrokenField()

MoFEMErrorCode MoFEM::Simple::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.

Adds a discontinuous field to the domain entities with element-wise DOF mapping

Parameters
nameName of the field
spaceFunction space (L2, H1, Hdiv, Hcurl)
baseApproximation base (see FieldApproximationBase)
nb_of_coefficientsNumber of field coefficients per DOF
tag_typeTag storage type (MB_TAG_DENSE is faster, MB_TAG_SPARSE more flexible)
bhBehavior if field exists (MF_EXCL throws error, MF_ZERO ignores)
verbVerbosity level (-1 for default)
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/tutorials/fun-2_plot_base/plot_base.cpp.

Definition at line 285 of file Simple.cpp.

289 {
290
291 Interface &m_field = cOre;
293
294 auto get_side_map_hcurl = [&]() {
295 return std::vector<
296
297 std::pair<EntityType,
299
300 >>{
301
302 {MBTRI,
303 [&](BaseFunction::DofsSideMap &dofs_side_map) -> MoFEMErrorCode {
305 dofs_side_map);
306 }}
307
308 };
309 };
310
311 auto get_side_map_hdiv = [&]() {
312 return std::vector<
313
314 std::pair<EntityType,
316
317 >>{
318
319 {MBTET,
320 [&](BaseFunction::DofsSideMap &dofs_side_map) -> MoFEMErrorCode {
322 dofs_side_map);
323 }}
324
325 };
326 };
327
328 auto get_side_map = [&](auto space) {
329 switch (space) {
330 case HCURL:
331 return get_side_map_hcurl();
332 case HDIV:
333 return get_side_map_hdiv();
334 default:
335 MOFEM_LOG_CHANNEL("WORLD");
336 MOFEM_LOG("WORLD", Sev::warning)
337 << "Side dof map for broken space <" << space << "> not implemented";
338 }
339 return std::vector<
340
341 std::pair<EntityType,
343
344 >>{};
345 };
346
347 CHKERR m_field.add_broken_field(name, space, base, nb_of_coefficients,
348 get_side_map(space), tag_type, bh, verb);
349 domainFields.push_back(name);
350 if (space == NOFIELD)
351 SETERRQ(
352 PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
353 "NOFIELD space for boundary field not implemented in Simple interface");
355}
@ HCURL
field with continuous tangents
Definition definitions.h:86
@ HDIV
field with continuous normal traction
Definition definitions.h:87
@ DISCONTINUOUS
Broken continuity (No effect on L2 space)
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
multi_index_container< DofsSideMapData, indexed_by< ordered_non_unique< tag< TypeSide_mi_tag >, composite_key< DofsSideMapData, member< DofsSideMapData, EntityType, &DofsSideMapData::type >, member< DofsSideMapData, int, &DofsSideMapData::side > > >, ordered_unique< tag< EntDofIdx_mi_tag >, member< DofsSideMapData, int, &DofsSideMapData::dof > > > > DofsSideMap
Map entity stype and side to element/entity dof index.
std::vector< std::string > domainFields
domain fields
Definition Simple.hpp:625
static MoFEMErrorCode setDofsSideMap(const FieldSpace space, const FieldContinuity continuity, const FieldApproximationBase base, DofsSideMap &)
Set map of dof to side number.
static MoFEMErrorCode setDofsSideMap(const FieldSpace space, const FieldContinuity continuity, const FieldApproximationBase base, DofsSideMap &)
Set map of dof to side number.

◆ addDomainField()

MoFEMErrorCode MoFEM::Simple::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.

Adds a field to the domain entities (highest dimension entities in the mesh)

Parameters
nameName of the field
spaceFunction space (L2, H1, Hdiv, Hcurl)
baseApproximation base (see FieldApproximationBase)
nb_of_coefficientsNumber of field coefficients per DOF
tag_typeTag storage type (MB_TAG_DENSE is faster, MB_TAG_SPARSE more flexible)
bhBehavior if field exists (MF_EXCL throws error, MF_ZERO ignores)
verbVerbosity level (-1 for default)
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/loop_entities.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/simple_l2_only.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-3_level_set/level_set.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-5_poroelasticity/seepage.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/fun-1_integration/integration.cpp, mofem/tutorials/fun-2_plot_base/plot_base.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-6_heat_equation/heat_equation.cpp, mofem/tutorials/scl-7_wave_equation/wave_equation.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_element.cpp, and mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 264 of file Simple.cpp.

268 {
269
270 Interface &m_field = cOre;
272 CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
273 verb);
274 domainFields.push_back(name);
275 if (space == NOFIELD)
276 SETERRQ(
277 PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
278 "NOFIELD space for boundary field not implemented in Simple interface");
279
280
282}

◆ addFieldToEmptyFieldBlocks()

MoFEMErrorCode MoFEM::Simple::addFieldToEmptyFieldBlocks ( const std::string  row_field,
const std::string  col_field 
) const

Add empty block to problem.

MatrixManager assumes that all blocks, i.e. all field combinations are non-zero. This is not always the case, to optimize code and reduce memory usage user can specify which blocks are empty.

Parameters
row_fieldName of the row field
col_fieldName of the column field
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/tutorials/adv-0_plasticity/plastic.cpp, and mofem/tutorials/mix-1_light_intensity_equation/phase.cpp.

Definition at line 837 of file Simple.cpp.

838 {
839 Interface &m_field = cOre;
841 CHKERR m_field.getInterface<ProblemsManager>()->addFieldToEmptyFieldBlocks(
842 getProblemName(), row_field, col_field);
844}
MoFEMErrorCode addFieldToEmptyFieldBlocks(const std::string row_field, const std::string col_field) const
Add empty block to problem.
Definition Simple.cpp:837
const std::string getProblemName() const
Get the Problem Name.
Definition Simple.hpp:450
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ addMeshsetField()

MoFEMErrorCode MoFEM::Simple::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.

Add fields managed by meshset finite element for global DOFs

Parameters
nameName of the field
spaceFunction space (L2, H1, Hdiv, Hcurl)
baseApproximation base (see FieldApproximationBase)
nb_of_coefficientsNumber of field coefficients per DOF
tag_typeTag storage type (MB_TAG_DENSE is faster, MB_TAG_SPARSE more flexible)
bhBehavior if field exists (MF_EXCL throws error, MF_ZERO ignores)
verbVerbosity level (-1 for default)
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/simple_interface.cpp, and mofem/atom_tests/simple_l2_only.cpp.

Definition at line 414 of file Simple.cpp.

418 {
419
420 Interface &m_field = cOre;
422 CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
423 verb);
424 if (space != NOFIELD) {
425 meshsetFields.push_back(name);
426 } else {
427 noFieldFields.push_back(name);
428 }
430}
std::vector< std::string > noFieldFields
NOFIELD field name.
Definition Simple.hpp:630
std::vector< std::string > meshsetFields
meshset fields
Definition Simple.hpp:629

◆ addSkeletonField()

MoFEMErrorCode MoFEM::Simple::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.

Adds a field to the skeleton entities (internal interfaces between domain elements)

Parameters
nameName of the field
spaceFunction space (L2, H1, Hdiv, Hcurl)
baseApproximation base (see FieldApproximationBase)
nb_of_coefficientsNumber of field coefficients per DOF
tag_typeTag storage type (MB_TAG_DENSE is faster, MB_TAG_SPARSE more flexible)
bhBehavior if field exists (MF_EXCL throws error, MF_ZERO ignores)
verbVerbosity level (-1 for default)
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, and mofem/atom_tests/simple_interface.cpp.

Definition at line 376 of file Simple.cpp.

380 {
381
382 Interface &m_field = cOre;
384 CHKERR m_field.add_field(name, space, base, nb_of_coefficients, tag_type, bh,
385 verb);
386 skeletonFields.push_back(name);
387 if (space == NOFIELD)
388 SETERRQ(
389 PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
390 "NOFIELD space for boundary field not implemented in Simple interface");
391
393}
std::vector< std::string > skeletonFields
fields on the skeleton
Definition Simple.hpp:627

◆ buildFields()

MoFEMErrorCode MoFEM::Simple::buildFields ( )

Build fields.

Builds the field data structures and creates DOFs

Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/tools/mesh_smoothing.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, and mofem/tutorials/scl-12_electrostatics/electrostatics.cpp.

Definition at line 587 of file Simple.cpp.

587 {
588 Interface &m_field = cOre;
590 PetscLogEventBegin(MOFEM_EVENT_SimpleBuildFields, 0, 0, 0, 0);
591
592 auto comm_interface_ptr = m_field.getInterface<CommInterface>();
593
594 // Add entities to the fields
595 auto add_ents_to_field = [&](auto meshset, auto dim, auto &fields) {
597 for (auto &field : fields) {
598 CHKERR m_field.add_ents_to_field_by_dim(meshset, dim, field);
599 CHKERR comm_interface_ptr->synchroniseFieldEntities(field, 0);
600 }
602 };
603
604 CHKERR add_ents_to_field(meshSet, dIm, domainFields);
605 CHKERR add_ents_to_field(meshSet, dIm, dataFields);
606 CHKERR add_ents_to_field(boundaryMeshset, dIm - 1, boundaryFields);
607 CHKERR add_ents_to_field(skeletonMeshset, dIm - 1, skeletonFields);
608
609 std::set<std::string> nofield_fields;
610 for (auto &f : noFieldFields)
611 nofield_fields.insert(f);
612 for (auto &f : noFieldDataFields)
613 nofield_fields.insert(f);
614
615 // Set order
616
617 auto get_field_ptr = [&](auto &f) { return m_field.get_field_structure(f); };
618 for (auto &t : fieldsOrder) {
619 const auto f = std::get<0>(t);
620 const auto order = std::get<1>(t);
621
622 MOFEM_TAG_AND_LOG("WORLD", Sev::inform, "Simple")
623 << "Set order to field " << f << " order " << order;
624 MOFEM_LOG_CHANNEL("SYNC");
625 if (std::get<3>(t)) {
626 MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "Simple")
627 << "To ents: " << std::endl
628 << std::get<2>(t) << std::endl;
629 }
630 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
631
632 if (std::get<3>(t)) {
633
634 CHKERR m_field.set_field_order(std::get<2>(t), f, order);
635
636 } else {
637 auto f_ptr = get_field_ptr(f);
638
639 if (f_ptr->getSpace() == H1) {
640 if (f_ptr->getApproxBase() == AINSWORTH_BERNSTEIN_BEZIER_BASE) {
641 CHKERR m_field.set_field_order(meshSet, MBVERTEX, f, order);
642 } else {
643 CHKERR m_field.set_field_order(meshSet, MBVERTEX, f, 1);
644 }
645 }
646
647 for (auto d = 1; d <= dIm; ++d) {
648 for (EntityType t = CN::TypeDimensionMap[d].first;
649 t <= CN::TypeDimensionMap[d].second; ++t) {
650 CHKERR m_field.set_field_order(meshSet, t, f, order);
651 }
652 }
653 }
654 }
655 MOFEM_LOG_CHANNEL("WORLD");
656 // Build fields
657 CHKERR m_field.build_fields();
658 PetscLogEventEnd(MOFEM_EVENT_SimpleBuildFields, 0, 0, 0, 0);
660}
Vec t
Removal: the ring edge.
ProjectedField & field
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
Definition definitions.h:64
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ H1
continuous field
Definition definitions.h:85
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
constexpr int order
std::list< std::tuple< std::string, int, Range, bool > > fieldsOrder
Definition Simple.hpp:634

◆ buildFiniteElements()

MoFEMErrorCode MoFEM::Simple::buildFiniteElements ( )

Build finite elements.

Builds the finite element data structures and adjacencies

Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/tools/mesh_smoothing.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, and mofem/tutorials/scl-12_electrostatics/electrostatics.cpp.

Definition at line 662 of file Simple.cpp.

662 {
663 Interface &m_field = cOre;
665 PetscLogEventBegin(MOFEM_EVENT_SimpleBuildFiniteElements, 0, 0, 0, 0);
666 // Add finite elements
667 CHKERR m_field.add_ents_to_finite_element_by_dim(meshSet, dIm, domainFE,
668 true);
669 CHKERR m_field.build_finite_elements(domainFE);
670 if (addBoundaryFE || boundaryFields.size()) {
671 CHKERR m_field.add_ents_to_finite_element_by_dim(boundaryMeshset, dIm - 1,
672 boundaryFE, true);
673 CHKERR m_field.build_finite_elements(boundaryFE);
674 }
675 if (addSkeletonFE || skeletonFields.size()) {
676 CHKERR m_field.add_ents_to_finite_element_by_dim(skeletonMeshset, dIm - 1,
677 skeletonFE, true);
678 CHKERR m_field.build_finite_elements(skeletonFE);
679 }
680
681 if (noFieldFields.size() || meshsetFields.size()) {
682
683 auto create_meshset = [&]() {
684 EntityHandle meshset;
685 auto create = [&]() {
687 CHKERR m_field.get_moab().create_meshset(MESHSET_SET, meshset);
688 {
689 ParallelComm *pcomm =
690 ParallelComm::get_pcomm(&m_field.get_moab(), MYPCOMM_INDEX);
691 Tag part_tag = pcomm->part_tag();
692 int rank = pcomm->rank();
693 CHKERR m_field.get_moab().tag_set_data(part_tag, &meshset, 1,
694 &rank);
695 CHKERR m_field.getInterface<BitRefManager>()->setBitLevelToMeshset(
696 meshset, BitRefLevel().set());
697 }
699 };
700 CHK_THROW_MESSAGE(create(), "Failed to create meshset");
701 return meshset;
702 };
703
704 auto fe_meshset = create_meshset();
705 CHKERR m_field.add_ents_to_finite_element_by_MESHSET(fe_meshset,
706 meshsetFE, false);
707 // Add entities to the meshset, that will make DOFs on those entities
708 // accessible on meshset finite element
709 for (auto ents : meshsetFiniteElementEntities) {
710 CHKERR m_field.get_moab().add_entities(fe_meshset, ents);
711 }
712 CHKERR m_field.build_finite_elements(meshsetFE);
713
714 }
715
716 for (std::vector<std::string>::iterator fit = otherFEs.begin();
717 fit != otherFEs.end(); ++fit) {
718 CHKERR m_field.build_finite_elements(*fit);
719 }
720 PetscLogEventEnd(MOFEM_EVENT_SimpleBuildFiniteElements, 0, 0, 0, 0);
722}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MYPCOMM_INDEX
default communicator number PCOMM
std::vector< std::string > otherFEs
Other finite elements.
Definition Simple.hpp:643
std::string meshsetFE
meshset finite element
Definition Simple.hpp:641
std::vector< Range > meshsetFiniteElementEntities
Meshset element entities.
Definition Simple.hpp:645

◆ buildProblem()

MoFEMErrorCode MoFEM::Simple::buildProblem ( )

Build problem.

Builds the problem data structures and sets up DOF numbering

Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/tools/mesh_smoothing.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, and mofem/tutorials/scl-12_electrostatics/electrostatics.cpp.

Definition at line 724 of file Simple.cpp.

724 {
725 Interface &m_field = cOre;
727 PetscLogEventBegin(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
728 CHKERR m_field.build_adjacencies(bitLevel, bitLevelMask);
729 // Set problem by the DOFs on the fields rather that by adding DOFs on the
730 // elements
731 m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_TRUE;
733 m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_FALSE;
734 PetscLogEventEnd(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
736}
PetscErrorCode DMSetUp_MoFEM(DM dm)
Definition DMMoFEM.cpp:1384
SmartPetscObj< DM > dM
Discrete manager (interface to PETSc/MoFEM functions)
Definition Simple.hpp:651

◆ createBoundaryMeshset()

MoFEMErrorCode MoFEM::Simple::createBoundaryMeshset ( )
private

Definition at line 846 of file Simple.cpp.

846 {
847 Interface &m_field = cOre;
849 ParallelComm *pcomm =
850 ParallelComm::get_pcomm(&m_field.get_moab(), MYPCOMM_INDEX);
851
852 auto get_skin = [&](auto meshset) {
853 // filter not owned entities, those are not on boundary
854
855 Range domain_ents;
856 CHKERR m_field.get_moab().get_entities_by_dimension(meshset, dIm,
857 domain_ents, true);
858 CHKERR pcomm->filter_pstatus(domain_ents,
859 PSTATUS_SHARED | PSTATUS_MULTISHARED,
860 PSTATUS_NOT, -1, nullptr);
861
862 Skinner skin(&m_field.get_moab());
863 Range domain_skin;
864 CHKERR skin.find_skin(0, domain_ents, false, domain_skin);
865 CHKERR pcomm->filter_pstatus(domain_skin,
866 PSTATUS_SHARED | PSTATUS_MULTISHARED,
867 PSTATUS_NOT, -1, nullptr);
868 return domain_skin;
869 };
870
871 auto create_boundary_meshset = [&](auto &&domain_skin) {
873 // create boundary meshset
874 if (boundaryMeshset != 0) {
876 }
877 CHKERR m_field.get_moab().create_meshset(MESHSET_SET, boundaryMeshset);
878 CHKERR m_field.get_moab().add_entities(boundaryMeshset, domain_skin);
879 for (int dd = 0; dd != dIm - 1; dd++) {
880 Range adj;
881 CHKERR m_field.get_moab().get_adjacencies(domain_skin, dd, false, adj,
882 moab::Interface::UNION);
883 CHKERR m_field.get_moab().add_entities(boundaryMeshset, adj);
884 }
886 };
887
888 CHKERR create_boundary_meshset(get_skin(meshSet));
889
891}
FaceSet skin
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition ddTensor0.hpp:33

◆ createSkeletonMeshset()

MoFEMErrorCode MoFEM::Simple::createSkeletonMeshset ( )
private

Definition at line 893 of file Simple.cpp.

893 {
894 Interface &m_field = cOre;
896
897 ParallelComm *pcomm =
898 ParallelComm::get_pcomm(&m_field.get_moab(), MYPCOMM_INDEX);
899
900 auto create_skeleton_meshset = [&](auto meshset) {
902 // create boundary meshset
903 if (skeletonMeshset != 0) {
905 }
906 Range boundary_ents, skeleton_ents;
907 CHKERR m_field.get_moab().get_entities_by_dimension(boundaryMeshset,
908 dIm - 1, boundary_ents);
909 Range domain_ents;
910 CHKERR m_field.get_moab().get_entities_by_dimension(meshset, dIm,
911 domain_ents, true);
912 CHKERR m_field.get_moab().get_adjacencies(
913 domain_ents, dIm - 1, true, skeleton_ents, moab::Interface::UNION);
914 skeleton_ents = subtract(skeleton_ents, boundary_ents);
915 CHKERR pcomm->filter_pstatus(skeleton_ents, PSTATUS_NOT_OWNED, PSTATUS_NOT,
916 -1, nullptr);
917 CHKERR m_field.get_moab().create_meshset(MESHSET_SET, skeletonMeshset);
918 CHKERR m_field.get_moab().add_entities(skeletonMeshset, skeleton_ents);
920 };
921
922 CHKERR create_skeleton_meshset(meshSet);
923
925}

◆ defaultLoadFileFunc()

static MoFEMErrorCode MoFEM::Simple::defaultLoadFileFunc ( Interface &  m_field,
const char *  file_name,
const char *  options 
)
inlinestatic

Set function for loading mesh file.

Default function for loading mesh files using MOAB interface

Parameters
m_fieldMoFEM interface object
file_nameName of the mesh file to load
optionsLoader options string for MOAB
Returns
MoFEMErrorCode Error code indicating success or failure

Definition at line 57 of file Simple.hpp.

59 {
60 // Default behavior using the member moab.load_file
61 return m_field.get_moab().load_file(file_name, 0, options);
62 }

◆ defineFiniteElements()

MoFEMErrorCode MoFEM::Simple::defineFiniteElements ( )

Define finite elements.

Creates and defines domain, boundary, and skeleton finite elements based on added fields

Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/tools/mesh_smoothing.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, and mofem/tutorials/scl-12_electrostatics/electrostatics.cpp.

Definition at line 474 of file Simple.cpp.

474 {
475 Interface &m_field = cOre;
477
478 auto clear_rows_and_cols = [&](auto &fe_name) {
480 auto fe_ptr = m_field.get_finite_elements();
481 auto &fe_by_name = const_cast<FiniteElement_multiIndex *>(fe_ptr)
482 ->get<FiniteElement_name_mi_tag>();
483 auto it_fe = fe_by_name.find(fe_name);
484 if (it_fe != fe_by_name.end()) {
485
486 if (!fe_by_name.modify(it_fe, FiniteElement_row_change_bit_reset()))
487 SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
488 "modification unsuccessful");
489
490 if (!fe_by_name.modify(it_fe, FiniteElement_col_change_bit_reset()))
491 SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
492 "modification unsuccessful");
493 }
495 };
496 CHKERR clear_rows_and_cols(domainFE);
497 CHKERR clear_rows_and_cols(boundaryFE);
498 CHKERR clear_rows_and_cols(skeletonFE);
499
500 // Define finite elements
501 CHKERR m_field.add_finite_element(domainFE, MF_ZERO);
502
503 auto add_fields = [&](auto &fe_name, auto &fields) {
505 for (auto &field : fields) {
506 CHKERR m_field.modify_finite_element_add_field_row(fe_name, field);
507 CHKERR m_field.modify_finite_element_add_field_col(fe_name, field);
508 CHKERR m_field.modify_finite_element_add_field_data(fe_name, field);
509 }
511 };
512
513 auto add_data_fields = [&](auto &fe_name, auto &fields) {
515 for (auto &field : fields)
516 CHKERR m_field.modify_finite_element_add_field_data(fe_name, field);
518 };
519
520 CHKERR add_fields(domainFE, domainFields);
521 CHKERR add_data_fields(domainFE, dataFields);
522 CHKERR add_fields(domainFE, noFieldFields);
523 CHKERR add_data_fields(domainFE, noFieldDataFields);
524
525 if (addBoundaryFE || !boundaryFields.empty()) {
526 CHKERR m_field.add_finite_element(boundaryFE, MF_ZERO);
527 CHKERR add_fields(boundaryFE, domainFields);
528 if (!boundaryFields.empty())
529 CHKERR add_fields(boundaryFE, boundaryFields);
530 CHKERR add_data_fields(boundaryFE, dataFields);
531 CHKERR add_data_fields(boundaryFE, noFieldDataFields);
532 CHKERR add_fields(boundaryFE, noFieldFields);
533 }
534 if (addSkeletonFE || !skeletonFields.empty()) {
535 CHKERR m_field.add_finite_element(skeletonFE, MF_ZERO);
536 CHKERR add_fields(skeletonFE, domainFields);
537 if (!skeletonFields.empty())
538 CHKERR add_fields(skeletonFE, skeletonFields);
539 CHKERR add_data_fields(skeletonFE, dataFields);
540 CHKERR add_data_fields(skeletonFE, noFieldDataFields);
541 CHKERR add_fields(skeletonFE, noFieldFields);
542 }
543
544 if (noFieldFields.size() || meshsetFields.size()) {
545 CHKERR m_field.add_finite_element(meshsetFE, MF_ZERO);
546 CHKERR add_fields(meshsetFE, meshsetFields);
547 CHKERR add_fields(meshsetFE, noFieldFields);
548 CHKERR add_data_fields(meshsetFE, noFieldDataFields);
549 }
550
552}
@ MF_ZERO
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition definitions.h:34
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.
MoFEMErrorCode get_finite_elements(const FiniteElement_multiIndex **fe_ptr) const
Get finite elements multi-index.
Definition Core.cpp:878

◆ defineProblem()

MoFEMErrorCode MoFEM::Simple::defineProblem ( const PetscBool  is_partitioned = PETSC_TRUE)

define problem

Creates the problem and associates finite elements with it

Parameters
is_partitionedWhether the mesh should be partitioned for parallel execution
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/tools/mesh_smoothing.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, and mofem/tutorials/scl-12_electrostatics/electrostatics.cpp.

Definition at line 554 of file Simple.cpp.

554 {
555 Interface &m_field = cOre;
557 // Create dm instance
558 dM = createDM(m_field.get_comm(), "DMMOFEM");
559 // set dm data structure which created mofem data structures
562 CHKERR DMSetFromOptions(dM);
564 if (addBoundaryFE || !boundaryFields.empty()) {
566 }
567 if (addSkeletonFE || !skeletonFields.empty()) {
569 }
570 if (noFieldFields.size() || meshsetFields.size()) {
572 }
574 CHKERR DMMoFEMSetIsPartitioned(dM, is_partitioned);
576}
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
Definition DMMoFEM.cpp:1199
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
Definition DMMoFEM.cpp:574
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
Definition DMMoFEM.cpp:143
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.

◆ deleteDM()

MoFEMErrorCode MoFEM::Simple::deleteDM ( )

Delete dm.

Destroys the PETSc DM object and cleans up resources

Returns
MoFEMErrorCode Error code indicating success or failure
MoFEMErrorCode

Definition at line 814 of file Simple.cpp.

814 {
816 dM.reset();
818}

◆ deleteFiniteElements()

MoFEMErrorCode MoFEM::Simple::deleteFiniteElements ( )

Delete finite elements.

Removes all finite elements created by the Simple interface

Returns
MoFEMErrorCode Error code indicating success or failure
MoFEMErrorCode

Definition at line 825 of file Simple.cpp.

825 {
826 Interface &m_field = cOre;
828 for (auto fe : {domainFE, boundaryFE, skeletonFE}) {
829 if (m_field.check_finite_element(fe)) {
830 CHKERR m_field.delete_finite_element(fe);
831 }
832 }
834}
MoFEMErrorCode delete_finite_element(const std::string name, int verb=DEFAULT_VERBOSITY)
Delete finite element from MoFEM database.

◆ exchangeGhostCells()

MoFEMErrorCode MoFEM::Simple::exchangeGhostCells ( )
private

using higher order ents for bridge_dim results in MOAB stalling

get all adjacent ghosted entities

Definition at line 927 of file Simple.cpp.

927 {
928 Interface &m_field = cOre;
930 MOFEM_LOG("WORLD", Sev::verbose) << "Exchange ghost cells";
931
932 ParallelComm *pcomm =
933 ParallelComm::get_pcomm(&m_field.get_moab(), MYPCOMM_INDEX);
934 if (pcomm == NULL)
935 pcomm = new ParallelComm(&m_field.get_moab(), m_field.get_comm());
936
937 CHKERR pcomm->exchange_ghost_cells(
938 getDim(),
939 0, /**using higher order ents for bridge_dim results in MOAB stalling */
940 1, 3 /**get all adjacent ghosted entities */, true, true,
941 meshSet ? &meshSet : nullptr);
942
943 Range shared;
944 CHKERR m_field.get_moab().get_entities_by_dimension(0, dIm, shared);
945 for (auto d = dIm - 1; d >= 0; --d) {
946 CHKERR m_field.get_moab().get_adjacencies(shared, d, false, shared,
947 moab::Interface::UNION);
948 }
949 CHKERR pcomm->filter_pstatus(shared, PSTATUS_SHARED | PSTATUS_MULTISHARED,
950 PSTATUS_OR, -1, &shared);
951 Tag part_tag = pcomm->part_tag();
952 CHKERR pcomm->exchange_tags(part_tag, shared);
953 CHKERR m_field.getInterface<CommInterface>()->resolveParentEntities(shared,
954 VERBOSE);
955
957}
@ VERBOSE
int getDim() const
Get the problem dimension.
Definition Simple.hpp:373

◆ getAddBoundaryFE()

bool & MoFEM::Simple::getAddBoundaryFE ( )
inline

Get the addBoundaryFE flag.

If variable set to true, boundary element is created regardless of whether a field on boundary is added or not.

Returns
bool& Reference to flag indicating if boundary FE should be created
Examples
mofem/atom_tests/simple_l2_only.cpp.

Definition at line 546 of file Simple.hpp.

546{ return addBoundaryFE; }

◆ getAddSkeletonFE()

bool & MoFEM::Simple::getAddSkeletonFE ( )
inline

Get the addSkeletonFE flag.

If variable set to true, skeleton element is created regardless of whether a field on skeleton is added or not.

Returns
bool& Reference to flag indicating if skeleton FE should be created
Examples
mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/simple_l2_only.cpp, and mofem/tutorials/scl-12_electrostatics/electrostatics.cpp.

Definition at line 536 of file Simple.hpp.

536{ return addSkeletonFE; }

◆ getBitAdjEnt()

auto & MoFEM::Simple::getBitAdjEnt ( )
inline

Get bit ref level for entities.

Returns
auto& Reference to bit refinement level for entity adjacencies

Definition at line 576 of file Simple.hpp.

576{ return bitAdjEnt; }

◆ getBitAdjEntMask()

auto & MoFEM::Simple::getBitAdjEntMask ( )
inline

Get bit ref level mask for entities.

Returns
auto& Reference to bit refinement level mask for entity adjacencies

Definition at line 583 of file Simple.hpp.

583{ return bitAdjEntMask; }

◆ getBitAdjParent()

auto & MoFEM::Simple::getBitAdjParent ( )
inline

Get bit ref level for parent.

Returns
auto& Reference to bit refinement level for parent adjacencies

Definition at line 562 of file Simple.hpp.

562{ return bitAdjParent; }

◆ getBitAdjParentMask()

auto & MoFEM::Simple::getBitAdjParentMask ( )
inline

Get bit ref level mask for parent.

Returns
auto& Reference to bit refinement level mask for parent adjacencies

Definition at line 569 of file Simple.hpp.

569{ return bitAdjParentMask; }

◆ getBitRefLevel()

BitRefLevel & MoFEM::Simple::getBitRefLevel ( )
inline

◆ getBitRefLevelMask()

BitRefLevel & MoFEM::Simple::getBitRefLevelMask ( )
inline

Get the BitRefLevelMask.

Returns
BitRefLevel& Reference to bit refinement level mask
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/hanging_node_approx.cpp, and mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp.

Definition at line 422 of file Simple.hpp.

422{ return bitLevelMask; }

◆ getBoundaryFEName() [1/2]

std::string & MoFEM::Simple::getBoundaryFEName ( )
inline

Get the Boundary FE Name.

Returns
std::string&

Definition at line 464 of file Simple.hpp.

464{ return boundaryFE; }

◆ getBoundaryFEName() [2/2]

const std::string MoFEM::Simple::getBoundaryFEName ( ) const
inline

Get the Boundary FE Name.

Returns
const std::string
Examples
mofem/atom_tests/simple_interface.cpp, mofem/tools/mesh_smoothing.cpp, and mofem/tutorials/mix-1_light_intensity_equation/phase.cpp.

Definition at line 436 of file Simple.hpp.

436{ return boundaryFE; }

◆ getBoundaryMeshSet()

EntityHandle & MoFEM::Simple::getBoundaryMeshSet ( )
inline

Get the BoundaryMeshSet object.

Returns
EntityHandle& Reference to boundary meshset handle
Examples
mofem/atom_tests/hanging_node_approx.cpp.

Definition at line 401 of file Simple.hpp.

401{ return boundaryMeshset; }

◆ getDim()

int MoFEM::Simple::getDim ( ) const
inline

Get the problem dimension.

Problem dimension is determined by highest dimension of entities on the mesh.

Returns
int Problem dimension (1D, 2D, or 3D)
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/field_evaluator.cpp, and mofem/atom_tests/hanging_node_approx.cpp.

Definition at line 373 of file Simple.hpp.

373{ return dIm; }

◆ getDM() [1/2]

SmartPetscObj< DM > MoFEM::Simple::getDM ( )
inline

Return smart DM object.

Returns a smart pointer to the DM object that handles automatic cleanup

{
auto dm = simple_interface->getDM();
// ...
// dm is automatically destroyed when out of the scope
}
Returns
SmartPetscObj<DM> Smart pointer to DM object

Definition at line 363 of file Simple.hpp.

363{ return dM; }

◆ getDM() [2/2]

MoFEMErrorCode MoFEM::Simple::getDM ( DM *  dm)

Get DM.

Retrieves the PETSc Discrete Manager (DM) object

Parameters
dmPointer to store the DM object
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/loop_entities.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-3_level_set/level_set.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-5_free_surface/free_surface.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_element.cpp, and mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 802 of file Simple.cpp.

802 {
804 CHKERR PetscObjectReference(getPetscObject(dM.get()));
805 *dm = dM.get();
807}
PetscObject getPetscObject(T obj)

◆ getDomainFEName() [1/2]

std::string & MoFEM::Simple::getDomainFEName ( )
inline

Get the Domain FE Name.

Returns
std::string&

Definition at line 457 of file Simple.hpp.

457{ return domainFE; }

◆ getDomainFEName() [2/2]

const std::string MoFEM::Simple::getDomainFEName ( ) const
inline

◆ getMeshSet()

DEPRECATED EntityHandle & MoFEM::Simple::getMeshSet ( )
inline
Deprecated:
Use getMeshset
Returns
EntityHandle& Reference to domain meshset handle

Definition at line 387 of file Simple.hpp.

387{ return meshSet; }

◆ getMeshset()

EntityHandle & MoFEM::Simple::getMeshset ( )
inline

Get the MeshSet object.

Returns
EntityHandle& Reference to domain meshset handle
Examples
mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp.

Definition at line 394 of file Simple.hpp.

394{ return meshSet; }

◆ getMeshsetFEName()

std::string & MoFEM::Simple::getMeshsetFEName ( )
inline

Get the Skeleton FE Name.

Returns
std::string&
Examples
mofem/atom_tests/simple_interface.cpp.

Definition at line 478 of file Simple.hpp.

478{ return meshsetFE; }

◆ getMeshsetFiniteElementEntities()

auto & MoFEM::Simple::getMeshsetFiniteElementEntities ( )
inline

Range of entities added to meshset finite element.

Meshset element have not defined integration rule, if you like to integrate you have to add mesh entity to meshset finite element. In principle meshset element become standard FE.

Returns
std::vector<std::string>&
Examples
mofem/atom_tests/simple_interface.cpp, and mofem/atom_tests/simple_l2_only.cpp.

Definition at line 489 of file Simple.hpp.

489 {
491 }

◆ getOptions()

MoFEMErrorCode MoFEM::Simple::getOptions ( )

get options

Retrieves command-line options and configuration settings for the Simple interface

Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/boundary_marker.cpp, mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/loop_entities.cpp, mofem/atom_tests/operators_tester_direction.cpp, mofem/atom_tests/operators_tests.cpp, mofem/atom_tests/schur_test_diag_mat.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/simple_l2_only.cpp, mofem/atom_tests/tensor_divergence_operator.cpp, mofem/atom_tests/test_broken_space.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-3_level_set/level_set.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-5_poroelasticity/seepage.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/fun-1_integration/integration.cpp, mofem/tutorials/fun-2_plot_base/plot_base.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/approx_sphere.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-6_dg_kirchhoff_plate/plate.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/adolc-plasticity/adolc_plasticity.cpp, mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_element.cpp, and mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 180 of file Simple.cpp.

180 {
181 PetscBool flg = PETSC_TRUE;
183 PetscOptionsBegin(PETSC_COMM_WORLD, "", "Simple interface options",
184 "none");
185 ierr = PetscOptionsString("-file_name", "file name", "", "mesh.h5m",
186 meshFileName, sizeof(meshFileName), &flg);
187 PetscOptionsEnd();
189}
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr

◆ getOtherFiniteElements()

std::vector< std::string > & MoFEM::Simple::getOtherFiniteElements ( )
inline

Get the Other Finite Elements.

User can create finite elements using directly core interface and and them to simple problem by this function

Returns
std::vector<std::string>&
Examples
mofem/tools/mesh_smoothing.cpp.

Definition at line 508 of file Simple.hpp.

508{ return otherFEs; }

◆ getParentAdjacencies()

bool & MoFEM::Simple::getParentAdjacencies ( )
inline

Get the addParentAdjacencies flag.

If set true, parent adjacencies are added to finite elements

Returns
bool& Reference to flag indicating if parent adjacencies should be added
Examples
mofem/atom_tests/hanging_node_approx.cpp, and mofem/tutorials/vec-5_free_surface/free_surface.cpp.

Definition at line 555 of file Simple.hpp.

555{ return addParentAdjacencies; }

◆ getProblemName() [1/2]

std::string & MoFEM::Simple::getProblemName ( )
inline

Get the Problem Name.

Returns
std::string&

Definition at line 498 of file Simple.hpp.

498{ return nameOfProblem; }

◆ getProblemName() [2/2]

const std::string MoFEM::Simple::getProblemName ( ) const
inline

◆ getSkeletonFEName() [1/2]

std::string & MoFEM::Simple::getSkeletonFEName ( )
inline

Get the Skeleton FE Name.

Returns
std::string&

Definition at line 471 of file Simple.hpp.

471{ return skeletonFE; }

◆ getSkeletonFEName() [2/2]

const std::string MoFEM::Simple::getSkeletonFEName ( ) const
inline

◆ getSkeletonMeshSet()

EntityHandle & MoFEM::Simple::getSkeletonMeshSet ( )
inline

Get the SkeletonMeshSet object.

Returns
EntityHandle& Reference to skeleton meshset handle

Definition at line 408 of file Simple.hpp.

408{ return skeletonMeshset; }

◆ loadFile() [1/2]

MoFEMErrorCode MoFEM::Simple::loadFile ( const std::string  mesh_file_name = "")

Load mesh file with parallel options if number of cores > 1.

Automatically selects appropriate loading options for parallel execution

Parameters
mesh_file_nameName of mesh file to load (if empty, uses default or command line value)
Returns
MoFEMErrorCode Error code indicating success or failure

Definition at line 250 of file Simple.cpp.

250 {
252 Interface &m_field = cOre;
253 if (m_field.get_comm_size() == 1)
255 else
256 CHKERR loadFile("PARALLEL=READ_PART;"
257 "PARALLEL_RESOLVE_SHARED_ENTS;"
258 "PARTITION=PARALLEL_PARTITION;",
261}
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
Definition Simple.cpp:191

◆ loadFile() [2/2]

MoFEMErrorCode MoFEM::Simple::loadFile ( const std::string  options,
const std::string  mesh_file_name,
LoadFileFunc  loadFunc = defaultLoadFileFunc 
)

Load mesh file.

Loads mesh file with specified options and custom loading function

Parameters
optionsFile load options string passed to the loader
mesh_file_nameName of mesh file to load (if empty, uses default or command line)
loadFuncFunction for loading mesh file (default: defaultLoadFileFunc)
Note
If bitRefLevel is set to any, bit ref level of loaded entities is not changed. After mesh is load, bit ref level should be set to create problem. Default setting of bit ref level is on first bit, and if is set all mesh entities on load are set to set level.
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/loop_entities.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/simple_l2_only.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/fun-1_integration/integration.cpp, mofem/tutorials/fun-2_plot_base/plot_base.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_element.cpp, and mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 191 of file Simple.cpp.

193 {
194 Interface &m_field = cOre;
196 PetscLogEventBegin(MOFEM_EVENT_SimpleLoadMesh, 0, 0, 0, 0);
197
198 if (mesh_file_name.size() >= sizeof(meshFileName))
199 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
200 "Mesh file name exceeds PETSC_MAX_PATH_LEN");
201 if (!mesh_file_name.empty())
202 strcpy(meshFileName, mesh_file_name.c_str());
203
204 // Invoke the boost function, passing in required arguments
205 CHKERR loadFunc(m_field, meshFileName, options.c_str());
206 CHKERR m_field.rebuild_database();
207
208 // determine problem dimension
209 if (dIm == -1) {
210 int nb_ents_3d;
211 CHKERR m_field.get_moab().get_number_entities_by_dimension(
212 meshSet, 3, nb_ents_3d, true);
213 if (nb_ents_3d > 0) {
214 dIm = 3;
215 } else {
216 int nb_ents_2d;
217 CHKERR m_field.get_moab().get_number_entities_by_dimension(
218 meshSet, 2, nb_ents_2d, true);
219 if (nb_ents_2d > 0) {
220 dIm = 2;
221 } else {
222 dIm = 1;
223 }
224 }
225 }
226
227 if (!boundaryMeshset)
229 if (!skeletonMeshset)
231 if (addSkeletonFE)
233
234 if (bitLevel.any()) {
235 Range ents;
236 CHKERR m_field.get_moab().get_entities_by_dimension(meshSet, dIm, ents,
237 true);
238 CHKERR m_field.getInterface<BitRefManager>()->setBitRefLevel(ents, bitLevel,
239 false);
240 } else {
241 MOFEM_LOG("WORLD", Sev::warning) << "BitRefLevel is none and not set";
242 CHKERR m_field.getInterface<BitRefManager>()->addToDatabaseBitRefLevelByDim(
243 dIm, BitRefLevel().set(), BitRefLevel().set());
244 }
245
246 PetscLogEventEnd(MOFEM_EVENT_SimpleLoadMesh, 0, 0, 0, 0);
248}
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
MoFEMErrorCode exchangeGhostCells()
Definition Simple.cpp:927
MoFEMErrorCode createBoundaryMeshset()
Definition Simple.cpp:846
MoFEMErrorCode createSkeletonMeshset()
Definition Simple.cpp:893

◆ query_interface()

MoFEMErrorCode MoFEM::Simple::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 8 of file Simple.cpp.

9 {
10 *iface = const_cast<Simple *>(this);
11 return 0;
12}
Simple(const MoFEM::Core &core)
Definition Simple.cpp:162

◆ removeBoundaryField()

MoFEMErrorCode MoFEM::Simple::removeBoundaryField ( const std::string  name)

Remove field from boundary.

Parameters
nameName of the field to remove from boundary
Returns
MoFEMErrorCode Error code indicating success or failure

Definition at line 446 of file Simple.cpp.

446 {
448
449 auto remove_field_from_list = [&](auto &vec) {
450 auto it = std::find(vec.begin(), vec.end(), name);
451 if (it != vec.end())
452 vec.erase(it);
453 };
454
455 remove_field_from_list(boundaryFields);
456
458}
It it
Definition Schur.cpp:2568

◆ removeDomainField()

MoFEMErrorCode MoFEM::Simple::removeDomainField ( const std::string  name)

Remove field from domain.

Parameters
nameName of the field to remove from domain
Returns
MoFEMErrorCode Error code indicating success or failure

Definition at line 432 of file Simple.cpp.

432 {
434
435 auto remove_field_from_list = [&](auto &vec) {
436 auto it = std::find(vec.begin(), vec.end(), name);
437 if (it != vec.end())
438 vec.erase(it);
439 };
440
441 remove_field_from_list(domainFields);
442
444}

◆ removeSkeletonField()

MoFEMErrorCode MoFEM::Simple::removeSkeletonField ( const std::string  name)

Remove field from skeleton.

Parameters
nameName of the field to remove from skeleton
Returns
MoFEMErrorCode Error code indicating success or failure

Definition at line 460 of file Simple.cpp.

460 {
462
463 auto remove_field_from_list = [&](auto &vec) {
464 auto it = std::find(vec.begin(), vec.end(), name);
465 if (it != vec.end())
466 vec.erase(it);
467 };
468
469 remove_field_from_list(skeletonFields);
470
472}

◆ reSetUp()

MoFEMErrorCode MoFEM::Simple::reSetUp ( bool  only_dm = false)

Rebuild internal MoFEM data structures.

Call this function after you add field or remove it.

Note
If you add field, or remove it, finite element and problem needs to be rebuild. However DM can remain the same.
Parameters
only_dmIf true, only rebuild DM without rebuilding fields and finite elements
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/child_and_parent.cpp, and mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp.

Definition at line 764 of file Simple.cpp.

764 {
765 Interface &m_field = cOre;
767 PetscLogEventBegin(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
768
769 if (!only_dm) {
772 if (addSkeletonFE || !skeletonFields.empty()) {
774 if (addBoundaryFE || !boundaryFields.empty()) {
776 }
777 }
781 }
782
783 CHKERR m_field.build_adjacencies(bitLevel, bitLevelMask);
784
785 const Problem *problem_ptr;
786 CHKERR DMMoFEMGetProblemPtr(dM, &problem_ptr);
787 const auto problem_name = problem_ptr->getName();
788 CHKERR m_field.modify_problem_ref_level_set_bit(problem_name, bitLevel);
789 CHKERR m_field.modify_problem_mask_ref_level_set_bit(problem_name,
791
792 // Set problem by the DOFs on the fields rather that by adding DOFs on the
793 // elements
794 m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_TRUE;
796 m_field.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_FALSE;
797
798 PetscLogEventEnd(MOFEM_EVENT_SimpleBuildProblem, 0, 0, 0, 0);
800}
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition DMMoFEM.cpp:451
MoFEMErrorCode setParentAdjacency()
Definition Simple.cpp:67
MoFEMErrorCode defineFiniteElements()
Define finite elements.
Definition Simple.cpp:474
MoFEMErrorCode buildFiniteElements()
Build finite elements.
Definition Simple.cpp:662
MoFEMErrorCode buildFields()
Build fields.
Definition Simple.cpp:587
MoFEMErrorCode setSkeletonAdjacency(int dim=-1, std::string fe_name="")
Set the skeleton adjacency object.
Definition Simple.cpp:143

◆ setDim()

void MoFEM::Simple::setDim ( int  dim)
inline

Set the problem dimension.

Parameters
dimProblem dimension to set (1, 2, or 3)
Examples
mofem/tutorials/fun-2_plot_base/plot_base.cpp.

Definition at line 380 of file Simple.hpp.

380{ dIm = dim; };

◆ setFieldOrder()

MoFEMErrorCode MoFEM::Simple::setFieldOrder ( const std::string  field_name,
const int  order,
const Range *  ents = NULL 
)

Set field order.

Sets the approximation order for a field on specified entities

Parameters
field_nameName of the field
orderApproximation order to set
entsRange of entities to apply order to (NULL for all entities)
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/loop_entities.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/simple_l2_only.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-6_simple_elasticity/simple_elasticity.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/fun-1_integration/integration.cpp, mofem/tutorials/fun-2_plot_base/plot_base.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_element.cpp, and mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 578 of file Simple.cpp.

579 {
581 fieldsOrder.emplace_back(field_name, order,
582 ents == NULL ? Range() : Range(*ents),
583 ents == NULL ? false : true);
585}
constexpr auto field_name

◆ setParentAdjacency() [1/4]

template<>
MoFEMErrorCode MoFEM::Simple::setParentAdjacency ( )
private

Definition at line 72 of file Simple.cpp.

72 {
73 Interface &m_field = cOre;
75
77 boost::make_shared<ParentFiniteElementAdjacencyFunction<3>>(
80 boost::make_shared<ParentFiniteElementAdjacencyFunction<2>>(
82
85 CHKERR m_field.modify_finite_element_adjacency_table(domainFE, MBHEX,
87 if (addBoundaryFE || !boundaryFields.empty()) {
88 CHKERR m_field.modify_finite_element_adjacency_table(
90 CHKERR m_field.modify_finite_element_adjacency_table(
92 }
93 if (addSkeletonFE || !skeletonFields.empty()) {
94 CHKERR m_field.modify_finite_element_adjacency_table(
96 CHKERR m_field.modify_finite_element_adjacency_table(
98 }
99
101}
MoFEMErrorCode modify_finite_element_adjacency_table(const std::string &fe_name, const EntityType type, ElementAdjacencyFunct function)
modify finite element table, only for advanced user
Definition FECore.cpp:117
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 2 > > parentAdjFunctionDim2
Definition Simple.hpp:665
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 3 > > parentAdjFunctionDim3
Definition Simple.hpp:663

◆ setParentAdjacency() [2/4]

template<>
MoFEMErrorCode MoFEM::Simple::setParentAdjacency ( )
private

Definition at line 103 of file Simple.cpp.

103 {
104 Interface &m_field = cOre;
106
108 boost::make_shared<ParentFiniteElementAdjacencyFunction<2>>(
111 boost::make_shared<ParentFiniteElementAdjacencyFunction<1>>(
113
116 CHKERR m_field.modify_finite_element_adjacency_table(domainFE, MBQUAD,
118 if (addBoundaryFE || !boundaryFields.empty())
119 CHKERR m_field.modify_finite_element_adjacency_table(
121 if (addSkeletonFE || !skeletonFields.empty())
122 CHKERR m_field.modify_finite_element_adjacency_table(
124
126}
boost::shared_ptr< ParentFiniteElementAdjacencyFunction< 1 > > parentAdjFunctionDim1
Definition Simple.hpp:667

◆ setParentAdjacency() [3/4]

template<>
MoFEMErrorCode MoFEM::Simple::setParentAdjacency ( )
private

Definition at line 128 of file Simple.cpp.

128 {
130 switch (getDim()) {
131 case 1:
132 THROW_MESSAGE("Not implemented");
133 case 2:
134 return setParentAdjacency<2>();
135 case 3:
136 return setParentAdjacency<3>();
137 default:
138 THROW_MESSAGE("Not implemented");
139 }
141}
#define THROW_MESSAGE(msg)
Throw MoFEM exception.

◆ setParentAdjacency() [4/4]

template<int DIM>
MoFEMErrorCode MoFEM::Simple::setParentAdjacency ( )
private

Definition at line 67 of file Simple.cpp.

67 {
68 static_assert(DIM == 2 || DIM == 3, "not implemented");
70}

◆ setSkeletonAdjacency() [1/5]

MoFEMErrorCode MoFEM::Simple::setSkeletonAdjacency ( int  dim = -1,
std::string  fe_name = "" 
)

Set the skeleton adjacency object.

Sets up adjacency relationships for skeleton finite elements

Parameters
dimDimension for skeleton adjacency (-1 for automatic detection)
fe_nameName of finite element to set adjacency for (empty for default)
Returns
MoFEMErrorCode Error code indicating success or failure

Definition at line 143 of file Simple.cpp.

143 {
145 if (dim == -1)
146 dim = getDim();
147
148 if (fe_name.empty())
149 fe_name = skeletonFE;
150
151 switch (dim) {
152 case 2:
153 return setSkeletonAdjacency<2>(fe_name);
154 case 3:
155 return setSkeletonAdjacency<3>(fe_name);
156 default:
157 SETERRQ(PETSC_COMM_WORLD, MOFEM_NOT_IMPLEMENTED, "Not implemented");
158 }
160}

◆ setSkeletonAdjacency() [2/5]

template<>
MoFEMErrorCode MoFEM::Simple::setSkeletonAdjacency ( std::string  fe_name)
private

Definition at line 21 of file Simple.cpp.

21 {
22 Interface &m_field = cOre;
24
26 boost::make_shared<ParentFiniteElementAdjacencyFunctionSkeleton<1>>(
29 fe_name, MBEDGE, *parentAdjSkeletonFunctionDim1);
30
32}
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 1 > > parentAdjSkeletonFunctionDim1
Definition Simple.hpp:672

◆ setSkeletonAdjacency() [3/5]

template<>
MoFEMErrorCode MoFEM::Simple::setSkeletonAdjacency ( std::string  fe_name)
private

Definition at line 35 of file Simple.cpp.

35 {
36 Interface &m_field = cOre;
38
40 boost::make_shared<ParentFiniteElementAdjacencyFunctionSkeleton<2>>(
42
44 fe_name, MBTRI, *parentAdjSkeletonFunctionDim2);
45 CHKERR m_field.modify_finite_element_adjacency_table(
46 fe_name, MBQUAD, *parentAdjSkeletonFunctionDim2);
47
49}
boost::shared_ptr< ParentFiniteElementAdjacencyFunctionSkeleton< 2 > > parentAdjSkeletonFunctionDim2
Definition Simple.hpp:670

◆ setSkeletonAdjacency() [4/5]

template<>
MoFEMErrorCode MoFEM::Simple::setSkeletonAdjacency ( std::string  fe_name)
private

Definition at line 52 of file Simple.cpp.

52 {
54
55 switch (getDim()) {
56 case 1:
57 THROW_MESSAGE("Not implemented");
58 case 2:
59 return setSkeletonAdjacency<2>(fe_name);
60 case 3:
61 return setSkeletonAdjacency<3>(fe_name);
62 default:
63 THROW_MESSAGE("Not implemented");
64 }
66}

◆ setSkeletonAdjacency() [5/5]

template<int DIM>
MoFEMErrorCode MoFEM::Simple::setSkeletonAdjacency ( std::string  fe_name)
private

Definition at line 15 of file Simple.cpp.

15 {
16 static_assert(DIM == 2 || DIM == 3, "not implemented");
18}

◆ setUp()

MoFEMErrorCode MoFEM::Simple::setUp ( const PetscBool  is_partitioned = PETSC_TRUE)

Setup problem.

Complete setup of the problem including fields, finite elements, and problem definition

Parameters
is_partitionedWhether the mesh should be partitioned for parallel execution
Returns
MoFEMErrorCode Error code indicating success or failure
Examples
mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/loop_entities.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/simple_l2_only.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-4_dynamic_first_order_con_law/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/clx-0_acoustics/helmholtz.cpp, mofem/tutorials/cor-9_reaction_diffusion/reaction_diffusion.cpp, mofem/tutorials/fun-1_integration/integration.cpp, mofem/tutorials/fun-2_plot_base/plot_base.cpp, mofem/tutorials/mix-0_mixed_poisson/mixed_poisson.cpp, mofem/tutorials/mix-1_light_intensity_equation/phase.cpp, mofem/tutorials/scl-0_least_squares/approximation.cpp, mofem/tutorials/scl-12_electrostatics/electrostatics.cpp, mofem/tutorials/scl-1_poisson_2d_homogeneous/poisson_2d_homogeneous.cpp, mofem/tutorials/scl-8_heat_radiation/radiation.cpp, mofem/tutorials/scl-9_heat_method/heat_method.cpp, mofem/tutorials/vec-1_eigen_elasticity/eigen_elastic.cpp, mofem/tutorials/vec-3_nonlinear_dynamics/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4_shallow_wave/shallow_wave.cpp, mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp, mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_element.cpp, and mofem/users_modules/basic_finite_elements/atom_tests/testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 738 of file Simple.cpp.

738 {
740
741 PetscLogEventBegin(MOFEM_EVENT_SimpleSetUP, 0, 0, 0, 0);
742
744
745 if (addSkeletonFE || !skeletonFields.empty()) {
747 if (addBoundaryFE || !boundaryFields.empty()) {
749 }
750 }
751
754
755 CHKERR defineProblem(is_partitioned);
759
760 PetscLogEventEnd(MOFEM_EVENT_SimpleSetUP, 0, 0, 0, 0);
762}
MoFEMErrorCode buildProblem()
Build problem.
Definition Simple.cpp:724
MoFEMErrorCode defineProblem(const PetscBool is_partitioned=PETSC_TRUE)
define problem
Definition Simple.cpp:554

Member Data Documentation

◆ addBoundaryFE

bool MoFEM::Simple::addBoundaryFE
private

Add boundary FE.

Definition at line 617 of file Simple.hpp.

◆ addParentAdjacencies

bool MoFEM::Simple::addParentAdjacencies
private

If set to true parent adjacencies are build.

Definition at line 618 of file Simple.hpp.

◆ addSkeletonFE

bool MoFEM::Simple::addSkeletonFE
private

Add skeleton FE.

Definition at line 616 of file Simple.hpp.

◆ bitAdjEnt

BitRefLevel MoFEM::Simple::bitAdjEnt
private

bit ref level for parent

Definition at line 622 of file Simple.hpp.

◆ bitAdjEntMask

BitRefLevel MoFEM::Simple::bitAdjEntMask
private

bit ref level for parent parent

Definition at line 623 of file Simple.hpp.

◆ bitAdjParent

BitRefLevel MoFEM::Simple::bitAdjParent
private

bit ref level for parent

Definition at line 620 of file Simple.hpp.

◆ bitAdjParentMask

BitRefLevel MoFEM::Simple::bitAdjParentMask
private

bit ref level for parent parent

Definition at line 621 of file Simple.hpp.

◆ bitLevel

BitRefLevel MoFEM::Simple::bitLevel
private

BitRefLevel of the problem.

Definition at line 602 of file Simple.hpp.

◆ bitLevelMask

BitRefLevel MoFEM::Simple::bitLevelMask
private

BitRefLevel of the problem.

Definition at line 603 of file Simple.hpp.

◆ boundaryFE

std::string MoFEM::Simple::boundaryFE = "bFE"
private

boundary finite element

Definition at line 639 of file Simple.hpp.

◆ boundaryFields

std::vector<std::string> MoFEM::Simple::boundaryFields
private

boundary fields

Definition at line 626 of file Simple.hpp.

◆ boundaryMeshset

EntityHandle MoFEM::Simple::boundaryMeshset
private

meshset with boundary

Definition at line 613 of file Simple.hpp.

◆ cOre

MoFEM::Core& MoFEM::Simple::cOre
private

Definition at line 600 of file Simple.hpp.

◆ dataFields

std::vector<std::string> MoFEM::Simple::dataFields
private

Data fields.

Definition at line 628 of file Simple.hpp.

◆ dIm

int MoFEM::Simple::dIm
private

dimension of problem

Definition at line 648 of file Simple.hpp.

◆ dM

SmartPetscObj<DM> MoFEM::Simple::dM
private

Discrete manager (interface to PETSc/MoFEM functions)

Definition at line 651 of file Simple.hpp.

◆ domainFE

std::string MoFEM::Simple::domainFE = "dFE"
private

domain finite element

Definition at line 638 of file Simple.hpp.

◆ domainFields

std::vector<std::string> MoFEM::Simple::domainFields
private

domain fields

Definition at line 625 of file Simple.hpp.

◆ fieldsOrder

std::list<std::tuple<std::string, int, Range, bool> > MoFEM::Simple::fieldsOrder
private

fields order. 1: field name, order, range, set by range if true

Definition at line 634 of file Simple.hpp.

◆ meshFileName

char MoFEM::Simple::meshFileName[PETSC_MAX_PATH_LEN]
private

mesh file name

Definition at line 647 of file Simple.hpp.

◆ meshSet

EntityHandle MoFEM::Simple::meshSet
private

domain meshset

Definition at line 612 of file Simple.hpp.

◆ meshsetFE

std::string MoFEM::Simple::meshsetFE = "mFE"
private

meshset finite element

Definition at line 641 of file Simple.hpp.

◆ meshsetFields

std::vector<std::string> MoFEM::Simple::meshsetFields
private

meshset fields

Definition at line 629 of file Simple.hpp.

◆ meshsetFiniteElementEntities

std::vector<Range> MoFEM::Simple::meshsetFiniteElementEntities
private

Meshset element entities.

Definition at line 645 of file Simple.hpp.

◆ MOFEM_EVENT_SimpleBuildFields

PetscLogEvent MoFEM::Simple::MOFEM_EVENT_SimpleBuildFields
private

Definition at line 607 of file Simple.hpp.

◆ MOFEM_EVENT_SimpleBuildFiniteElements

PetscLogEvent MoFEM::Simple::MOFEM_EVENT_SimpleBuildFiniteElements
private

Definition at line 608 of file Simple.hpp.

◆ MOFEM_EVENT_SimpleBuildProblem

PetscLogEvent MoFEM::Simple::MOFEM_EVENT_SimpleBuildProblem
private

Definition at line 609 of file Simple.hpp.

◆ MOFEM_EVENT_SimpleKSPSolve

PetscLogEvent MoFEM::Simple::MOFEM_EVENT_SimpleKSPSolve
private

Definition at line 610 of file Simple.hpp.

◆ MOFEM_EVENT_SimpleLoadMesh

PetscLogEvent MoFEM::Simple::MOFEM_EVENT_SimpleLoadMesh
private

Definition at line 606 of file Simple.hpp.

◆ MOFEM_EVENT_SimpleSetUP

PetscLogEvent MoFEM::Simple::MOFEM_EVENT_SimpleSetUP
private

Definition at line 605 of file Simple.hpp.

◆ nameOfProblem

std::string MoFEM::Simple::nameOfProblem = "SimpleProblem"
private

problem name

Definition at line 637 of file Simple.hpp.

◆ noFieldDataFields

std::vector<std::string> MoFEM::Simple::noFieldDataFields
private

NOFIELD field name.

Definition at line 631 of file Simple.hpp.

◆ noFieldFields

std::vector<std::string> MoFEM::Simple::noFieldFields
private

NOFIELD field name.

Definition at line 630 of file Simple.hpp.

◆ otherFEs

std::vector<std::string> MoFEM::Simple::otherFEs
private

Other finite elements.

Definition at line 643 of file Simple.hpp.

◆ parentAdjFunctionDim1

boost::shared_ptr<ParentFiniteElementAdjacencyFunction<1> > MoFEM::Simple::parentAdjFunctionDim1
private

Definition at line 667 of file Simple.hpp.

◆ parentAdjFunctionDim2

boost::shared_ptr<ParentFiniteElementAdjacencyFunction<2> > MoFEM::Simple::parentAdjFunctionDim2
private

Definition at line 665 of file Simple.hpp.

◆ parentAdjFunctionDim3

boost::shared_ptr<ParentFiniteElementAdjacencyFunction<3> > MoFEM::Simple::parentAdjFunctionDim3
private

Definition at line 663 of file Simple.hpp.

◆ parentAdjSkeletonFunctionDim1

boost::shared_ptr<ParentFiniteElementAdjacencyFunctionSkeleton<1> > MoFEM::Simple::parentAdjSkeletonFunctionDim1
private

Definition at line 672 of file Simple.hpp.

◆ parentAdjSkeletonFunctionDim2

boost::shared_ptr<ParentFiniteElementAdjacencyFunctionSkeleton<2> > MoFEM::Simple::parentAdjSkeletonFunctionDim2
private

Definition at line 670 of file Simple.hpp.

◆ skeletonFE

std::string MoFEM::Simple::skeletonFE = "sFE"
private

skeleton finite element

Definition at line 640 of file Simple.hpp.

◆ skeletonFields

std::vector<std::string> MoFEM::Simple::skeletonFields
private

fields on the skeleton

Definition at line 627 of file Simple.hpp.

◆ skeletonMeshset

EntityHandle MoFEM::Simple::skeletonMeshset
private

skeleton meshset with boundary

Definition at line 614 of file Simple.hpp.


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