v0.14.0
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
MoFEM::CoreTmp< 0 > Struct Reference

Core (interface) class. More...

#include <src/interfaces/Core.hpp>

Inheritance diagram for MoFEM::CoreTmp< 0 >:
[legend]
Collaboration diagram for MoFEM::CoreTmp< 0 >:
[legend]

Public Member Functions

const int getValue () const
 Get the core. More...
 
RefEntityTmp< 0 > getRefEntity (const EntityHandle ent)
 
virtual boost::shared_ptr< RefEntityTmp< 0 > > make_shared_ref_entity (const EntityHandle ent)
 Get RefEntity. More...
 
 CoreTmp (moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
 
 ~CoreTmp ()
 
- Public Member Functions inherited from MoFEM::DeprecatedCoreInterface
virtual DEPRECATED MoFEMErrorCode seed_ref_level_2D (const EntityHandle meshset, const BitRefLevel &bit, int verb=-1)
 seed 2D entities (Triangles entities only) in the meshset and their adjacencies (only TRIs adjacencies) in a particular BitRefLevel More...
 
DEPRECATED MoFEMErrorCode seed_ref_level_3D (const EntityHandle meshset, const BitRefLevel &bit, int verb=-1)
 seed 2D entities in the meshset and their adjacencies (only TETs adjacencies) in a particular BitRefLevel More...
 
DEPRECATED MoFEMErrorCode seed_ref_level (const Range &ents, const BitRefLevel &bit, const bool only_tets=true, int verb=-1)
 seed entities in the range and their adjacencies in a particular BitRefLevel More...
 
DEPRECATED MoFEMErrorCode partition_mesh (const Range &ents, const int dim, const int adj_dim, const int n_parts, int verb=-1)
 Set partition tag to each finite element in the problem. More...
 
DEPRECATED MoFEMErrorCode synchronise_entities (Range &ent, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode synchronise_field_entities (const std::string &name, int verb=DEFAULT_VERBOSITY)
 
- Public Member Functions inherited from MoFEM::CoreInterface
virtual ~CoreInterface ()=default
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 

Static Public Attributes

static constexpr int value = 0
 

Protected Member Functions

template<int V>
 CoreTmp (moab::Interface &moab, MPI_Comm comm, const int verbose, CoreValue< V >)
 
MoFEMErrorCode coreGenericConstructor (moab::Interface &moab, MPI_Comm comm, const int verbose)
 
MoFEMErrorCode addProblem (const BitProblemId id, const std::string &name, int verb=DEFAULT_VERBOSITY)
 add problem More...
 
MoFEMErrorCode getTags (int verb=DEFAULT_VERBOSITY)
 Get tag handles. More...
 
MoFEMErrorCode clearMap ()
 Cleaning database. More...
 
MoFEMErrorCode registerSubInterfaces ()
 Register insterfaces. More...
 
BitProblemId getProblemShift ()
 Return unique problem Id. More...
 
MoFEMErrorCode initialiseDatabaseFromMesh (int verb=DEFAULT_VERBOSITY)
 Initialize database getting information on mesh. More...
 
MoFEMErrorCode getOptions (int verb=DEFAULT_VERBOSITY)
 Get core options from command line. More...
 
template<class IFACE >
MoFEMErrorCode regSubInterface ()
 Register subinterfac in core interface. More...
 

Protected Attributes

boost::shared_ptr< WrapMPICommwrapMPIMOABComm
 manage creation and destruction of MOAB communicator More...
 
int verbose
 Verbosity level. More...
 
boost::ptr_map< boost::typeindex::type_index, UnknownInterfaceiFaces
 Hash map of pointers to interfaces. More...
 
int * buildMoFEM
 keeps flags/semaphores for different stages More...
 
std::string optionsPrefix
 Prefix for options on command line. More...
 
PetscBool initaliseAndBuildField
 
PetscBool initaliseAndBuildFiniteElements
 

Static Protected Attributes

static bool isGloballyInitialised = false
 Core base globally initialized. More...
 
static int mpiInitialised
 mpi was initialised by other agent More...
 
static PetscBool isInitialized
 petsc was initialised by other agent More...
 

Global initialisation and finalisation


static MoFEMErrorCode Initialize (int *argc, char ***args, const char file[], const char help[])
 Initializes the MoFEM database PETSc, MOAB and MPI. More...
 
static MoFEMErrorCode Finalize ()
 Checks for options to be called at the conclusion of the program. More...
 

Static functions

static void setRefEntBasicDataPtr (MoFEM::Interface &m_field, boost::shared_ptr< BasicEntityData > &ptr)
 
static boost::shared_ptr< RefEntityTmp< 0 > > makeSharedRefEntity (MoFEM::Interface &m_field, const EntityHandle ent)
 

Assessing interfaces

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 Getting interface of core database. More...
 

Get tag handles to data on the mesh

Tag get_th_RefParentHandle () const
 
Tag get_th_RefBitLevel () const
 
Tag get_th_RefBitEdge () const
 

Auxiliary data and functions

enum  SemaphoresBuildMofem {
  BUILD_FIELD = 1 << 0, BUILD_FE = 1 << 1, BUILD_ADJ = 1 << 2, BUILD_PROBLEM = 1 << 3,
  PARTITION_PROBLEM = 1 << 4, PARTITION_FE = 1 << 5, PARTITION_GHOST_DOFS = 1 << 6, PARTITION_MESH = 1 << 7
}
 
int & getBuildMoFEM () const
 Get flags/semaphores for different stages. More...
 
MoFEMErrorCode addPrismToDatabase (const EntityHandle prism, int verb=DEFAULT_VERBOSITY)
 add prim element More...
 

Tags to data on mesh and entities

Tag th_Part
 Tag for partition number. More...
 
Tag th_RefParentHandle
 
Tag th_RefBitLevel
 
Tag th_RefBitLevel_Mask
 
Tag th_RefBitEdge
 
Tag th_RefFEMeshset
 
Tag th_FieldId
 
Tag th_FieldName
 
Tag th_FieldName_DataNamePrefix
 
Tag th_FieldSpace
 
Tag th_FieldBase
 
Tag th_FEId
 
Tag th_FEName
 
Tag th_FEIdCol
 
Tag th_FEIdRow
 
Tag th_FEIdData
 
Tag th_ProblemId
 
Tag th_ProblemName
 
Tag th_ProblemFEId
 
Tag th_ProblemNbDofsRow
 
Tag th_ProblemNbDofsCol
 
Tag th_ProblemLocalNbDofRow
 
Tag th_ProblemGhostNbDofRow
 
Tag th_ProblemLocalNbDofCol
 
Tag th_ProblemGhostNbDofCol
 
Tag th_ProblemShift
 
Tag th_ElemType
 Needed for VTK files. More...
 
Tag th_MoFEMBuild
 
boost::shared_ptr< BasicEntityDatabasicEntityDataPtr
 
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr ()
 Get pointer to basic entity data. More...
 

Multi-Indices accessing data on the mesh

RefEntity_multiIndex refinedEntities
 refined entities More...
 
RefElement_multiIndex refinedFiniteElements
 refined elements More...
 
Field_multiIndex fIelds
 fields More...
 
FieldEntity_multiIndex entsFields
 entities on fields More...
 
DofEntity_multiIndex dofsField
 dofs on fields More...
 
FiniteElement_multiIndex finiteElements
 finite elements More...
 
EntFiniteElement_multiIndex entsFiniteElements
 finite element entities More...
 
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
 adjacencies of elements to dofs More...
 
Problem_multiIndex pRoblems
 problems multi-index More...
 

Get moab database

std::reference_wrapper< moab::Interface > moab
 moab database More...
 
moab::Interface & get_moab ()
 
const moab::Interface & get_moab () const
 
MoFEMErrorCode set_moab_interface (moab::Interface &new_moab, int verb=VERBOSE)
 Set the moab interface object. More...
 
MoFEMErrorCode setMoabInterface (moab::Interface &new_moab, int verb=VERBOSE)
 

Check database consistency

MoFEMErrorCode check_number_of_ents_in_ents_field (const std::string &name) const
 check data consistency in entitiesPtr More...
 
MoFEMErrorCode check_number_of_ents_in_ents_field () const
 check data consistency in entitiesPtr More...
 
MoFEMErrorCode check_number_of_ents_in_ents_finite_element (const std::string &name) const
 check data consistency in entsFiniteElements More...
 
MoFEMErrorCode check_number_of_ents_in_ents_finite_element () const
 check data consistency in entsFiniteElements More...
 

Clear database

MoFEMErrorCode clear_database (int verb=DEFAULT_VERBOSITY)
 Clear database. More...
 
MoFEMErrorCode rebuild_database (int verb=DEFAULT_VERBOSITY)
 Clear database and initialize it once again. More...
 

Getting access to meshset manager

MeshsetsManagerget_meshsets_manager_ptr ()
 get MeshsetsManager pointer More...
 
const MeshsetsManagerget_meshsets_manager_ptr () const
 get MeshsetsManager pointer More...
 
MeshsetsManagerget_meshsets_manager ()
 get MeshsetsManager pointer More...
 
const MeshsetsManagerget_meshsets_manager () const
 get MeshsetsManager pointer More...
 

Remove and delete entities

MoFEMErrorCode remove_parents_by_ents (const Range &ents, int verb=DEFAULT_VERBOSITY)
 Remove parents from entities. More...
 
MoFEMErrorCode remove_parents_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 Remove parent from entities on bit level. More...
 
MoFEMErrorCode remove_parents_by_parents (const Range &ents, int verb=DEFAULT_VERBOSITY)
 Remove paremts from entities having parents in passed range. More...
 
MoFEMErrorCode remove_ents (const Range ents, int verb=DEFAULT_VERBOSITY)
 remove entities form mofem database More...
 
MoFEMErrorCode remove_ents_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 remove entities form mofem database More...
 
MoFEMErrorCode delete_ents_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, const bool remove_parent=false, int verb=DEFAULT_VERBOSITY, MoFEMTypes mf=MF_ZERO)
 delete entities form mofem and moab database More...
 

Fields

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 filed. More...
 
MoFEMErrorCode delete_field (const std::string name, int verb=DEFAULT_VERBOSITY)
 Delete field. More...
 
MoFEMErrorCode addField (const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_coefficients, const TagType tag_type, const enum MoFEMTypes bh, int verb)
 Template for add_field. More...
 
MoFEMErrorCode addEntsToFieldByDim (const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode add_ents_to_field_by_dim (const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
 Add entities to field meshset. More...
 
MoFEMErrorCode add_ents_to_field_by_type (const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)
 Add entities to field meshset. More...
 
MoFEMErrorCode add_ents_to_field_by_dim (const EntityHandle meshset, const int dim, const std::string &name, const bool recursive=true, int verb=DEFAULT_VERBOSITY)
 Add entities to field meshset. More...
 
MoFEMErrorCode add_ents_to_field_by_type (const EntityHandle meshset, const EntityType type, const std::string &name, const bool recursive=true, int verb=DEFAULT_VERBOSITY)
 Add entities to field meshset. More...
 
MoFEMErrorCode create_vertices_and_add_to_field (const std::string name, const double coords[], int size, int verb=DEFAULT_VERBOSITY)
 Create a vertices and add to field object. More...
 

Set approximation order

MoFEMErrorCode setFieldOrder (const Range &ents, const BitFieldId id, const ApproximationOrder order, int ver)
 
MoFEMErrorCode setFieldOrderImpl (boost::shared_ptr< Field > field_ptr, const Range &ents, const ApproximationOrder order, int verb)
 
MoFEMErrorCode set_field_order (const Range &ents, const BitFieldId id, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode set_field_order (const EntityHandle meshset, const EntityType type, const BitFieldId id, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode set_field_order (const Range &ents, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
 Set order approximation of the entities in the field. More...
 
MoFEMErrorCode set_field_order (const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
 Set order approximation of the entities in the field. More...
 
MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref (const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type, const BitFieldId id, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode set_field_order_by_entity_type_and_bit_ref (const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
 Set order approximation of the entities in the field. More...
 

Build fields

MoFEMErrorCode buildFieldForNoFieldImpl (boost::shared_ptr< Field > field_ptr, std::map< EntityType, int > &dof_counter, int verb)
 
MoFEMErrorCode buildFieldForNoField (const BitFieldId id, std::map< EntityType, int > &dof_counter, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode buildFieldForL2H1HcurlHdiv (const BitFieldId id, std::map< EntityType, int > &dof_counter, std::map< EntityType, int > &inactive_dof_counter, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode buildField (const boost::shared_ptr< Field > &field, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode build_fields (int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode build_field (const std::string field_name, int verb=DEFAULT_VERBOSITY)
 build field by name More...
 

Clear DOFs

MoFEMErrorCode clear_inactive_dofs (int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_dofs_fields_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_dofs_fields (const Range ents, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_dofs_fields (const std::string name, const Range ents, int verb=DEFAULT_VERBOSITY)
 

Clear ENTs

MoFEMErrorCode clear_ents_fields_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_ents_fields (const Range ents, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_ents_fields (const std::string name, const Range ents, int verb=DEFAULT_VERBOSITY)
 

Remove field entities

MoFEMErrorCode remove_ents_from_field_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 remove entities from field More...
 
MoFEMErrorCode remove_ents_from_field (const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)
 remove entities from field More...
 
MoFEMErrorCode remove_ents_from_field (const std::string name, const Range ents, int verb=DEFAULT_VERBOSITY)
 remove entities from field More...
 
MoFEMErrorCode remove_ents_from_field (const Range ents, int verb=DEFAULT_VERBOSITY)
 remove entities from all fields More...
 

Other auxiliary functions for fields

MoFEMErrorCode list_dofs_by_field_name (const std::string &name) const
 
MoFEMErrorCode list_fields () const
 list entities in the field More...
 
BitFieldId get_field_id (const std::string &name) const
 Get field Id. More...
 
FieldBitNumber get_field_bit_number (const std::string name) const
 get field bit number More...
 
std::string get_field_name (const BitFieldId id) const
 get field name from id More...
 
EntityHandle get_field_meshset (const BitFieldId id) const
 
EntityHandle get_field_meshset (const std::string name) const
 get field meshset More...
 
MoFEMErrorCode get_field_entities_by_dimension (const std::string name, int dim, Range &ents) const
 get entities in the field by dimension More...
 
MoFEMErrorCode get_field_entities_by_type (const std::string name, EntityType type, Range &ents) const
 get entities in the field by type More...
 
MoFEMErrorCode get_field_entities_by_handle (const std::string name, Range &ents) const
 get entities in the field by handle More...
 
bool check_field (const std::string &name) const
 check if field is in database More...
 
const Fieldget_field_structure (const std::string &name, enum MoFEMTypes bh=MF_EXIST) const
 get field structure More...
 

Finite elements

const FiniteElementget_finite_element_structure (const std::string &name, enum MoFEMTypes bh=MF_EXCL) const
 get finite element struture More...
 
bool check_finite_element (const std::string &name) const
 Check if finite element is in database. More...
 
MoFEMErrorCode add_finite_element (const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)
 add finite element More...
 
MoFEMErrorCode modify_finite_element_adjacency_table (const std::string &fe_name, const EntityType type, ElementAdjacencyFunct function)
 modify finite element table, only for advanced user More...
 
MoFEMErrorCode modify_finite_element_add_field_data (const std::string &fe_name, const std::string name_filed)
 set finite element field data More...
 
MoFEMErrorCode modify_finite_element_add_field_row (const std::string &fe_name, const std::string name_row)
 set field row which finite element use More...
 
MoFEMErrorCode modify_finite_element_add_field_col (const std::string &fe_name, const std::string name_col)
 set field col which finite element use More...
 
MoFEMErrorCode modify_finite_element_off_field_data (const std::string &fe_name, const std::string name_filed)
 unset finite element field data More...
 
MoFEMErrorCode modify_finite_element_off_field_row (const std::string &fe_name, const std::string name_row)
 unset field row which finite element use More...
 
MoFEMErrorCode modify_finite_element_off_field_col (const std::string &fe_name, const std::string name_col)
 unset field col which finite element use More...
 
MoFEMErrorCode add_ents_to_finite_element_by_type (const EntityHandle meshset, const EntityType type, const std::string &name, const bool recursive=true)
 add entities to finite element More...
 
MoFEMErrorCode add_ents_to_finite_element_by_dim (const EntityHandle meshset, const int dim, const std::string &name, const bool recursive=true)
 add entities to finite element More...
 
MoFEMErrorCode add_ents_to_finite_element_by_type (const Range &ents, const EntityType type, const std::string &name)
 add entities to finite elements More...
 
MoFEMErrorCode add_ents_to_finite_element_by_dim (const Range &ents, const int dim, const std::string &name)
 add entities to finite elements More...
 
MoFEMErrorCode add_ents_to_finite_element_by_bit_ref (const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)
 add TET entities from given refinement level to finite element database given by name More...
 
MoFEMErrorCode add_ents_to_finite_element_by_MESHSET (const EntityHandle meshset, const std::string &name, const bool recursive=false)
 add MESHSET element to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref (const BitRefLevel &bit, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref (const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode remove_ents_from_finite_element_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 remove elements from given refinement level to finite element database More...
 
MoFEMErrorCode remove_ents_from_finite_element (const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)
 remove entities from given refinement level to finite element database More...
 
MoFEMErrorCode remove_ents_from_finite_element (const std::string name, const Range ents, int verb=DEFAULT_VERBOSITY)
 remove entities from finite element database More...
 
MoFEMErrorCode remove_ents_from_finite_element (const Range ents, int verb=DEFAULT_VERBOSITY)
 remove entities from finite elements in database More...
 
MoFEMErrorCode delete_finite_element (const std::string name, int verb=DEFAULT_VERBOSITY)
 delete finite element from mofem database More...
 
BitFEId getBitFEId (const std::string &fe_name) const
 Get field Id. More...
 
std::string getBitFEIdName (const BitFEId id) const
 Get field name. More...
 
EntityHandle get_finite_element_meshset (const BitFEId id) const
 
EntityHandle get_finite_element_meshset (const std::string name) const
 
MoFEMErrorCode get_finite_element_entities_by_dimension (const std::string name, int dim, Range &ents) const
 get entities in the finite element by dimension More...
 
MoFEMErrorCode get_finite_element_entities_by_type (const std::string name, EntityType type, Range &ents) const
 get entities in the finite element by type More...
 
MoFEMErrorCode get_finite_element_entities_by_handle (const std::string name, Range &ents) const
 get entities in the finite element by handle More...
 
MoFEMErrorCode list_finite_elements () const
 list finite elements in database More...
 

Problems

MoFEMErrorCode add_problem (const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)
 Add problem. More...
 
bool check_problem (const std::string name)
 check if problem exist More...
 
MoFEMErrorCode delete_problem (const std::string name)
 Delete problem. More...
 
MoFEMErrorCode modify_problem_add_finite_element (const std::string name_problem, const std::string &fe_name)
 add finite element to problem, this add entities assigned to finite element to a particular problem More...
 
MoFEMErrorCode modify_problem_unset_finite_element (const std::string name_problem, const std::string &fe_name)
 unset finite element from problem, this remove entities assigned to finite element to a particular problem More...
 
MoFEMErrorCode modify_problem_ref_level_add_bit (const std::string &name_problem, const BitRefLevel &bit)
 add ref level to problem More...
 
MoFEMErrorCode modify_problem_ref_level_set_bit (const std::string &name_problem, const BitRefLevel &bit)
 set ref level for problem More...
 
MoFEMErrorCode modify_problem_mask_ref_level_add_bit (const std::string &name_problem, const BitRefLevel &bit)
 set dof mask ref level for problem More...
 
MoFEMErrorCode modify_problem_mask_ref_level_set_bit (const std::string &name_problem, const BitRefLevel &bit)
 set dof mask ref level for problem More...
 
BitProblemId getBitProblemId (const std::string &name) const
 
MoFEMErrorCode list_problem () const
 list problems More...
 
MoFEMErrorCode clear_problem (const std::string name, int verb=DEFAULT_VERBOSITY)
 clear problem More...
 
MoFEMErrorCode clear_problems (int verb=DEFAULT_VERBOSITY)
 clear problems More...
 
MoFEMErrorCode build_finite_elements (int verb=DEFAULT_VERBOSITY)
 Build finite elements. More...
 
MoFEMErrorCode build_finite_elements (const BitRefLevel &bit, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode build_finite_elements (const string fe_name, const Range *const ents_ptr=nullptr, int verb=DEFAULT_VERBOSITY)
 Build finite elements. More...
 
MoFEMErrorCode buildFiniteElements (const boost::shared_ptr< FiniteElement > &fe, const Range *ents_ptr=NULL, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_finite_elements_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_finite_elements (const Range &ents, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_finite_elements (const std::string &fe_name, const Range &ents, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode get_problem_finite_elements_entities (const std::string name, const std::string &fe_name, const EntityHandle meshset)
 add finite elements to the meshset More...
 
DEPRECATED MoFEMErrorCode build_problem_on_distributed_mesh (int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode build_problems (int verb=DEFAULT_VERBOSITY)
 

Adjacencies

MoFEMErrorCode build_adjacencies (const Range &ents, int verb=DEFAULT_VERBOSITY)
 build adjacencies More...
 
MoFEMErrorCode build_adjacencies (const BitRefLevel &bit, int verb=DEFAULT_VERBOSITY)
 build adjacencies More...
 
MoFEMErrorCode build_adjacencies (const BitRefLevel &bit, const BitRefLevel &mask, int verb=DEFAULT_VERBOSITY)
 build adjacencies More...
 
MoFEMErrorCode clear_adjacencies_entities (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 clear adjacency map for entities on given bit level More...
 
MoFEMErrorCode clear_adjacencies_entities (const Range ents, int verb=DEFAULT_VERBOSITY)
 clear adjacencies for field entities by entities More...
 
MoFEMErrorCode clear_adjacencies_entities (const std::string name, const Range ents, int verb=DEFAULT_VERBOSITY)
 clear adjacencies for field entities by entities and field namd More...
 
MoFEMErrorCode clear_adjacencies_finite_elements (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
 clear adjacency map for finite elements on given bit level More...
 
MoFEMErrorCode clear_adjacencies_finite_elements (const Range ents, int verb=DEFAULT_VERBOSITY)
 
MoFEMErrorCode clear_adjacencies_finite_elements (const std::string name, const Range ents, int verb=DEFAULT_VERBOSITY)
 

Methods for preforming operations on elements

MoFEMErrorCode problem_basic_method_preProcess (const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
 Set data for BasicMethod. More...
 
MoFEMErrorCode problem_basic_method_preProcess (const std::string &problem_name, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
 Set data for BasicMethod. More...
 
MoFEMErrorCode problem_basic_method_postProcess (const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
 Set data for BasicMethod. More...
 
MoFEMErrorCode problem_basic_method_postProcess (const std::string &problem_name, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
 Set data for BasicMethod. More...
 
MoFEMErrorCode cache_problem_entities (const std::string prb_name, CacheTupleWeakPtr cache_ptr)
 Cache variables. More...
 
MoFEMErrorCode loop_finite_elements (const Problem *problem_ptr, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)
 Make a loop over finite elements on partitions from upper to lower rank. More...
 
MoFEMErrorCode loop_finite_elements (const std::string problem_name, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)
 Make a loop over finite elements on partitions from upper to lower rank. More...
 
MoFEMErrorCode loop_finite_elements (const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)
 Make a loop over finite elements. More...
 
MoFEMErrorCode loop_dofs (const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)
 Make a loop over dofs. More...
 
MoFEMErrorCode loop_dofs (const std::string &problem_name, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)
 Make a loop over dofs. More...
 
MoFEMErrorCode loop_dofs (const std::string &problem_name, const std::string &field_name, RowColData rc, DofMethod &method, int verb=DEFAULT_VERBOSITY)
 Make a loop over dofs. More...
 
MoFEMErrorCode loop_dofs (const std::string &field_name, DofMethod &method, int verb=DEFAULT_VERBOSITY)
 Make a loop over dofs. More...
 
MoFEMErrorCode loop_entities (const Problem *problem_ptr, const std::string field_name, RowColData rc, EntityMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)
 Loop over field entities in the problem. More...
 
MoFEMErrorCode loop_entities (const std::string problem_name, const std::string field_name, RowColData rc, EntityMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)
 Loop over field entities in the problem. More...
 
MoFEMErrorCode loop_entities (const std::string problem_name, const std::string field_name, RowColData rc, EntityMethod &method, int verb=DEFAULT_VERBOSITY)
 Loop over field entities in the problem. More...
 
MoFEMErrorCode loop_entities (const std::string field_name, EntityMethod &method, Range const *const ents=nullptr, int verb=DEFAULT_VERBOSITY)
 Loop over field entities. More...
 

Accessing multi-indices

MoFEMErrorCode get_fields (const Field_multiIndex **fields_ptr) const
 Get fields multi-index from database. More...
 
MoFEMErrorCode get_ref_ents (const RefEntity_multiIndex **refined_entities_ptr) const
 Get ref entities multi-index from database. More...
 
MoFEMErrorCode get_ref_finite_elements (const RefElement_multiIndex **refined_finite_elements_ptr) const
 Get ref finite elements multi-index form database. More...
 
MoFEMErrorCode get_finite_elements (const FiniteElement_multiIndex **fe_ptr) const
 Get finite elements multi-index. More...
 
MoFEMErrorCode get_ents_finite_elements (const EntFiniteElement_multiIndex **fe_ent_ptr) const
 Get entities finite elements multi-index. More...
 
MoFEMErrorCode get_field_ents (const FieldEntity_multiIndex **field_ents) const
 Get field multi index. More...
 
MoFEMErrorCode get_dofs (const DofEntity_multiIndex **dofs_ptr) const
 Get dofs multi index. More...
 
MoFEMErrorCode get_problem (const std::string &problem_name, const Problem **problem_ptr) const
 Get problem database (data structure) More...
 
MoFEMErrorCode get_problems (const Problem_multiIndex **problems_ptr) const
 Get pointer to problems multi-index. More...
 
MoFEMErrorCode get_ents_elements_adjacency (const FieldEntityEntFiniteElementAdjacencyMap_multiIndex **dofs_elements_adjacency) const
 Get the dofs elements adjacency object. More...
 
const Field_multiIndexget_fields () const
 Get the fields object. More...
 
const RefEntity_multiIndexget_ref_ents () const
 Get the ref ents object. More...
 
const RefElement_multiIndexget_ref_finite_elements () const
 Get the ref finite elements object. More...
 
const FiniteElement_multiIndexget_finite_elements () const
 Get the finite elements object. More...
 
const EntFiniteElement_multiIndexget_ents_finite_elements () const
 Get the ents finite elements object. More...
 
const FieldEntity_multiIndexget_field_ents () const
 Get the field ents object. More...
 
const DofEntity_multiIndexget_dofs () const
 Get the dofs object. More...
 
const Problemget_problem (const std::string problem_name) const
 Get the problem object. More...
 
const Problem_multiIndexget_problems () const
 Get the problems object. More...
 
const FieldEntityEntFiniteElementAdjacencyMap_multiIndexget_ents_elements_adjacency () const
 Get the dofs elements adjacency object. More...
 
FieldEntityByUId::iterator get_ent_field_by_name_begin (const std::string &field_name) const
 get begin iterator of filed ents of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
 
FieldEntityByUId::iterator get_ent_field_by_name_end (const std::string &field_name) const
 get begin iterator of filed dofs of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
 
DofEntityByUId::iterator get_dofs_by_name_begin (const std::string &field_name) const
 get begin iterator of filed dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
 
DofEntityByUId::iterator get_dofs_by_name_end (const std::string &field_name) const
 get begin iterator of filed dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
 
DofEntityByUId::iterator get_dofs_by_name_and_ent_begin (const std::string &field_name, const EntityHandle ent) const
 get begin iterator of filed dofs of given name and ent(instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,ENT,IT) More...
 
DofEntityByUId::iterator get_dofs_by_name_and_ent_end (const std::string &field_name, const EntityHandle ent) const
 get begin iterator of filed dofs of given name and ent (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,ENT,IT) More...
 
DofEntityByUId::iterator get_dofs_by_name_and_type_begin (const std::string &field_name, const EntityType type) const
 get begin iterator of filed dofs of given name and ent type (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,TYPE,IT) More...
 
DofEntityByUId::iterator get_dofs_by_name_and_type_end (const std::string &field_name, const EntityType ent) const
 get begin iterator of filed dofs of given name end ent type(instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,TYPE,IT) More...
 
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_begin (const std::string &fe_name) const
 get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
 
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_end (const std::string &fe_name) const
 get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
 

Log events

PetscLogEvent MOFEM_EVENT_preProcess
 Event for preProcess finite element. More...
 
PetscLogEvent MOFEM_EVENT_operator
 Event for evaluating operator of finite element. More...
 
PetscLogEvent MOFEM_EVENT_postProcess
 Event for postProcess finite element. More...
 
PetscLogEvent MOFEM_EVENT_createMat
 

Communicator

MPI_Comm mofemComm
 MoFEM communicator. More...
 
ParallelComm * pComm
 MOAB communicator structure. More...
 
int sIze
 MoFEM communicator size. More...
 
int rAnk
 MOFEM communicator rank. More...
 
MPI_Comm & get_comm () const
 
int get_comm_size () const
 
int get_comm_rank () const
 

Additional Inherited Members

- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version. More...
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version. More...
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version. More...
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version. More...
 

Detailed Description

Core (interface) class.

This is the implementation of abstract MoFEM::Interface class. Similarly to the convention used in MoAB, we use small letters to name function of purely abstract classes. This is an exception used only here. For more details about naming functions see Coding practice

This class is not used directly by the user. For internal use only. It is database with basic functions to access data. Abstraction of this is MoFEM Interface structure.

Such deign to hide complexities for users and allow low development without interfering with users modules programmer work.

Todo:
Implement static functions for Initialization and Finalization of MoFEM. Those functions should keep all static variables and initialize/finalize other libs like PETSc. Moreover initialization functions should set error handlers, etc.
Examples
add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, wave_equation.cpp, and wavy_surface.cpp.

Definition at line 82 of file Core.hpp.

Member Enumeration Documentation

◆ SemaphoresBuildMofem

Is used to check consistency. I n future properly this will be removed and replaced by other solution. It is only for internal use.

Enumerator
BUILD_FIELD 
BUILD_FE 
BUILD_ADJ 
BUILD_PROBLEM 
PARTITION_PROBLEM 
PARTITION_FE 
PARTITION_GHOST_DOFS 
PARTITION_MESH 

Definition at line 211 of file Core.hpp.

211  {
212  BUILD_FIELD = 1 << 0,
213  BUILD_FE = 1 << 1,
214  BUILD_ADJ = 1 << 2,
215  BUILD_PROBLEM = 1 << 3,
216  PARTITION_PROBLEM = 1 << 4,
217  PARTITION_FE = 1 << 5,
218  PARTITION_GHOST_DOFS = 1 << 6,
219  PARTITION_MESH = 1 << 7
220  };

Constructor & Destructor Documentation

◆ CoreTmp() [1/2]

MoFEM::Core::CoreTmp ( moab::Interface &  moab,
MPI_Comm  comm = PETSC_COMM_WORLD,
const int  verbose = VERBOSE 
)

Construct core database

Parameters
moabMoAB interface
commMPI communicator
verboseVerbosity level

Definition at line 209 of file Core.cpp.

214  : CoreTmp(moab, comm, verbose, CoreValue<0>()) {
215 
216  // Register sub-interfaces
217  ierr = this->registerSubInterfaces();
218  CHKERRABORT(comm, ierr);
219  ierr = this->clearMap();
220  CHKERRABORT(comm, ierr);
221  ierr = this->getTags();
222  CHKERRABORT(comm, ierr);
223  ierr = this->getOptions(verbose);
224  CHKERRABORT(comm, ierr);
225 
226  this->basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
228 
230  CHKERRABORT(comm, ierr);
231 }

◆ ~CoreTmp()

MoFEM::Core::~CoreTmp ( )

Definition at line 257 of file Core.cpp.

257  {
258  PetscBool is_finalized;
259  PetscFinalized(&is_finalized);
260  // Destroy interfaces
261  iFaces.clear();
262  // This is deprecated ONE should use MoFEM::Core::Initialize
263  if (isGloballyInitialised && is_finalized) {
264  isGloballyInitialised = false;
265  }
266 }

◆ CoreTmp() [2/2]

template<int V>
MoFEM::CoreTmp< 0 >::CoreTmp ( moab::Interface &  moab,
MPI_Comm  comm,
const int  verbose,
CoreValue< V >   
)
protected

Construct core database

Parameters
moabMoAB interface
commMPI communicator

Definition at line 32 of file CoreTemplates.hpp.

34  : moab(moab), mofemComm(comm), verbose(verbose),
35  initaliseAndBuildField(PETSC_FALSE),
36  initaliseAndBuildFiniteElements(PETSC_FALSE) {
37 
39  CHKERRABORT(comm, ierr);
40 
41  MOFEM_LOG_CHANNEL("WORLD");
42  if (verbose > QUIET) {
43  MOFEM_LOG_C("WORLD", Sev::verbose, "Core number < %d >", V);
44  }
45 }

Member Function Documentation

◆ add_ents_to_field_by_dim() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_field_by_dim ( const EntityHandle  meshset,
const int  dim,
const std::string &  name,
const bool  recursive = true,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Add entities to field meshset.

\not collective

The lower dimension entities are added depending on the space type

Parameters
meshset
dimdimension
namename of field
recursivetake entities recursively from embedded entities
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 384 of file FieldCore.cpp.

387  {
389  Range ents;
390  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
391  CHKERR addEntsToFieldByDim(ents, dim, name, verb);
394 }

◆ add_ents_to_field_by_dim() [2/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_field_by_dim ( const Range ents,
const int  dim,
const std::string &  name,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Add entities to field meshset.

Note
not collective

The lower dimension entities are added depending on the space type

Parameters
entsrange of entities
dimdimension of entities
namename of field
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 360 of file FieldCore.cpp.

362  {
364  Range ents_dim = ents.subset_by_dimension(dim);
365  CHKERR addEntsToFieldByDim(ents_dim, dim, name, verb);
368 }

◆ add_ents_to_field_by_type() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_field_by_type ( const EntityHandle  meshset,
const EntityType  type,
const std::string &  name,
const bool  recursive = true,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Add entities to field meshset.

Note
not collective

The lower dimension entities are added depending on the space type

Parameters
meshset
typeof entities
namename of field
recursivetake entities recursively from embedded entities
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 396 of file FieldCore.cpp.

399  {
401  Range ents;
402  CHKERR get_moab().get_entities_by_type(meshset, type, ents, recursive);
403  if (!ents.empty()) {
404  const int dim = get_moab().dimension_from_handle(ents[0]);
405  CHKERR addEntsToFieldByDim(ents, dim, name, verb);
406  }
409 }

◆ add_ents_to_field_by_type() [2/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_field_by_type ( const Range ents,
const EntityType  type,
const std::string &  name,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Add entities to field meshset.

Note
not collective

The lower dimension entities are added depending on the space type

Parameters
entsrange of entities
typetype of entities
namename of field
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 370 of file FieldCore.cpp.

373  {
375  Range ents_type = ents.subset_by_type(type);
376  if (!ents_type.empty()) {
377  const int dim = get_moab().dimension_from_handle(ents_type[0]);
378  CHKERR addEntsToFieldByDim(ents_type, dim, name, verb);
379  }
382 }

◆ add_ents_to_finite_element_by_bit_ref()

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_bit_ref ( const BitRefLevel bit,
const BitRefLevel mask,
const std::string &  name,
EntityType  type,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

add TET entities from given refinement level to finite element database given by name

Note
not collective
Parameters
BitRefLevelbit
BitRefLevelmask
finiteelement name
finiteelement type
verboselevel

Implements MoFEM::CoreInterface.

Definition at line 408 of file FECore.cpp.

410  {
412 
413  if (verb == -1)
414  verb = verbose;
415  *buildMoFEM &= 1 << 0;
416  const BitFEId id = getBitFEId(name);
418 
419  auto &ref_MoFEMFiniteElement = refinedFiniteElements.get<Ent_mi_tag>();
420  auto miit = ref_MoFEMFiniteElement.lower_bound(get_id_for_min_type(type));
421  auto hi_miit = ref_MoFEMFiniteElement.upper_bound(get_id_for_max_type(type));
422 
423  int nb_add_fes = 0;
424  for (; miit != hi_miit; miit++) {
425  const auto &bit2 = miit->get()->getBitRefLevel();
426  if ((bit2 & mask) != bit2)
427  continue;
428  if ((bit2 & bit).any()) {
429  EntityHandle ent = miit->get()->getEnt();
430  CHKERR get_moab().add_entities(idm, &ent, 1);
431  nb_add_fes++;
432  }
433  }
434 
435  MOFEM_LOG("SYNC", Sev::inform)
436  << "Finite element " << name << " added. Nb. of elements added "
437  << nb_add_fes << " out of " << std::distance(miit, hi_miit);
438 
440 
442 }

◆ add_ents_to_finite_element_by_dim() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_dim ( const EntityHandle  entities,
const int  dim,
const std::string &  name,
const bool  recursive = true 
)
protectedvirtual

add entities to finite element

Note
not collective
Parameters
entitiesmeshset or range form were entities taken
dimdimension
namename of field
recursivetake entities from meshsets in meshset
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 349 of file FECore.cpp.

351  {
352  EntityHandle idm = no_handle;
353  *buildMoFEM &= 1 << 0;
356  Range ents;
357  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
358  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
359  CHKERR get_moab().add_entities(idm, ents);
361 }

◆ add_ents_to_finite_element_by_dim() [2/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_dim ( const Range ents,
const int  dim,
const std::string &  name 
)
protectedvirtual

add entities to finite elements

Note
not collective
Parameters
entsrange of entities
dimdimension of entities
namename of finite element
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 376 of file FECore.cpp.

377  {
378  EntityHandle idm = no_handle;
379  *buildMoFEM &= 1 << 0;
382  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
383  ents.subset_by_dimension(dim));
384  CHKERR get_moab().add_entities(idm, ents.subset_by_dimension(dim));
386 }

◆ add_ents_to_finite_element_by_MESHSET()

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_MESHSET ( const EntityHandle  meshset,
const std::string &  name,
const bool  recursive = false 
)
protectedvirtual

add MESHSET element to finite element database given by name

Note
not collective
Parameters
meshsetcontains all entities that could be used for finite element
nameFinite Element name

Implements MoFEM::CoreInterface.

Definition at line 444 of file FECore.cpp.

445  {
447  *buildMoFEM &= 1 << 0;
448  const BitFEId id = getBitFEId(name);
450  if (recursive == false) {
451  CHKERR get_moab().add_entities(idm, &meshset, 1);
452  } else {
453  Range meshsets;
454  CHKERR get_moab().get_entities_by_type(meshset, MBENTITYSET, meshsets,
455  false);
456  CHKERR get_moab().add_entities(idm, meshsets);
457  }
459 }

◆ add_ents_to_finite_element_by_type() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_type ( const EntityHandle  entities,
const EntityType  type,
const std::string &  name,
const bool  recursive = true 
)
protectedvirtual

add entities to finite element

Note
not collective
Parameters
entitiesmeshset or range form were entities taken
typetype of entity
namename of field
recursivetake entities from meshsets in meshset
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 332 of file FECore.cpp.

334  {
335  *buildMoFEM &= 1 << 0;
336  EntityHandle idm = no_handle;
338 
340  Range ents;
341  CHKERR get_moab().get_entities_by_type(meshset, type, ents, recursive);
342  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
343  CHKERR get_moab().add_entities(idm, ents);
344 
346 }

◆ add_ents_to_finite_element_by_type() [2/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_type ( const Range ents,
const EntityType  type,
const std::string &  name 
)
protectedvirtual

add entities to finite elements

Note
not collective
Parameters
entsrange of entities
typetype of entity (MBVERTEX, MBEDGE, MBTRI, ...)
namename of finite element
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 363 of file FECore.cpp.

364  {
365  EntityHandle idm = no_handle;
366  *buildMoFEM &= 1 << 0;
369  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
370  ents.subset_by_type(type));
371  CHKERR get_moab().add_entities(idm, ents.subset_by_type(type));
373 } // namespace MoFEM

◆ add_ents_to_finite_element_EntType_by_bit_ref() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_EntType_by_bit_ref ( const BitRefLevel bit,
const BitRefLevel mask,
const std::string &  name,
EntityType  type,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 399 of file FECore.cpp.

401  {
404 
406 }

◆ add_ents_to_finite_element_EntType_by_bit_ref() [2/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_EntType_by_bit_ref ( const BitRefLevel bit,
const std::string &  name,
EntityType  type,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 389 of file FECore.cpp.

391  {
394  type, verb);
395 
397 }

◆ add_field()

MoFEMErrorCode MoFEM::Core::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 
)
protectedvirtual

Add filed.

Parameters
nameField name
spaceSpace L2,H1,Hdiv,Hcurl
baseApproximation base AINSWORTH_LEGENDRE_BASE, AINSWORTH_BERNSTEIN_BEZIER_BASE ...
nb_coefficientsNumber of field coefficients
tag_typeTag type, MB_TAG_DENSE or MB_TAG_SPARSE (default)
bhControl behavior, if MF_EXCL throws error if exist
verbVerbosity level
Returns
Return error code

TODO:

Todo:
MB_TAG_DENSE will not work properly in general case. It is need to separate field tags for each entity separately. That will allow for HO orders but homogenous approx. order on each entity. Need some discussion what is optimal solution. MB_TAG_SPARSE gives flexibility, but it not memory efficient. MB_TAG_DENSE uses memory more efficient and in principle allow for better efficiency if properly utilized.

FIXME:

Bug:
Need to resolve problem of dense tags at this stage of development will make only problems

Implements MoFEM::CoreInterface.

Definition at line 278 of file FieldCore.cpp.

282  {
283  return this->addField(name, space, base, nb_of_coefficients, tag_type, bh,
284  verb);
285 }

◆ add_finite_element()

MoFEMErrorCode MoFEM::Core::add_finite_element ( const std::string &  fe_name,
enum MoFEMTypes  bh = MF_EXCL,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

add finite element

Parameters
namefinite element name
Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.

Example

CHKERR mField.add_finite_element("ELASTIC");
CHKERR mField.add_finite_element("PLASTIC");

Implements MoFEM::CoreInterface.

Definition at line 43 of file FECore.cpp.

44  {
46  *buildMoFEM &= 1 << 0;
47  if (verb == -1) {
48  verb = verbose;
49  }
50 
51  // Add finite element meshset to partion meshset. In case of no elements
52  // on processor part, when mesh file is read, finite element meshset is
53  // prevented from deletion by moab reader.
54  auto add_meshset_to_partition = [&](auto meshset) {
56  const void *tag_vals[] = {&rAnk};
57  ParallelComm *pcomm = ParallelComm::get_pcomm(
58  &get_moab(), get_basic_entity_data_ptr()->pcommID);
59  Tag part_tag = pcomm->part_tag();
60  Range tagged_sets;
61  CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
62  tag_vals, 1, tagged_sets,
63  moab::Interface::UNION);
64  for (auto s : tagged_sets)
65  CHKERR get_moab().add_entities(s, &meshset, 1);
67  };
68 
69  auto &finite_element_name_set =
70  finiteElements.get<FiniteElement_name_mi_tag>();
71  auto it_fe = finite_element_name_set.find(fe_name);
72 
73  if (bh == MF_EXCL) {
74  if (it_fe != finite_element_name_set.end()) {
75  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "this < %s > is there",
76  fe_name.c_str());
77  }
78 
79  } else {
80  if (it_fe != finite_element_name_set.end())
82  }
83  EntityHandle meshset;
84  CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
85  CHKERR add_meshset_to_partition(meshset);
86 
87  // id
88  int fe_shift = 0;
89  for (; finiteElements.get<BitFEId_mi_tag>().find(BitFEId().set(fe_shift)) !=
90  finiteElements.get<BitFEId_mi_tag>().end();
91  ++fe_shift) {
92  }
93 
94  auto id = BitFEId().set(fe_shift);
95  CHKERR get_moab().tag_set_data(th_FEId, &meshset, 1, &id);
96 
97  // id name
98  void const *tag_data[] = {fe_name.c_str()};
99  int tag_sizes[1];
100  tag_sizes[0] = fe_name.size();
101  CHKERR get_moab().tag_set_by_ptr(th_FEName, &meshset, 1, tag_data, tag_sizes);
102 
103  // add FiniteElement
104  auto p = finiteElements.insert(
105  boost::shared_ptr<FiniteElement>(new FiniteElement(moab, meshset)));
106  if (!p.second)
108  "FiniteElement not inserted");
109 
110  if (verb > QUIET)
111  MOFEM_LOG("WORLD", Sev::inform) << "Add finite element " << fe_name;
112 
114 }

◆ add_problem()

MoFEMErrorCode MoFEM::Core::add_problem ( const std::string &  name,
enum MoFEMTypes  bh = MF_EXCL,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Add problem.

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.

Implements MoFEM::CoreInterface.

Definition at line 84 of file ProblemsCore.cpp.

85  {
87  if (verb == -1)
88  verb = verbose;
89  auto miit = pRoblems.get<Problem_mi_tag>().find(name);
90  if (miit == pRoblems.get<Problem_mi_tag>().end()) {
91 
92  int p_shift = 0;
93  for (; pRoblems.get<BitProblemId_mi_tag>().find(BitProblemId().set(
94  p_shift)) != pRoblems.get<BitProblemId_mi_tag>().end();
95  ++p_shift) {
96  }
97 
98  auto id = BitProblemId().set(p_shift);
99  CHKERR addProblem(id, name, verb);
100 
101  } else if (bh == MF_EXCL) {
102  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "problem is in database %s",
103  name.c_str());
104  }
106 }

◆ addEntsToFieldByDim()

MoFEMErrorCode MoFEM::Core::addEntsToFieldByDim ( const Range ents,
const int  dim,
const std::string &  name,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 287 of file FieldCore.cpp.

288  {
289 
290  *buildMoFEM = 0;
291  EntityHandle idm = no_handle;
292  if (verb == -1)
293  verb = verbose;
294 
295  MOFEM_LOG_CHANNEL("SYNC");
296  MOFEM_LOG_TAG("SYNC", "FieldCore");
298 
300  idm = get_field_meshset(name);
301  FieldSpace space;
302  CHKERR get_moab().tag_get_data(th_FieldSpace, &idm, 1, &space);
303  std::vector<int> nb_ents_on_dim(3, 0);
304  switch (space) {
305  case L2:
306  CHKERR get_moab().add_entities(idm, ents);
307  break;
308  case H1:
309  CHKERR get_moab().add_entities(idm, ents);
310  for (int dd = 0; dd != dim; ++dd) {
311  Range adj_ents;
312  CHKERR get_moab().get_adjacencies(ents, dd, false, adj_ents,
313  moab::Interface::UNION);
314  if (dd == 0) {
315  Range topo_nodes;
316  CHKERR get_moab().get_connectivity(ents, topo_nodes, true);
317  Range mid_nodes;
318  CHKERR get_moab().get_connectivity(ents, mid_nodes, false);
319  mid_nodes = subtract(mid_nodes, topo_nodes);
320  adj_ents = subtract(adj_ents, mid_nodes);
321  }
322  CHKERR get_moab().add_entities(idm, adj_ents);
323  nb_ents_on_dim[dd] = adj_ents.size();
324  }
325  break;
326  case HCURL:
327  CHKERR get_moab().add_entities(idm, ents);
328  for (int dd = 1; dd != dim; ++dd) {
329  Range adj_ents;
330  CHKERR get_moab().get_adjacencies(ents, dd, false, adj_ents,
331  moab::Interface::UNION);
332  CHKERR get_moab().add_entities(idm, adj_ents);
333  nb_ents_on_dim[dd] = adj_ents.size();
334  }
335  break;
336  case HDIV:
337  CHKERR get_moab().add_entities(idm, ents);
338  if (dim > 2) {
339  Range adj_ents;
340  CHKERR get_moab().get_adjacencies(ents, 2, false, adj_ents,
341  moab::Interface::UNION);
342  CHKERR get_moab().add_entities(idm, adj_ents);
343  nb_ents_on_dim[2] = adj_ents.size();
344  }
345  break;
346  default:
347  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
348  "sorry, unknown space added to entity");
349  }
350  if (verb >= VERBOSE) {
351  MOFEM_LOG("SYNC", Sev::noisy) << "add entities to field " << name;
352  MOFEM_LOG("SYNC", Sev::noisy) << "\tnb. add ents " << ents.size();
353  MOFEM_LOG("SYNC", Sev::noisy) << "\tnb. add faces " << nb_ents_on_dim[2];
354  MOFEM_LOG("SYNC", Sev::noisy) << "\tnb. add edges " << nb_ents_on_dim[1];
355  MOFEM_LOG("SYNC", Sev::noisy) << "\tnb. add nodes " << nb_ents_on_dim[0];
356  }
358 }

◆ addField()

MoFEMErrorCode MoFEM::Core::addField ( const std::string &  name,
const FieldSpace  space,
const FieldApproximationBase  base,
const FieldCoefficientsNumber  nb_coefficients,
const TagType  tag_type,
const enum MoFEMTypes  bh,
int  verb 
)
protected

Template for add_field.

Template Parameters
CoreN
Parameters
name
space
base
nb_coefficients
tag_type
bh
verb
Returns
MoFEMErrorCode

Definition at line 108 of file FieldCore.cpp.

112  {
113  MOFEM_LOG_CHANNEL("WORLD");
114  MOFEM_LOG_TAG("WORLD", "FieldCore");
115  MOFEM_LOG_CHANNEL("SYNC");
116  MOFEM_LOG_TAG("SYNC", "FieldCore");
119 
120  // Add field mesh set to partion meshset. In case of no elements
121  // on processor part, when mesh file is read, finite element meshset is
122  // prevented from deletion by moab reader.
123  auto add_meshset_to_partition = [&](auto meshset) {
125  const void *tag_vals[] = {&rAnk};
126  ParallelComm *pcomm = ParallelComm::get_pcomm(
127  &get_moab(), get_basic_entity_data_ptr()->pcommID);
128  Tag part_tag = pcomm->part_tag();
129  Range tagged_sets;
130  CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
131  tag_vals, 1, tagged_sets,
132  moab::Interface::UNION);
133  for (auto s : tagged_sets)
134  CHKERR get_moab().add_entities(s, &meshset, 1);
136  };
137 
138  auto create_tags = [&](auto meshset, auto id) {
140  CHKERR
141  get_moab().tag_set_data(th_FieldId, &meshset, 1, &id);
142  // space
143  CHKERR get_moab().tag_set_data(th_FieldSpace, &meshset, 1, &space);
144  // base
145  CHKERR get_moab().tag_set_data(th_FieldBase, &meshset, 1, &base);
146 
147  // name
148  void const *tag_data[] = {name.c_str()};
149  int tag_sizes[1];
150  tag_sizes[0] = name.size();
151  CHKERR get_moab().tag_set_by_ptr(th_FieldName, &meshset, 1, tag_data,
152  tag_sizes);
153  // rank
154  Tag th_rank;
155  int def_rank = 1;
156  const std::string tag_rank_name = "_Field_Rank_" + name;
157  CHKERR get_moab().tag_get_handle(tag_rank_name.c_str(), 1, MB_TYPE_INTEGER,
158  th_rank, MB_TAG_CREAT | MB_TAG_SPARSE,
159  &def_rank);
160  CHKERR get_moab().tag_set_data(th_rank, &meshset, 1, &nb_of_coefficients);
161 
162  Version file_ver;
164  CHK_THROW_MESSAGE(ierr, "Not known file version");
165  if (file_ver.majorVersion >= 0 && file_ver.minorVersion >= 12 &&
166  file_ver.buildVersion >= 1) {
167  const std::string name_data_prefix("_App_Data_");
168  void const *tag_prefix_data[] = {name_data_prefix.c_str()};
169  int tag_prefix_sizes[1];
170  tag_prefix_sizes[0] = name_data_prefix.size();
171  CHKERR get_moab().tag_set_by_ptr(th_FieldName_DataNamePrefix, &meshset, 1,
172  tag_prefix_data, tag_prefix_sizes);
173  Tag th_app_order, th_field_data, th_field_data_vert;
174 
175  // order
176  ApproximationOrder def_approx_order = -1;
177  const std::string tag_approx_order_name = "_App_Order_" + name;
178  CHKERR get_moab().tag_get_handle(
179  tag_approx_order_name.c_str(), 1, MB_TYPE_INTEGER, th_app_order,
180  MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
181 
182  // data
183  std::string tag_data_name = name_data_prefix + name;
184  const int def_len = 0;
185  CHKERR get_moab().tag_get_handle(
186  tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE, th_field_data,
187  MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
188  std::string tag_data_name_verts = name_data_prefix + name + "_V";
189  VectorDouble def_vert_data(nb_of_coefficients);
190  def_vert_data.clear();
191  CHKERR get_moab().tag_get_handle(
192  tag_data_name_verts.c_str(), nb_of_coefficients, MB_TYPE_DOUBLE,
193  th_field_data_vert, MB_TAG_CREAT | tag_type, &*def_vert_data.begin());
194  } else {
195  // Deprecated names
196  const std::string name_data_prefix("_App_Data");
197  void const *tag_prefix_data[] = {name_data_prefix.c_str()};
198  int tag_prefix_sizes[1];
199  tag_prefix_sizes[0] = name_data_prefix.size();
200  CHKERR get_moab().tag_set_by_ptr(th_FieldName_DataNamePrefix, &meshset, 1,
201  tag_prefix_data, tag_prefix_sizes);
202  Tag th_app_order, th_field_data, th_field_data_vert;
203 
204  // order
205  ApproximationOrder def_approx_order = -1;
206  const std::string tag_approx_order_name = "_App_Order_" + name;
207  CHKERR get_moab().tag_get_handle(
208  tag_approx_order_name.c_str(), 1, MB_TYPE_INTEGER, th_app_order,
209  MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
210 
211  // data
212  std::string tag_data_name = name_data_prefix + name;
213  const int def_len = 0;
214  CHKERR get_moab().tag_get_handle(
215  tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE, th_field_data,
216  MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
217  std::string tag_data_name_verts = name_data_prefix + name + "V";
218  VectorDouble def_vert_data(nb_of_coefficients);
219  def_vert_data.clear();
220  CHKERR get_moab().tag_get_handle(
221  tag_data_name_verts.c_str(), nb_of_coefficients, MB_TYPE_DOUBLE,
222  th_field_data_vert, MB_TAG_CREAT | tag_type, &*def_vert_data.begin());
223  }
224 
226  };
227 
228  if (verb == -1)
229  verb = verbose;
230  *buildMoFEM = 0;
231  auto fit = fIelds.get<FieldName_mi_tag>().find(name);
232  if (fit != fIelds.get<FieldName_mi_tag>().end()) {
233  if (bh == MF_EXCL)
234  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
235  "field is <%s> in database", name.c_str());
236 
237  } else {
238 
239  EntityHandle meshset;
240  CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
241  CHKERR add_meshset_to_partition(meshset);
242 
243  // id
244  int field_shift = 0;
245  for (;
246  fIelds.get<BitFieldId_mi_tag>().find(BitFieldId().set(field_shift)) !=
247  fIelds.get<BitFieldId_mi_tag>().end();
248  ++field_shift) {
249  if (field_shift == BITFEID_SIZE)
250  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE,
251  "Maximal number of fields exceeded");
252  }
253 
254  auto id = BitFieldId().set(field_shift);
255  CHKERR create_tags(meshset, id);
256 
257  auto p = fIelds.insert(boost::make_shared<Field>(moab, meshset));
258  if (verb > QUIET) {
259  MOFEM_LOG("WORLD", Sev::inform) << "Add field " << **p.first;
260  MOFEM_LOG("WORLD", Sev::noisy)
261  << "Field " << (*p.first)->getName() << " core value < "
262  << this->getValue() << " > field value ) "
263  << (*p.first)->getBitNumber() << " )";
264  }
265 
266  if (!p.second)
267  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND,
268  "field not inserted %s (top tip, it could be already "
269  "there)",
270  Field(moab, meshset).getName().c_str());
271  }
272 
273  MOFEM_LOG_CHANNEL("WORLD");
274  MOFEM_LOG_CHANNEL("SYNC");
276 }

◆ addPrismToDatabase()

MoFEMErrorCode MoFEM::Core::addPrismToDatabase ( const EntityHandle  prism,
int  verb = DEFAULT_VERBOSITY 
)

add prim element

FIXME: This is dirt solution, need to be fixed

Parameters
prismprim handle
verbverbosity level
Returns
error code

Definition at line 493 of file Core.cpp.

493  {
495  if (verb == -1)
496  verb = verbose;
497  std::pair<RefEntity_multiIndex::iterator, bool> p_ent;
498  p_ent = refinedEntities.insert(
499  boost::make_shared<RefEntity>(basicEntityDataPtr, prism));
500  if (p_ent.second) {
501  std::pair<RefElement_multiIndex::iterator, bool> p;
502  p = refinedFiniteElements.insert(
503  boost::shared_ptr<RefElement>(new RefElement_PRISM(*p_ent.first)));
504  int num_nodes;
505  const EntityHandle *conn;
506  CHKERR get_moab().get_connectivity(prism, conn, num_nodes, true);
507  Range face_side3, face_side4;
508  CHKERR get_moab().get_adjacencies(conn, 3, 2, false, face_side3);
509  CHKERR get_moab().get_adjacencies(&conn[3], 3, 2, false, face_side4);
510  if (face_side3.size() != 1)
511  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
512  "prism don't have side face 3");
513  if (face_side4.size() != 1)
514  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
515  "prims don't have side face 4");
516  p.first->get()->getSideNumberPtr(*face_side3.begin());
517  p.first->get()->getSideNumberPtr(*face_side4.begin());
518  }
520 }

◆ addProblem()

MoFEMErrorCode MoFEM::Core::addProblem ( const BitProblemId  id,
const std::string &  name,
int  verb = DEFAULT_VERBOSITY 
)
protected

add problem

Parameters
idproblem id
nameproblem name
verbverbosity level
Returns
MoFEMErrorCode

Definition at line 27 of file ProblemsCore.cpp.

28  {
30 
31  if (verb == -1)
32  verb = verbose;
33  EntityHandle meshset;
34  CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
35  CHKERR get_moab().tag_set_data(th_ProblemId, &meshset, 1, &id);
36 
37  // Add problem meshset to partion meshset. In case of no elements
38  // on processor part, when mesh file is read, finite element meshset is
39  // prevented from deletion by moab reader.
40  auto add_meshset_to_partition = [&](auto meshset) {
42  const void *tag_vals[] = {&rAnk};
43  ParallelComm *pcomm = ParallelComm::get_pcomm(
44  &get_moab(), get_basic_entity_data_ptr()->pcommID);
45  Tag part_tag = pcomm->part_tag();
46  Range tagged_sets;
47  CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
48  tag_vals, 1, tagged_sets,
49  moab::Interface::UNION);
50  for (auto s : tagged_sets)
51  CHKERR get_moab().add_entities(s, &meshset, 1);
53  };
54  CHKERR add_meshset_to_partition(meshset);
55 
56  void const *tag_data[] = {name.c_str()};
57  int tag_sizes[1];
58  tag_sizes[0] = name.size();
59  CHKERR get_moab().tag_set_by_ptr(th_ProblemName, &meshset, 1, tag_data,
60  tag_sizes);
61  // create entry
62  auto p = pRoblems.insert(Problem(moab, meshset));
63  if (!p.second) {
66  MOFEM_LOG("SELF", Sev::error) << "Following problem can not be added:";
67  MOFEM_LOG("SELF", Sev::error)
68  << "Problem " << name << " id(" << id.to_ulong() << ") " << id
69  << " added meshset " << meshset;
70  MOFEM_LOG("SELF", Sev::error) << "List of problems already in databse:";
71  for (auto &p : pRoblems) {
72  MOFEM_LOG("SELF", Sev::error)
73  << p.getName() << " id(" << p.getId().to_ulong() << ") " << id
74  << " on meshset " << p.meshset;
75  }
76  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Problem not added");
77  }
78 
79  MOFEM_LOG("WORLD", Sev::inform) << "Add problem " << name;
80 
82 }

◆ build_adjacencies() [1/3]

MoFEMErrorCode MoFEM::Core::build_adjacencies ( const BitRefLevel bit,
const BitRefLevel mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

build adjacencies

Parameters
bitadjacencies for refine level
maskmask for bit level

This function will get information of adjacent finite elements and fields of all entities. If this is not executed, partitioning the problem is not possible. Adjacency map is based on degrees of freedom adjacent to elements. This linked to geometric element connectivity.

If new degrees of freedom or new finite elements are added to the database, adjacency map has to be rebuild.

Implements MoFEM::CoreInterface.

Definition at line 817 of file FECore.cpp.

818  {
820  if (verb == -1)
821  verb = verbose;
822  Range ents;
823  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents);
824 
825  CHKERR build_adjacencies(ents, verb);
826 
828 }

◆ build_adjacencies() [2/3]

MoFEMErrorCode MoFEM::Core::build_adjacencies ( const BitRefLevel bit,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

build adjacencies

Parameters
bitadjacencies for refine level

This function will get information of adjacent finite elements and fields of all entities. If this is not executed, partitioning the problem is not possible. Adjacency map is based on degrees of freedom adjacent to elements. This linked to geometric element connectivity.

If new degrees of freedom or new finite elements are added to the database, adjacency map has to be rebuild.

Implements MoFEM::CoreInterface.

Definition at line 829 of file FECore.cpp.

829  {
831  if (verb == -1)
832  verb = verbose;
833  CHKERR build_adjacencies(bit, BitRefLevel().set(), verb);
834 
836 }

◆ build_adjacencies() [3/3]

MoFEMErrorCode MoFEM::Core::build_adjacencies ( const Range ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

build adjacencies

Parameters
listof entities

This function will get information of adjacent finite elements and fields of all entities. If this is not executed, partitioning the problem is not possible. Adjacency map is based on degrees of freedom adjacent to elements. This linked to geometric element connectivity.

If new degrees of freedom or new finite elements are added to the database, adjacency map has to be rebuild.

Implements MoFEM::CoreInterface.

Definition at line 745 of file FECore.cpp.

745  {
747  if (verb == DEFAULT_VERBOSITY)
748  verb = verbose;
749 
750  if (!((*buildMoFEM) & BUILD_FIELD))
751  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "field not build");
752  if (!((*buildMoFEM) & BUILD_FE))
753  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "fe not build");
754  for (auto peit = ents.pair_begin(); peit != ents.pair_end(); ++peit) {
755  auto fit = entsFiniteElements.get<Ent_mi_tag>().lower_bound(peit->first);
756  auto hi_fit =
757  entsFiniteElements.get<Ent_mi_tag>().upper_bound(peit->second);
758  for (; fit != hi_fit; ++fit) {
759  if ((*fit)->getBitFieldIdRow().none() &&
760  (*fit)->getBitFieldIdCol().none() &&
761  (*fit)->getBitFieldIdData().none())
762  continue;
763  int by = BYROW;
764  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol())
765  by |= BYCOL;
766  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData())
767  by |= BYDATA;
768  FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_row(by);
769  auto hint = entFEAdjacencies.end();
770  for (auto e : *(*fit)->getRowFieldEntsPtr()) {
771  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
772  bool success = entFEAdjacencies.modify(hint, modify_row);
773  if (!success)
774  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
775  "modification unsuccessful");
776  }
777  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol()) {
778  int by = BYCOL;
779  if ((*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData())
780  by |= BYDATA;
781  FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_col(by);
782  auto hint = entFEAdjacencies.end();
783  for (auto e : *(*fit)->getColFieldEntsPtr()) {
784  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
785  bool success = entFEAdjacencies.modify(hint, modify_col);
786  if (!success)
787  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
788  "modification unsuccessful");
789  }
790  }
791  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData() ||
792  (*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData()) {
793  FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_data(
794  BYDATA);
795  auto hint = entFEAdjacencies.end();
796  for (auto &e : (*fit)->getDataFieldEnts()) {
797  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
798  bool success = entFEAdjacencies.modify(hint, modify_data);
799  if (!success)
800  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
801  "modification unsuccessful");
802  }
803  }
804  }
805  }
806 
807  if (verb >= VERBOSE) {
808  MOFEM_LOG("WORLD", Sev::inform)
809  << "Number of adjacencies " << entFEAdjacencies.size();
811  }
812 
813  *buildMoFEM |= 1 << 2;
815 }

◆ build_field()

MoFEMErrorCode MoFEM::Core::build_field ( const std::string  field_name,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

build field by name

Parameters
field_name
verbm
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 1249 of file FieldCore.cpp.

1249  {
1251  auto field_it = fIelds.get<FieldName_mi_tag>().find(field_name);
1252  if (field_it == fIelds.get<FieldName_mi_tag>().end())
1253  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "Field < %s > not found",
1254  field_name.c_str());
1255 
1256  CHKERR this->buildField(*field_it, verb);
1257  if (verb > QUIET)
1260 }

◆ build_fields()

MoFEMErrorCode MoFEM::Core::build_fields ( int  verb = DEFAULT_VERBOSITY)
protectedvirtual

build fields

Implements MoFEM::CoreInterface.

Definition at line 1262 of file FieldCore.cpp.

1262  {
1264  if (verb == -1)
1265  verb = verbose;
1266 
1267  for (auto field : fIelds.get<BitFieldId_mi_tag>())
1268  CHKERR this->buildField(field, verb);
1269 
1270  *buildMoFEM = 1 << 0;
1271  if (verb > QUIET) {
1272  MOFEM_LOG("SYNC", Sev::verbose) << "Number of dofs " << dofsField.size();
1274  }
1275 
1277 }

◆ build_finite_elements() [1/3]

MoFEMErrorCode MoFEM::Core::build_finite_elements ( const BitRefLevel bit,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 708 of file FECore.cpp.

708  {
710  SETERRQ(mofemComm, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
712 }

◆ build_finite_elements() [2/3]

MoFEMErrorCode MoFEM::Core::build_finite_elements ( const string  fe_name,
const Range *const  ents_ptr = nullptr,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Build finite elements.

Build finite element data structures. Have to be run before problem and adjacencies are constructed.

Parameters
fe_nameName of finite element
ents_ptrPointer to range of finite elements
verbVerbosity level
Returns
Error code

Implements MoFEM::CoreInterface.

Definition at line 714 of file FECore.cpp.

716  {
718  if (verb == -1)
719  verb = verbose;
720 
721  auto fe_miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
722  if (fe_miit == finiteElements.get<FiniteElement_name_mi_tag>().end())
723  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "Finite element <%s> not found",
724  fe_name.c_str());
725 
726  CHKERR buildFiniteElements(*fe_miit, ents_ptr, verb);
727 
728  if (verb >= VERBOSE) {
729  auto &fe_ents = entsFiniteElements.get<Unique_mi_tag>();
730  auto miit = fe_ents.lower_bound(
731  EntFiniteElement::getLocalUniqueIdCalculate(0, (*fe_miit)->getFEUId()));
732  auto hi_miit =
734  get_id_for_max_type<MBENTITYSET>(), (*fe_miit)->getFEUId()));
735  const auto count = std::distance(miit, hi_miit);
736  MOFEM_LOG("SYNC", Sev::inform) << "Finite element " << fe_name
737  << " added. Nb. of elements added " << count;
739  }
740 
741  *buildMoFEM |= 1 << 1;
743 }

◆ build_finite_elements() [3/3]

MoFEMErrorCode MoFEM::Core::build_finite_elements ( int  verb = DEFAULT_VERBOSITY)
protectedvirtual

Build finite elements.

Build finite element data structures. Have to be run before problem and adjacencies are constructed.

Parameters
verbVerbosity level
Returns
Error code

Implements MoFEM::CoreInterface.

Definition at line 658 of file FECore.cpp.

658  {
660 
661  if (verb == DEFAULT_VERBOSITY)
662  verb = verbose;
663 
664  // loop Finite Elements
665  for (auto &fe : finiteElements)
666  CHKERR buildFiniteElements(fe, NULL, verb);
667 
668  if (verb > QUIET) {
669 
670  auto &fe_ents = entsFiniteElements.get<Unique_mi_tag>();
671  for (auto &fe : finiteElements) {
672  auto miit = fe_ents.lower_bound(
674  auto hi_miit =
676  get_id_for_max_type<MBENTITYSET>(), fe->getFEUId()));
677  const auto count = std::distance(miit, hi_miit);
678  MOFEM_LOG("SYNC", Sev::inform)
679  << "Finite element " << fe->getName()
680  << " added. Nb. of elements added " << count;
681  MOFEM_LOG("SYNC", Sev::noisy) << *fe;
682 
683  auto slg = MoFEM::LogManager::getLog("SYNC");
684  for (auto &field : fIelds) {
685  auto rec = slg.open_record(keywords::severity = Sev::verbose);
686  if (rec) {
687  logging::record_ostream strm(rec);
688  strm << "Field " << field->getName() << " on finite element: ";
689  if ((field->getId() & fe->getBitFieldIdRow()).any())
690  strm << "row ";
691  if ((field->getId() & fe->getBitFieldIdCol()).any())
692  strm << "columns ";
693  if ((field->getId() & fe->getBitFieldIdData()).any())
694  strm << "data";
695  strm.flush();
696  slg.push_record(boost::move(rec));
697  }
698  }
699  }
700 
702  }
703 
704  *buildMoFEM |= 1 << 1;
706 }

◆ build_problem_on_distributed_mesh()

MoFEMErrorCode MoFEM::Core::build_problem_on_distributed_mesh ( int  verb = DEFAULT_VERBOSITY)
protected

Definition at line 257 of file ProblemsCore.cpp.

257  {
259  if (verb == -1)
260  verb = verbose;
261  Problem_multiIndex::iterator p_miit = pRoblems.begin();
262  for (; p_miit != pRoblems.end(); p_miit++) {
263  CHKERR getInterface<ProblemsManager>()->buildProblemOnDistributedMesh(
264  const_cast<Problem *>(&*p_miit), verb);
265  }
267 }

◆ build_problems()

MoFEMErrorCode MoFEM::Core::build_problems ( int  verb = DEFAULT_VERBOSITY)
protected

Definition at line 317 of file ProblemsCore.cpp.

317  {
319  if (verb == -1)
320  verb = verbose;
321  if (!((*buildMoFEM) & BUILD_FIELD))
322  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "fields not build");
323  if (!((*buildMoFEM) & BUILD_FE))
324  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "FEs not build");
325  if (!((*buildMoFEM) & BUILD_ADJ))
326  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "adjacencies not build");
327  // iterate problems
328  Problem_multiIndex::iterator p_miit = pRoblems.begin();
329  for (; p_miit != pRoblems.end(); p_miit++) {
330  Problem *problem_ptr = const_cast<Problem *>(&*p_miit);
331  CHKERR getInterface<ProblemsManager>()->buildProblem(problem_ptr, false,
332  verb);
333  }
336 }

◆ buildField()

MoFEMErrorCode MoFEM::Core::buildField ( const boost::shared_ptr< Field > &  field,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 1200 of file FieldCore.cpp.

1201  {
1203  if (verb == -1)
1204  verb = verbose;
1205  if (verb > QUIET)
1206  MOFEM_LOG("SYNC", Sev::verbose) << "Build field " << field->getName();
1207 
1208  std::map<EntityType, int> dof_counter;
1209  std::map<EntityType, int> inactive_dof_counter;
1210 
1211  // Need to rebuild order table since number of dofs on each order when
1212  // field was created.
1213  if (field->getApproxBase() == USER_BASE)
1214  CHKERR field->rebuildDofsOrderMap();
1215 
1216  switch (field->getSpace()) {
1217  case NOFIELD:
1218  CHKERR this->buildFieldForNoField(field->getId(), dof_counter, verb);
1219  break;
1220  case L2:
1221  case H1:
1222  case HCURL:
1223  case HDIV:
1224  CHKERR this->buildFieldForL2H1HcurlHdiv(field->getId(), dof_counter,
1225  inactive_dof_counter, verb);
1226  break;
1227  default:
1228  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
1229  }
1230 
1231  if (verb > QUIET) {
1232  int nb_added_dofs = 0;
1233  int nb_inactive_added_dofs = 0;
1234  for (auto const &it : dof_counter) {
1235  MOFEM_LOG("SYNC", Sev::verbose)
1236  << "Nb. of dofs (" << moab::CN::EntityTypeName(it.first) << ") "
1237  << it.second << " (inactive " << inactive_dof_counter[it.first]
1238  << ")";
1239  nb_added_dofs += it.second;
1240  nb_inactive_added_dofs += inactive_dof_counter[it.first];
1241  }
1242  MOFEM_LOG("SYNC", Sev::verbose)
1243  << "Nb. added dofs " << nb_added_dofs << " (number of inactive dofs "
1244  << nb_inactive_added_dofs << " )";
1245  }
1247 }

◆ buildFieldForL2H1HcurlHdiv()

MoFEMErrorCode MoFEM::Core::buildFieldForL2H1HcurlHdiv ( const BitFieldId  id,
std::map< EntityType, int > &  dof_counter,
std::map< EntityType, int > &  inactive_dof_counter,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 1088 of file FieldCore.cpp.

1090  {
1092  if (verb == -1)
1093  verb = verbose;
1094 
1095  // Find field
1096  auto &set_id = fIelds.get<BitFieldId_mi_tag>();
1097  auto field_it = set_id.find(id);
1098  if (field_it == set_id.end()) {
1099  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "Field not found");
1100  }
1101  const int bit_number = field_it->get()->getBitNumber();
1102  const int rank = field_it->get()->getNbOfCoeffs();
1103 
1104  // Ents in the field meshset
1105  Range ents_of_id_meshset;
1106  CHKERR get_moab().get_entities_by_handle((*field_it)->meshSet,
1107  ents_of_id_meshset, false);
1108  if (verb > VERY_NOISY) {
1109  MOFEM_LOG_C("SYNC", Sev::noisy, "Ents in field %s meshset %d",
1110  (*field_it)->getName().c_str(), ents_of_id_meshset.size());
1111  }
1112 
1113  for (auto p_eit = ents_of_id_meshset.pair_begin();
1114  p_eit != ents_of_id_meshset.pair_end(); ++p_eit) {
1115 
1116  const EntityHandle first = p_eit->first;
1117  const EntityHandle second = p_eit->second;
1118  const auto lo_uid =
1119  FieldEntity::getLoLocalEntityBitNumber(bit_number, first);
1120  const auto hi_uid =
1121  FieldEntity::getHiLocalEntityBitNumber(bit_number, second);
1122 
1123  auto feit = entsFields.get<Unique_mi_tag>().lower_bound(lo_uid);
1124  if (feit == entsFields.get<Unique_mi_tag>().end())
1125  continue;
1126  auto hi_feit = entsFields.get<Unique_mi_tag>().upper_bound(hi_uid);
1127 
1128  // If there are DOFs in that range is more pragmatic to remove them
1129  // rather than to find sub-ranges or make them inactive
1130  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(lo_uid);
1131  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(hi_uid);
1132  dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1133 
1134  // Add vertices DOFs by bulk
1135  boost::shared_ptr<std::vector<DofEntity>> dofs_array =
1136  boost::make_shared<std::vector<DofEntity>>(std::vector<DofEntity>());
1137  // Add Sequence of DOFs to sequence container as weak_ptr
1138  int nb_dofs_on_ents = 0;
1139  for (auto tmp_feit = feit; tmp_feit != hi_feit; ++tmp_feit) {
1140  nb_dofs_on_ents += rank * tmp_feit->get()->getOrderNbDofs(
1141  tmp_feit->get()->getMaxOrder());
1142  }
1143 
1144  // Reserve memory
1145  dofs_array->reserve(nb_dofs_on_ents);
1146 
1147  // Create DOFs
1148  for (; feit != hi_feit; ++feit) {
1149  // Create dofs instances and shared pointers
1150  int DD = 0;
1151  // Loop orders (loop until max entity order is set)
1152  for (int oo = 0; oo <= feit->get()->getMaxOrder(); ++oo) {
1153  // Loop nb. dofs at order oo
1154  for (int dd = 0; dd < feit->get()->getOrderNbDofsDiff(oo); ++dd) {
1155  // Loop rank
1156  for (int rr = 0; rr < rank; ++rr, ++DD) {
1157  dofs_array->emplace_back(*feit, oo, rr, DD);
1158  ++dof_counter[feit->get()->getEntType()];
1159  }
1160  }
1161  }
1162  if (DD > feit->get()->getNbDofsOnEnt()) {
1163  std::ostringstream ss;
1164  ss << "rank " << rAnk << " ";
1165  ss << **feit << std::endl;
1166  SETERRQ3(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1167  "Expected number of DOFs on entity not equal to number added "
1168  "to database (DD = %d != %d = "
1169  "feit->get()->getNbDofsOnEnt())\n"
1170  "%s",
1171  DD, feit->get()->getNbDofsOnEnt(), ss.str().c_str());
1172  }
1173  }
1174 
1175  // Insert into Multi-Index container
1176  int dofs_field_size0 = dofsField.size();
1177  auto hint = dofsField.end();
1178  for (auto &v : *dofs_array)
1179  hint = dofsField.emplace_hint(hint, dofs_array, &v);
1180 
1181  // Add Sequence of DOFs to sequence container as weak_ptr
1182  field_it->get()->getDofSequenceContainer().push_back(dofs_array);
1183 
1184  // Check data consistency
1185  if (PetscUnlikely(static_cast<int>(dofs_array.use_count()) !=
1186  static_cast<int>(dofs_array->size() + 1))) {
1187  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1188  "Wrong use count %d != %d", dofs_array.use_count(),
1189  dofs_array->size() + 1);
1190  }
1191  if (dofs_field_size0 + dofs_array->size() != dofsField.size()) {
1192  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1193  "Wrong number of inserted DOFs %d != %d", dofs_array->size(),
1194  dofsField.size() - dofs_field_size0);
1195  }
1196  }
1198 }

◆ buildFieldForNoField()

MoFEMErrorCode MoFEM::Core::buildFieldForNoField ( const BitFieldId  id,
std::map< EntityType, int > &  dof_counter,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 1065 of file FieldCore.cpp.

1066  {
1068 
1069  if (verb == -1)
1070  verb = verbose;
1071 
1072  // find fields
1073  auto field_it = fIelds.get<BitFieldId_mi_tag>().find(id);
1074  if (field_it == fIelds.get<BitFieldId_mi_tag>().end())
1075  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "Field not found");
1076 
1077  if (verb > QUIET)
1078  MOFEM_LOG("WORLD", Sev::noisy)
1079  << "Field " << (*field_it)->getName() << " core value < "
1080  << this->getValue() << " > field value () "
1081  << (*field_it)->getBitNumber() << " )";
1082 
1083  CHKERR this->buildFieldForNoFieldImpl(*field_it, dof_counter, verb);
1084 
1086 }

◆ buildFieldForNoFieldImpl()

MoFEMErrorCode MoFEM::Core::buildFieldForNoFieldImpl ( boost::shared_ptr< Field field_ptr,
std::map< EntityType, int > &  dof_counter,
int  verb 
)
protected

Definition at line 960 of file FieldCore.cpp.

962  {
964 
965  const auto bit_number = field_ptr->getBitNumber();
966 
967  // ents in the field meshset
968  Range ents;
969  CHKERR get_moab().get_entities_by_handle(field_ptr->getMeshset(), ents,
970  false);
971  if (verb > VERBOSE)
972  MOFEM_LOG_C("SYNC", Sev::noisy, "Ents in field %s meshset %d\n",
973  field_ptr->getName().c_str(), ents.size());
974 
975  // ent view by field id (in set all MoabEnts has the same FieldId)
976  auto eiit = entsFields.get<Unique_mi_tag>().lower_bound(
977  FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
978  FieldEntity_multiIndex_ent_view ents_id_view;
979  if (eiit != entsFields.get<Unique_mi_tag>().end()) {
980  auto hi_eiit = entsFields.get<Unique_mi_tag>().upper_bound(
981  FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
982  std::copy(eiit, hi_eiit, std::back_inserter(ents_id_view));
983  }
984 
985  boost::shared_ptr<const int> zero_order(new const int(0));
986 
987  for (auto ent : ents) {
988  // search if field meshset is in database
989  auto ref_ent_it = refinedEntities.get<Ent_mi_tag>().find(ent);
990  if (ref_ent_it == refinedEntities.get<Ent_mi_tag>().end())
991  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
992  "Entity is not in MoFEM database, entities in field meshset need "
993  "to be seeded (i.e. bit ref level add to them)");
994 
995  auto add_dofs = [&](auto field_eit) {
997  // create dofs on this entity (nb. of dofs is equal to rank)
998  for (FieldCoefficientsNumber rank = 0; rank < field_ptr->getNbOfCoeffs();
999  rank++) {
1000  // insert dof
1001  auto p = dofsField.insert(
1002  boost::make_shared<DofEntity>(field_eit, 0, rank, rank));
1003  if (p.second) {
1004  dof_counter[MBENTITYSET]++; // Count entities in the meshset
1005  } else
1006  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
1007  "Dof expected to be created");
1008  }
1010  };
1011 
1012  // create database entity
1013  auto field_ent_it = ents_id_view.get<1>().find(ent);
1014  if (field_ent_it == ents_id_view.get<1>().end()) {
1015 
1016  auto p = entsFields.insert(
1017 
1018  boost::make_shared<FieldEntity>(
1019  field_ptr, *ref_ent_it,
1021  *ref_ent_it),
1022  boost::shared_ptr<const int>(zero_order, zero_order.get()))
1023 
1024  );
1025 
1026  if ((*p.first)->getFieldRawPtr() != field_ptr.get())
1027  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1028  "Get field ent poiter and field pointer do not match for "
1029  "field %s",
1030  field_ptr->getName().c_str());
1031 
1032  if (!p.second)
1033  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1034  "Entity should be created");
1035 
1036  CHKERR add_dofs(*(p.first));
1037 
1038  } else {
1039 
1040  // If there are DOFs in that range is more pragmatic to remove them
1041  // rather than to find sub-ranges or make them inactive
1042  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(
1043  FieldEntity::getLoLocalEntityBitNumber(bit_number, ent));
1044  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(
1045  FieldEntity::getHiLocalEntityBitNumber(bit_number, ent));
1046  dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1047  CHKERR add_dofs(*field_ent_it);
1048  }
1049  }
1050 
1051  if (verb > VERBOSE) {
1052  auto lo_dof = dofsField.get<Unique_mi_tag>().lower_bound(
1053  FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
1054  auto hi_dof = dofsField.get<Unique_mi_tag>().upper_bound(
1055  FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
1056  for (; lo_dof != hi_dof; lo_dof++)
1057  MOFEM_LOG("SYNC", Sev::noisy) << **lo_dof;
1058  MOFEM_LOG_SEVERITY_SYNC(mofemComm, Sev::noisy);
1059  }
1060 
1062 }

◆ buildFiniteElements()

MoFEMErrorCode MoFEM::Core::buildFiniteElements ( const boost::shared_ptr< FiniteElement > &  fe,
const Range ents_ptr = NULL,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 462 of file FECore.cpp.

463  {
465  if (verb == DEFAULT_VERBOSITY)
466  verb = verbose;
467 
468  if (verb > QUIET)
469  MOFEM_LOG("SYNC", Sev::verbose)
470  << "Build Finite Elements " << fe->getName();
471 
472  auto &fields_by_id = fIelds.get<BitFieldId_mi_tag>();
473 
474  // Get id of mofem fields for row, col and data
475  enum IntLoop { ROW = 0, COL, DATA, LAST };
476  std::array<BitFieldId, LAST> fe_fields = {fe.get()->getBitFieldIdRow(),
477  fe.get()->getBitFieldIdCol(),
478  fe.get()->getBitFieldIdData()};
479 
480  // Get finite element meshset
481  EntityHandle meshset = get_finite_element_meshset(fe.get()->getId());
482 
483  // Get entities from finite element meshset // if meshset
484  Range fe_ents;
485  CHKERR get_moab().get_entities_by_handle(meshset, fe_ents, false);
486 
487  if (ents_ptr)
488  fe_ents = intersect(fe_ents, *ents_ptr);
489 
490  // Map entity uid to pointers
491  typedef std::vector<boost::weak_ptr<EntFiniteElement>> VecOfWeakFEPtrs;
492  VecOfWeakFEPtrs processed_fes;
493  processed_fes.reserve(fe_ents.size());
494 
495  int last_data_field_ents_view_size = 0;
496  int last_row_field_ents_view_size = 0;
497  int last_col_field_ents_view_size = 0;
498 
499  // Entities adjacent to entities
500  std::vector<EntityHandle> adj_ents;
501 
502  // Loop meshset finite element ents and add finite elements
503  for (Range::const_pair_iterator peit = fe_ents.const_pair_begin();
504  peit != fe_ents.const_pair_end(); peit++) {
505 
506  const auto first = peit->first;
507  const auto second = peit->second;
508 
509  // Find range of ref entities that is sequence
510  // note: iterator is a wrapper
511  // check if is in refinedFiniteElements database
512  auto ref_fe_miit =
513  refinedFiniteElements.get<Ent_mi_tag>().lower_bound(first);
514  if (ref_fe_miit == refinedFiniteElements.get<Ent_mi_tag>().end()) {
515  std::ostringstream ss;
516  ss << "refinedFiniteElements not in database ent = " << first << " type "
517  << type_from_handle(first) << " " << *fe;
518  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, ss.str().c_str());
519  }
520  auto hi_ref_fe_miit =
521  refinedFiniteElements.get<Ent_mi_tag>().upper_bound(second);
522 
523  EntFiniteElement_multiIndex::iterator hint_p = entsFiniteElements.end();
524  for (; ref_fe_miit != hi_ref_fe_miit; ref_fe_miit++) {
525 
526  // Add finite element to database
527  hint_p = entsFiniteElements.emplace_hint(
528  hint_p, boost::make_shared<EntFiniteElement>(*ref_fe_miit, fe));
529  processed_fes.emplace_back(*hint_p);
530  auto fe_raw_ptr = hint_p->get();
531 
532  // Allocate space for entities view
533  bool row_as_data = false, col_as_row = false;
534  if (fe_fields[DATA] == fe_fields[ROW])
535  row_as_data = true;
536  if (fe_fields[ROW] == fe_fields[COL])
537  col_as_row = true;
538 
539  fe_raw_ptr->getDataFieldEntsPtr()->reserve(
540  last_data_field_ents_view_size);
541 
542  if (row_as_data) {
543  fe_raw_ptr->getRowFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
544  } else {
545  // row and col are different
546  if (fe_raw_ptr->getRowFieldEntsPtr() ==
547  fe_raw_ptr->getDataFieldEntsPtr())
548  fe_raw_ptr->getRowFieldEntsPtr() =
549  boost::make_shared<FieldEntity_vector_view>();
550  fe_raw_ptr->getRowFieldEntsPtr()->reserve(
551  last_row_field_ents_view_size);
552  }
553 
554  if (row_as_data && col_as_row) {
555  fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
556  } else if (col_as_row) {
557  fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getRowFieldEntsPtr();
558  } else {
559  if (
560 
561  fe_raw_ptr->getColFieldEntsPtr() ==
562  fe_raw_ptr->getRowFieldEntsPtr() ||
563  fe_raw_ptr->getColFieldEntsPtr() ==
564  fe_raw_ptr->getDataFieldEntsPtr()
565 
566  )
567  fe_raw_ptr->getColFieldEntsPtr() =
568  boost::make_shared<FieldEntity_vector_view>();
569  fe_raw_ptr->getColFieldEntsPtr()->reserve(
570  last_col_field_ents_view_size);
571  }
572 
573  // Iterate over all field and check which one is on the element
574  for (unsigned int ii = 0; ii != BitFieldId().size(); ++ii) {
575 
576  // Common field id for ROW, COL and DATA
577  BitFieldId id_common = 0;
578  // Check if the field (ii) is added to finite element
579  for (int ss = 0; ss < LAST; ss++) {
580  id_common |= fe_fields[ss] & BitFieldId().set(ii);
581  }
582  if (id_common.none())
583  continue;
584 
585  // Find in database data associated with the field (ii)
586  const BitFieldId field_id = BitFieldId().set(ii);
587  auto miit = fields_by_id.find(field_id);
588  if (miit == fields_by_id.end())
589  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Field not found");
590  auto field_bit_number = (*miit)->getBitNumber();
591 
592  // Loop over adjacencies of element and find field entities on those
593  // adjacencies, that create hash map map_uid_fe which is used later
594  const std::string field_name = miit->get()->getName();
595  const bool add_to_data = (field_id & fe_fields[DATA]).any();
596  const bool add_to_row = (field_id & fe_fields[ROW]).any();
597  const bool add_to_col = (field_id & fe_fields[COL]).any();
598 
599  // Resolve entities on element, those entities are used to build tag
600  // with dof uids on finite element tag
601  adj_ents.clear();
602  CHKERR fe_raw_ptr->getElementAdjacency(*miit, adj_ents);
603 
604  for (auto ent : adj_ents) {
605 
606  auto dof_it = entsFields.get<Unique_mi_tag>().find(
607  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, ent));
608  if (dof_it != entsFields.get<Unique_mi_tag>().end()) {
609 
610  if (add_to_data) {
611  fe_raw_ptr->getDataFieldEntsPtr()->emplace_back(*dof_it);
612  }
613  if (add_to_row && !row_as_data) {
614  fe_raw_ptr->getRowFieldEntsPtr()->emplace_back(*dof_it);
615  }
616  if (add_to_col && !col_as_row) {
617  fe_raw_ptr->getColFieldEntsPtr()->emplace_back(*dof_it);
618  }
619 
620  }
621  }
622  }
623 
624  // Sort field ents by uid
625  auto uid_comp = [](const auto &a, const auto &b) {
626  return a.lock()->getLocalUniqueId() < b.lock()->getLocalUniqueId();
627  };
628 
629  // Sort all views
630 
631  // Data
632  sort(fe_raw_ptr->getDataFieldEntsPtr()->begin(),
633  fe_raw_ptr->getDataFieldEntsPtr()->end(), uid_comp);
634  last_data_field_ents_view_size =
635  fe_raw_ptr->getDataFieldEntsPtr()->size();
636 
637  // Row
638  if (!row_as_data) {
639  sort(fe_raw_ptr->getRowFieldEntsPtr()->begin(),
640  fe_raw_ptr->getRowFieldEntsPtr()->end(), uid_comp);
641  last_row_field_ents_view_size =
642  fe_raw_ptr->getRowFieldEntsPtr()->size();
643  }
644 
645  // Column
646  if (!col_as_row) {
647  sort(fe_raw_ptr->getColFieldEntsPtr()->begin(),
648  fe_raw_ptr->getColFieldEntsPtr()->end(), uid_comp);
649  last_col_field_ents_view_size =
650  fe_raw_ptr->getColFieldEntsPtr()->size();
651  }
652  }
653  }
654 
656 }

◆ cache_problem_entities()

MoFEMErrorCode MoFEM::Core::cache_problem_entities ( const std::string  prb_name,
CacheTupleWeakPtr  cache_ptr 
)
protectedvirtual

Cache variables.

Parameters
prb_name
cache_ptr
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 798 of file ProblemsCore.cpp.

799  {
801 
802  if (auto cache_ptr = cache_weak_ptr.lock()) {
803  auto p_miit = pRoblems.get<Problem_mi_tag>().find(prb_name);
804  if (p_miit == pRoblems.get<Problem_mi_tag>().end())
805  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "problem not in database %s",
806  prb_name.c_str());
807 
808  const BitRefLevel &prb_bit = p_miit->getBitRefLevel();
809  const BitRefLevel &prb_mask = p_miit->getBitRefLevelMask();
810  const BitFEId &prb_fe_id = p_miit->getBitFEId();
811 
812  auto &row_dofs = p_miit->numeredRowDofsPtr;
813  auto &col_dofs = p_miit->numeredColDofsPtr;
814 
815  auto &cache_data = std::get<0>(*cache_ptr);
816  auto &cache_row = std::get<1>(*cache_ptr);
817  auto &cache_col = std::get<2>(*cache_ptr);
818 
819  cache_row.resize(entsFields.size());
820  if (row_dofs != col_dofs)
821  cache_col.resize(entsFields.size());
822  cache_data.resize(entsFields.size());
823 
824  size_t idx = 0;
825  for (auto it = entsFields.begin(); it != entsFields.end(); ++it, ++idx) {
826 
827  const auto uid = (*it)->getLocalUniqueId();
828  auto r = entFEAdjacencies.get<Unique_mi_tag>().equal_range(uid);
829  for (auto lo = r.first; lo != r.second; ++lo) {
830 
831  if ((lo->getBitFEId() & prb_fe_id).any()) {
832 
833  const BitRefLevel &fe_bit = lo->entFePtr->getBitRefLevel();
834 
835  // if entity is not problem refinement level
836  if (((fe_bit & prb_mask) != fe_bit) || ((fe_bit & prb_bit).none()))
837  continue;
838 
839  auto cache_numered_dofs = [&](auto &numered_dofs, auto &cache_vec,
840  auto &ent_cache) {
841  auto dit = numered_dofs->lower_bound(uid);
842  decltype(dit) hi_dit;
843  if (dit != numered_dofs->end())
844  hi_dit = numered_dofs->upper_bound(
845  uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
846  else
847  hi_dit = dit;
848 
849  ent_cache = boost::shared_ptr<EntityCacheNumeredDofs>(
850  cache_ptr, &(cache_vec[idx]));
851  cache_vec[idx].loHi = {dit, hi_dit};
852  };
853 
854  auto cache_dofs = [&](auto &dofs, auto &cache_vec, auto &ent_cache) {
855  auto dit = dofs.lower_bound(uid);
856  decltype(dit) hi_dit;
857  if (dit != dofs.end())
858  hi_dit = dofs.upper_bound(
859  uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
860  else
861  hi_dit = dit;
862 
863  ent_cache = boost::shared_ptr<EntityCacheDofs>(cache_ptr,
864  &(cache_vec[idx]));
865  cache_vec[idx].loHi = {dit, hi_dit};
866  };
867 
868  cache_numered_dofs(row_dofs, cache_row, (*it)->entityCacheRowDofs);
869  if (row_dofs != col_dofs) {
870  if (cache_col.size() != entsFields.size())
871  cache_col.resize(entsFields.size());
872  cache_numered_dofs(col_dofs, cache_col, (*it)->entityCacheColDofs);
873  } else {
874  (*it)->entityCacheColDofs = (*it)->entityCacheRowDofs;
875  }
876 
877  cache_dofs(dofsField, cache_data, (*it)->entityCacheDataDofs);
878 
879  break;
880  }
881  }
882  }
883  } else {
884  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Cache not allocated");
885  }
886 
888 }

◆ check_field()

bool MoFEM::Core::check_field ( const std::string &  name) const
protectedvirtual

check if field is in database

Parameters
namefield name
Returns
true if field exist

Implements MoFEM::CoreInterface.

Definition at line 57 of file FieldCore.cpp.

57  {
58  auto miit = fIelds.get<FieldName_mi_tag>().find(name);
59  if (miit == fIelds.get<FieldName_mi_tag>().end())
60  return false;
61  else
62  return true;
63 }

◆ check_finite_element()

bool MoFEM::Core::check_finite_element ( const std::string &  name) const
protectedvirtual

Check if finite element is in database.

Parameters
nameName of finite element
Returns
true if element is declared

Implements MoFEM::CoreInterface.

Definition at line 35 of file FECore.cpp.

35  {
36  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
37  if (miit == finiteElements.get<FiniteElement_name_mi_tag>().end())
38  return false;
39  else
40  return true;
41 }

◆ check_number_of_ents_in_ents_field() [1/2]

MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_field ( ) const
protectedvirtual

check data consistency in entitiesPtr

Implements MoFEM::CoreInterface.

Definition at line 1381 of file FieldCore.cpp.

1381  {
1383  for (auto &it : fIelds.get<FieldName_mi_tag>()) {
1384  if (it->getSpace() == NOFIELD)
1385  continue; // FIXME: should be treated properly, not test is just
1386  // skipped for this NOFIELD space
1387  EntityHandle meshset = it->getMeshset();
1388  int num_entities;
1389  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1390 
1391  auto count_field_ents = [&]() {
1392  auto bit_number = it->getBitNumber();
1393  auto low_eit = entsFields.get<Unique_mi_tag>().lower_bound(
1394  FieldEntity::getLoBitNumberUId(bit_number));
1395  auto hi_eit = entsFields.get<Unique_mi_tag>().upper_bound(
1396  FieldEntity::getHiBitNumberUId(bit_number));
1397  return std::distance(low_eit, hi_eit);
1398  };
1399 
1400  if (count_field_ents() > (unsigned int)num_entities) {
1401  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1402  "not equal number of entities in meshset and field "
1403  "multiindex < %s >",
1404  it->getName().c_str());
1405  }
1406  }
1408 }

◆ check_number_of_ents_in_ents_field() [2/2]

MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_field ( const std::string &  name) const
protectedvirtual

check data consistency in entitiesPtr

Implements MoFEM::CoreInterface.

Definition at line 1353 of file FieldCore.cpp.

1353  {
1355  auto it = fIelds.get<FieldName_mi_tag>().find(name);
1356  if (it == fIelds.get<FieldName_mi_tag>().end()) {
1357  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1358  "field not found < %s >", name.c_str());
1359  }
1360  EntityHandle meshset = (*it)->getMeshset();
1361  int num_entities;
1362  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1363 
1364  auto count_field_ents = [&]() {
1365  auto bit_number = (*it)->getBitNumber();
1366  auto low_eit = entsFields.get<Unique_mi_tag>().lower_bound(
1367  FieldEntity::getLoBitNumberUId(bit_number));
1368  auto hi_eit = entsFields.get<Unique_mi_tag>().upper_bound(
1369  FieldEntity::getHiBitNumberUId(bit_number));
1370  return std::distance(low_eit, hi_eit);
1371  };
1372 
1373  if (count_field_ents() > (unsigned int)num_entities) {
1374  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1375  "not equal number of entities in meshset and field multiindex "
1376  "< %s >",
1377  name.c_str());
1378  }
1380 }

◆ check_number_of_ents_in_ents_finite_element() [1/2]

MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_finite_element ( ) const
protectedvirtual

check data consistency in entsFiniteElements

Implements MoFEM::CoreInterface.

Definition at line 888 of file FECore.cpp.

888  {
890  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
891  it = finiteElements.get<FiniteElement_name_mi_tag>().begin();
892  for (; it != finiteElements.get<FiniteElement_name_mi_tag>().end(); it++) {
893  EntityHandle meshset = (*it)->getMeshset();
894 
895  int num_entities;
896  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
897 
898  auto counts_fes = [&]() {
899  return std::distance(get_fe_by_name_begin((*it)->getName()),
900  get_fe_by_name_end((*it)->getName()));
901  };
902 
903  if (counts_fes() != static_cast<size_t>(num_entities)) {
905  "not equal number of entities in meshset and finite elements "
906  "multiindex < %s >",
907  (*it)->getName().c_str());
908  }
909  }
911 }

◆ check_number_of_ents_in_ents_finite_element() [2/2]

MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_finite_element ( const std::string &  name) const
protectedvirtual

check data consistency in entsFiniteElements

Implements MoFEM::CoreInterface.

Definition at line 861 of file FECore.cpp.

862  {
864  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
865  it = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
866  if (it == finiteElements.get<FiniteElement_name_mi_tag>().end()) {
867  SETERRQ1(mofemComm, 1, "finite element not found < %s >", name.c_str());
868  }
869  EntityHandle meshset = (*it)->getMeshset();
870 
871  int num_entities;
872  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
873 
874  auto counts_fes = [&]() {
875  return std::distance(get_fe_by_name_begin((*it)->getName()),
876  get_fe_by_name_end((*it)->getName()));
877  };
878 
879  if (counts_fes() != static_cast<size_t>(num_entities)) {
881  "not equal number of entities in meshset and finite elements "
882  "multiindex < %s >",
883  (*it)->getName().c_str());
884  }
886 }

◆ check_problem()

bool MoFEM::CoreTmp< 0 >::check_problem ( const std::string  name)
protectedvirtual

check if problem exist

Parameters
nameproblem name
Returns
true if problem is in database

Implements MoFEM::CoreInterface.

◆ clear_adjacencies_entities() [1/3]

MoFEMErrorCode MoFEM::Core::clear_adjacencies_entities ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear adjacency map for entities on given bit level

Parameters
bit
mask

Implements MoFEM::CoreInterface.

Definition at line 201 of file DeleteCore.cpp.

203  {
205  if (verb == -1)
206  verb = verbose;
207  Range ents;
208  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
211 }

◆ clear_adjacencies_entities() [2/3]

MoFEMErrorCode MoFEM::Core::clear_adjacencies_entities ( const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear adjacencies for field entities by entities

Implements MoFEM::CoreInterface.

Definition at line 213 of file DeleteCore.cpp.

213  {
215  if (verb == -1)
216  verb = verbose;
217  for (Range::const_pair_iterator p_eit = ents.pair_begin();
218  p_eit != ents.pair_end(); ++p_eit) {
219  const EntityHandle first = p_eit->first;
220  const EntityHandle second = p_eit->second;
221  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
222  Ent_mi_tag>::type::iterator ait,
223  hi_ait;
224  ait = entFEAdjacencies.get<Ent_mi_tag>().lower_bound(first);
225  hi_ait = entFEAdjacencies.get<Ent_mi_tag>().upper_bound(second);
226  entFEAdjacencies.get<Ent_mi_tag>().erase(ait, hi_ait);
227  }
229 }

◆ clear_adjacencies_entities() [3/3]

MoFEMErrorCode MoFEM::Core::clear_adjacencies_entities ( const std::string  name,
const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear adjacencies for field entities by entities and field namd

Implements MoFEM::CoreInterface.

Definition at line 231 of file DeleteCore.cpp.

232  {
234  if (verb == -1)
235  verb = verbose;
236 
237  const Field *field_ptr = get_field_structure(name);
238  int field_bit_number = field_ptr->getBitNumber();
239 
240  for (Range::const_pair_iterator p_eit = ents.pair_begin();
241  p_eit != ents.pair_end(); p_eit++) {
242 
243  // First and last handle
244  const EntityHandle first = p_eit->first;
245  const EntityHandle second = p_eit->second;
246 
247  // Get UId
248  UId first_uid =
249  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, first);
250  UId second_uid =
251  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, second);
252 
253  // Find adjacencies
254  auto ait = entFEAdjacencies.get<Unique_mi_tag>().lower_bound(first_uid);
255  auto hi_ait = entFEAdjacencies.get<Unique_mi_tag>().upper_bound(second_uid);
256  entFEAdjacencies.get<Unique_mi_tag>().erase(ait, hi_ait);
257  }
259 }

◆ clear_adjacencies_finite_elements() [1/3]

MoFEMErrorCode MoFEM::Core::clear_adjacencies_finite_elements ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear adjacency map for finite elements on given bit level

Parameters
bit
mask

Implements MoFEM::CoreInterface.

Definition at line 312 of file DeleteCore.cpp.

314  {
316  Range ents;
317  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
320 }

◆ clear_adjacencies_finite_elements() [2/3]

MoFEMErrorCode MoFEM::Core::clear_adjacencies_finite_elements ( const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 322 of file DeleteCore.cpp.

323  {
325  if (verb == -1)
326  verb = verbose;
327  for (Range::const_pair_iterator p_eit = ents.pair_begin();
328  p_eit != ents.pair_end(); p_eit++) {
329  EntityHandle first = p_eit->first;
330  EntityHandle second = p_eit->second;
331  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
332  FEEnt_mi_tag>::type::iterator ait,
333  hi_ait;
334  ait = entFEAdjacencies.get<FEEnt_mi_tag>().lower_bound(first);
335  hi_ait = entFEAdjacencies.get<FEEnt_mi_tag>().upper_bound(second);
336  entFEAdjacencies.get<FEEnt_mi_tag>().erase(ait, hi_ait);
337  }
339 }

◆ clear_adjacencies_finite_elements() [3/3]

MoFEMErrorCode MoFEM::Core::clear_adjacencies_finite_elements ( const std::string  name,
const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 341 of file DeleteCore.cpp.

343  {
345  if (verb == -1)
346  verb = verbose;
347 
348  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator
349  it_fe = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
350  if (it_fe != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
351 
352  const auto fe_uid = (*it_fe)->getFEUId();
353 
354  for (Range::const_pair_iterator p_eit = ents.pair_begin();
355  p_eit != ents.pair_end(); p_eit++) {
356 
357  // First and last handle
358  const EntityHandle first = p_eit->first;
359  const EntityHandle second = p_eit->second;
360 
361  // Get UId
362  UId first_uid =
364  UId second_uid =
366 
367  // Find and remove adjacencies
368  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
369  FE_Unique_mi_tag>::type::iterator ait,
370  hi_ait;
371  ait = entFEAdjacencies.get<FE_Unique_mi_tag>().lower_bound(first_uid);
372  hi_ait = entFEAdjacencies.get<FE_Unique_mi_tag>().upper_bound(second_uid);
373  entFEAdjacencies.get<FE_Unique_mi_tag>().erase(ait, hi_ait);
374  }
375  }
377 }

◆ clear_database()

MoFEMErrorCode MoFEM::Core::clear_database ( int  verb = DEFAULT_VERBOSITY)
protectedvirtual

Clear database.

Parameters
verbVerbosity level
Returns
Error code

Implements MoFEM::CoreInterface.

Definition at line 694 of file Core.cpp.

694  {
696  if (verb == -1)
697  verb = verbose;
698  CHKERR clearMap();
700 }

◆ clear_dofs_fields() [1/2]

MoFEMErrorCode MoFEM::Core::clear_dofs_fields ( const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Clear dofs by ents

Implements MoFEM::CoreInterface.

Definition at line 57 of file DeleteCore.cpp.

57  {
59  if (verb == -1)
60  verb = verbose;
61 
62  for (Range::const_pair_iterator p_eit = ents.pair_begin();
63  p_eit != ents.pair_end(); p_eit++) {
64  EntityHandle first = p_eit->first;
65  EntityHandle second = p_eit->second;
66  // get dofs range
67  DofEntityByEnt::iterator dit, hi_dit;
68  dit = dofsField.get<Ent_mi_tag>().lower_bound(first);
69  if (dit == dofsField.get<Ent_mi_tag>().end())
70  continue;
71  hi_dit = dofsField.get<Ent_mi_tag>().upper_bound(second);
72  // finally clear dofs
73  dofsField.get<Ent_mi_tag>().erase(dit, hi_dit);
74  }
76 }

◆ clear_dofs_fields() [2/2]

MoFEMErrorCode MoFEM::Core::clear_dofs_fields ( const std::string  name,
const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Clear dofs by field name and ents

Implements MoFEM::CoreInterface.

Definition at line 78 of file DeleteCore.cpp.

79  {
81  if (verb == -1)
82  verb = verbose;
83 
84  const auto bit_number = get_field_bit_number(name);
85 
86  for (Range::const_pair_iterator p_eit = ents.pair_begin();
87  p_eit != ents.pair_end(); p_eit++) {
88  const auto first = p_eit->first;
89  const auto second = p_eit->second;
90  const auto lo_uid = DofEntity::getLoFieldEntityUId(bit_number, first);
91  const auto hi_uid = DofEntity::getHiFieldEntityUId(bit_number, second);
92  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(lo_uid);
93  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(hi_uid);
94  dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
95  }
97 }

◆ clear_dofs_fields_by_bit_ref()

MoFEMErrorCode MoFEM::Core::clear_dofs_fields_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Clear dofs by bit level

Implements MoFEM::CoreInterface.

Definition at line 45 of file DeleteCore.cpp.

47  {
49  if (verb == -1)
50  verb = verbose;
51  Range ents;
52  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
53  CHKERR clear_dofs_fields(ents, verb);
55 }

◆ clear_ents_fields() [1/2]

MoFEMErrorCode MoFEM::Core::clear_ents_fields ( const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Clear entities by field name

Implements MoFEM::CoreInterface.

Definition at line 113 of file DeleteCore.cpp.

113  {
115  if (verb == -1)
116  verb = verbose;
117  CHKERR clear_dofs_fields(ents, verb);
119  for (Range::const_pair_iterator p_eit = ents.pair_begin();
120  p_eit != ents.pair_end(); p_eit++) {
121  EntityHandle first = p_eit->first;
122  EntityHandle second = p_eit->second;
123  FieldEntity_multiIndex::index<Ent_mi_tag>::type::iterator dit, hi_dit;
124  dit = entsFields.get<Ent_mi_tag>().lower_bound(first);
125  hi_dit = entsFields.get<Ent_mi_tag>().upper_bound(second);
126  entsFields.get<Ent_mi_tag>().erase(dit, hi_dit);
127  }
129 }

◆ clear_ents_fields() [2/2]

MoFEMErrorCode MoFEM::Core::clear_ents_fields ( const std::string  name,
const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Clear entities by field name

Implements MoFEM::CoreInterface.

Definition at line 131 of file DeleteCore.cpp.

132  {
134  if (verb == -1)
135  verb = verbose;
136  const auto bit_number = get_field_bit_number(name);
137  CHKERR clear_dofs_fields(name, ents, verb);
138  CHKERR clear_adjacencies_entities(name, ents, verb);
139  for (Range::const_pair_iterator p_eit = ents.pair_begin();
140  p_eit != ents.pair_end(); p_eit++) {
141  const auto first = p_eit->first;
142  const auto second = p_eit->second;
143  auto dit = entsFields.get<Unique_mi_tag>().lower_bound(
144  FieldEntity::getLocalUniqueIdCalculate(bit_number, first));
145  auto hi_dit = entsFields.get<Unique_mi_tag>().upper_bound(
146  FieldEntity::getLocalUniqueIdCalculate(bit_number, second));
147  entsFields.get<Unique_mi_tag>().erase(dit, hi_dit);
148  }
150 }

◆ clear_ents_fields_by_bit_ref()

MoFEMErrorCode MoFEM::Core::clear_ents_fields_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Clear ents by bit level

Implements MoFEM::CoreInterface.

Definition at line 99 of file DeleteCore.cpp.

101  {
103  if (verb == -1)
104  verb = verbose;
105  Range ents;
106  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
107  CHKERR clear_dofs_fields(ents, verb);
109  CHKERR clear_ents_fields(ents, verb);
111 }

◆ clear_finite_elements() [1/2]

MoFEMErrorCode MoFEM::Core::clear_finite_elements ( const Range ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear finite elements

Implements MoFEM::CoreInterface.

Definition at line 273 of file DeleteCore.cpp.

273  {
275  if (verb == -1)
276  verb = verbose;
278  for (Range::const_pair_iterator p_eit = ents.pair_begin();
279  p_eit != ents.pair_end(); p_eit++) {
280  EntityHandle first = p_eit->first;
281  EntityHandle second = p_eit->second;
282  EntFiniteElement_multiIndex::index<Ent_mi_tag>::type::iterator fit, hi_fit;
283  fit = entsFiniteElements.get<Ent_mi_tag>().lower_bound(first);
284  hi_fit = entsFiniteElements.get<Ent_mi_tag>().upper_bound(second);
285  entsFiniteElements.get<Ent_mi_tag>().erase(fit, hi_fit);
286  }
288 }

◆ clear_finite_elements() [2/2]

MoFEMErrorCode MoFEM::Core::clear_finite_elements ( const std::string &  fe_name,
const Range ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear finite elements

Implements MoFEM::CoreInterface.

Definition at line 290 of file DeleteCore.cpp.

291  {
293  if (verb == -1)
294  verb = verbose;
295  CHKERR clear_adjacencies_finite_elements(fe_name, ents, verb);
296  auto fe_miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
297  if (fe_miit == finiteElements.get<FiniteElement_name_mi_tag>().end()) {
298  for (Range::const_pair_iterator p_eit = ents.pair_begin();
299  p_eit != ents.pair_end(); p_eit++) {
300  auto fit = entsFiniteElements.get<Unique_mi_tag>().lower_bound(
302  (*fe_miit)->getFEUId()));
303  auto hi_fit = entsFiniteElements.get<Unique_mi_tag>().upper_bound(
305  (*fe_miit)->getFEUId()));
306  fit = entsFiniteElements.get<Unique_mi_tag>().erase(fit, hi_fit);
307  }
308  }
310 }

◆ clear_finite_elements_by_bit_ref()

MoFEMErrorCode MoFEM::Core::clear_finite_elements_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear finite elements

Implements MoFEM::CoreInterface.

Definition at line 261 of file DeleteCore.cpp.

263  {
265  if (verb == -1)
266  verb = verbose;
267  Range ents;
268  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
269  CHKERR clear_finite_elements(ents, verb);
271 }

◆ clear_inactive_dofs()

MoFEMErrorCode MoFEM::Core::clear_inactive_dofs ( int  verb = DEFAULT_VERBOSITY)
protectedvirtual

Clear inactive dofs

Implements MoFEM::CoreInterface.

Definition at line 29 of file DeleteCore.cpp.

29  {
31  if (verb == -1)
32  verb = verbose;
33  Range ents;
34  for (DofEntity_multiIndex::iterator dit = dofsField.begin();
35  dit != dofsField.end();) {
36  if (!dit->get()->getActive()) {
37  dit = dofsField.erase(dit);
38  } else {
39  ++dit;
40  }
41  }
43 }

◆ clear_problem()

MoFEMErrorCode MoFEM::Core::clear_problem ( const std::string  name,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

clear problem

Implements MoFEM::CoreInterface.

Definition at line 269 of file ProblemsCore.cpp.

269  {
271  if (verb == -1)
272  verb = verbose;
274  ProblemsByName &prob_by_name = pRoblems.get<Problem_mi_tag>();
275  ProblemsByName::iterator p_miit = prob_by_name.find(problem_name);
276  if (p_miit == prob_by_name.end()) {
277  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
278  "problem < %s > not found, (top tip: check spelling)",
279  problem_name.c_str());
280  }
281  // zero rows
282  bool success = prob_by_name.modify(p_miit, ProblemZeroNbRowsChange());
283  if (!success)
284  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
285  "modification unsuccessful");
286  // zero cols
287  success = prob_by_name.modify(p_miit, ProblemZeroNbColsChange());
288  if (!success)
289  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
290  "modification unsuccessful");
291  // clear finite elements
292  success =
293  prob_by_name.modify(p_miit, ProblemClearNumeredFiniteElementsChange());
294  if (!success)
295  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
296  "modification unsuccessful");
297  // clear data structures
298  success = prob_by_name.modify(p_miit, ProblemClearSubProblemData());
299  if (!success)
300  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
301  "modification unsuccessful");
302  success = prob_by_name.modify(p_miit, ProblemClearComposedProblemData());
303  if (!success)
304  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
305  "modification unsuccessful");
306  if (p_miit->getRowDofsSequence())
307  p_miit->getRowDofsSequence()->clear();
308  if (p_miit->getColDofsSequence())
309  p_miit->getColDofsSequence()->clear();
310  if (p_miit->getSubData())
311  p_miit->getSubData().reset();
312  if (p_miit->getComposedProblemsData())
313  p_miit->getComposedProblemsData().reset();
315 }

◆ clear_problems()

MoFEMErrorCode MoFEM::Core::clear_problems ( int  verb = DEFAULT_VERBOSITY)
protectedvirtual

clear problems

Implements MoFEM::CoreInterface.

Definition at line 338 of file ProblemsCore.cpp.

338  {
340  if (verb == -1)
341  verb = verbose;
342  // iterate problems
343  for (auto p_miit = pRoblems.begin(); p_miit != pRoblems.end(); p_miit++)
344  CHKERR clear_problem(p_miit->getName(), verb);
346 }

◆ clearMap()

MoFEMErrorCode MoFEM::Core::clearMap ( )
protected

Cleaning database.

Definition at line 474 of file Core.cpp.

474  {
476  // Cleaning databases in interfaces
477  CHKERR getInterface<SeriesRecorder>()->clearMap();
478  CHKERR getInterface<MeshsetsManager>()->clearMap();
479  CHKERR getInterface<CutMeshInterface>()->clearMap();
480  // Cleaning databases
481  refinedEntities.clear();
482  refinedFiniteElements.clear();
483  fIelds.clear();
484  entsFields.clear();
485  dofsField.clear();
486  finiteElements.clear();
487  entsFiniteElements.clear();
488  entFEAdjacencies.clear();
489  pRoblems.clear();
491 }

◆ coreGenericConstructor()

MoFEMErrorCode MoFEM::Core::coreGenericConstructor ( moab::Interface &  moab,
MPI_Comm  comm,
const int  verbose 
)
protected

Definition at line 171 of file Core.cpp.

172  {
174 
175  // This is deprecated ONE should use MoFEM::Core::Initialize
177  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
178  "MoFEM globally is not initialised, call MoFEM::Core::Initialize");
179 
180  // Create duplicate communicator
181  wrapMPIMOABComm = boost::make_shared<WrapMPIComm>(comm, false);
182 
183  MPI_Comm_size(mofemComm, &sIze);
184  MPI_Comm_rank(mofemComm, &rAnk);
185 
186  // CHeck if moab has set communicator if not set communicator interbally
187  ParallelComm *pComm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
188  if (pComm == NULL)
189  pComm = new ParallelComm(&moab, wrapMPIMOABComm->get_comm());
190 
191  // Register interfaces for this implementation
192  CHKERR registerInterface<UnknownInterface>();
193  CHKERR registerInterface<CoreInterface>();
194  CHKERR registerInterface<DeprecatedCoreInterface>();
195 
196  // Register MOFEM events in PETSc
197  PetscLogEventRegister("FE_preProcess", 0, &MOFEM_EVENT_preProcess);
198  PetscLogEventRegister("FE_operator", 0, &MOFEM_EVENT_operator);
199  PetscLogEventRegister("FE_postProcess", 0, &MOFEM_EVENT_postProcess);
200  PetscLogEventRegister("MoFEMCreateMat", 0, &MOFEM_EVENT_createMat);
201 
202  MOFEM_LOG_CHANNEL("WORLD");
203  MOFEM_LOG_CHANNEL("SELF");
204  MOFEM_LOG_CHANNEL("SYNC");
205 
207 }

◆ create_vertices_and_add_to_field()

MoFEMErrorCode MoFEM::Core::create_vertices_and_add_to_field ( const std::string  name,
const double  coords[],
int  size,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Create a vertices and add to field object.

Create vertices and add them to field. Those vertices would be carring DOFs of the filed.

Note
This function is typically used when NOFIELD is created, for example load factor in arc-length control.
Parameters
namename of the field
bitbit ref level of the created vertices
coordsof the vertices
sizenumber of vertices
verbverbosity level
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 411 of file FieldCore.cpp.

413  {
415 
416  if (verb == DEFAULT_VERBOSITY)
417  verb = verbose;
418 
419  Range verts;
420 
421  auto create_vertices = [&]() {
423 
424  vector<double *> arrays_coord;
425  EntityHandle startv = 0;
426  ReadUtilIface *iface;
427  CHKERR get_moab().query_interface(iface);
428  CHKERR iface->get_node_coords(3, size, 0, startv, arrays_coord);
429  verts.insert(startv, startv + size - 1);
430  for (int n = 0; n != size; ++n)
431  for (auto d : {0, 1, 2})
432  arrays_coord[d][n] = coords[3 * n + d];
433 
435  };
436 
437  auto add_verts_to_field = [&]() {
439  EntityHandle field_meshset = get_field_meshset(name);
440  CHKERR get_moab().add_entities(field_meshset, verts);
442  };
443 
444  CHKERR create_vertices();
445  CHKERR add_verts_to_field();
446 
448 }

◆ delete_ents_by_bit_ref()

MoFEMErrorCode MoFEM::Core::delete_ents_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
const bool  remove_parent = false,
int  verb = DEFAULT_VERBOSITY,
MoFEMTypes  mf = MF_ZERO 
)
protectedvirtual

delete entities form mofem and moab database

Implements MoFEM::CoreInterface.

Definition at line 535 of file DeleteCore.cpp.

538  {
540  if (verb == -1)
541  verb = verbose;
542 
543  Range ents;
544  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
545  Range ents_meshsets = ents.subset_by_type(MBENTITYSET);
546  ents = subtract(ents, ents_meshsets);
547  if(ents.empty()) {
548  if (verb >= VERBOSE)
549  MOFEM_LOG("WORLD", Sev::verbose) << "Nb. of deleted entities 0";
551  }
552 
553  if (verb >= VERBOSE)
554  MOFEM_LOG("WORLD", Sev::noisy) << "Deleted ents:\n" << ents;
555 
556  CHKERR remove_ents(ents, verb);
557 
558  // remove parent
559  if (remove_parent) {
561  }
562 
563  Range meshsets;
564  CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets, true);
565  for (auto m : meshsets) {
566  CHKERR get_moab().remove_entities(m, ents);
567 
568  }
569 
570  rval = get_moab().delete_entities(ents);
571  if (rval != MB_SUCCESS) {
573  if (verb == QUIET) {
574  MOFEM_LOG("SELF", Sev::noisy) << "Problem deleting:\n" << ents;
575  } else {
576  MOFEM_LOG("SELF", Sev::warning) << "Problem deleting:\n" << ents;
577  }
578  MOFEM_LOG_CHANNEL("WORLD");
579  MOFEM_LOG_TAG("WORLD", "DeleteCore");
580  if (!(mf & MF_NOT_THROW)) {
581  CHK_MOAB_THROW(rval, "Can not delete entities");
582  } else {
583  rval = MB_SUCCESS;
584  }
585  }
586 
587  MOFEM_LOG_C("SELF", Sev::noisy, "Nb. of deleted entities %d", ents.size());
588 
590 }

◆ delete_field()

MoFEMErrorCode MoFEM::Core::delete_field ( const std::string  name,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Delete field.

Parameters
namefield name
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 609 of file DeleteCore.cpp.

609  {
611  auto &f = fIelds.get<FieldName_mi_tag>();
612  auto mit = f.find(name);
613  if (mit == f.end()) {
614  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
615  "Finite element <%s> not found", name.c_str());
616  }
617  EntityHandle meshset = mit->get()->getMeshset();
618  Range ents;
619  CHKERR get_moab().get_entities_by_handle(meshset, ents, false);
620  CHKERR remove_ents_from_field(name, ents, verb);
621  CHKERR get_moab().tag_delete((*mit)->th_FieldDataVerts);
622  CHKERR get_moab().tag_delete((*mit)->th_FieldData);
623  CHKERR get_moab().tag_delete((*mit)->th_AppOrder);
624  f.erase(mit);
625  CHKERR get_moab().delete_entities(&meshset, 1);
627 }

◆ delete_finite_element()

MoFEMErrorCode MoFEM::Core::delete_finite_element ( const std::string  name,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

delete finite element from mofem database

Implements MoFEM::CoreInterface.

Definition at line 592 of file DeleteCore.cpp.

592  {
594  auto &fe = finiteElements.get<FiniteElement_name_mi_tag>();
595  auto mit = fe.find(name);
596  if (mit == fe.end()) {
597  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
598  "Finite element <%s> not found", name.c_str());
599  }
600  EntityHandle meshset = mit->get()->getMeshset();
601  Range ents;
602  CHKERR get_moab().get_entities_by_handle(meshset, ents, false);
603  CHKERR remove_ents_from_finite_element(name, ents, verb);
604  fe.erase(mit);
605  CHKERR get_moab().delete_entities(&meshset, 1);
607 }

◆ delete_problem()

MoFEMErrorCode MoFEM::Core::delete_problem ( const std::string  name)
protectedvirtual

Delete problem.

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.

Implements MoFEM::CoreInterface.

Definition at line 108 of file ProblemsCore.cpp.

108  {
110  auto p_miit = pRoblems.get<Problem_mi_tag>().find(name);
111  if (p_miit == pRoblems.get<Problem_mi_tag>().end()) {
112  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "no such problem like < %s >",
113  name.c_str());
114  }
115  const EntityHandle meshset = p_miit->meshset;
116  pRoblems.get<Problem_mi_tag>().erase(p_miit);
117  CHKERR get_moab().delete_entities(&meshset, 1);
119 }

◆ Finalize()

MoFEMErrorCode MoFEM::Core::Finalize ( )
static

Checks for options to be called at the conclusion of the program.

MPI_Finalize() is called only if the user had not called MPI_Init() before calling Initialize.

Note
This function calls PetscInitialize, for more details see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscFinalize.html
Returns
MoFEMErrorCode
Examples
add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_blas.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, matrix_function.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, petsc_smart_ptr_objects.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, wave_equation.cpp, and wavy_surface.cpp.

Definition at line 112 of file Core.cpp.

112  {
113  if (isGloballyInitialised) {
114  PetscPopErrorHandler();
115  isGloballyInitialised = false;
116 
117  if (isInitialized == PETSC_FALSE) {
118  PetscBool is_finalized;
119  PetscFinalized(&is_finalized);
120  if (!is_finalized)
121  PetscFinalize();
122  }
123 
124  if (!mpiInitialised) {
125  int mpi_finalized;
126  MPI_Finalized(&mpi_finalized);
127  if (!mpi_finalized)
128  MPI_Finalize();
129  }
130  }
131 
132  return 0;
133 }

◆ get_basic_entity_data_ptr()

boost::shared_ptr<BasicEntityData>& MoFEM::CoreTmp< 0 >::get_basic_entity_data_ptr ( )
inlineprotectedvirtual

Get pointer to basic entity data.

This structure keeps data like tags handlers and other data used to construct mofem entities, dofs and finite elements.

Implements MoFEM::CoreInterface.

Definition at line 290 of file Core.hpp.

290  {
291  return basicEntityDataPtr;
292  }

◆ get_comm()

MPI_Comm& MoFEM::CoreTmp< 0 >::get_comm ( ) const
inlineprotectedvirtual
Returns
return communicator

Implements MoFEM::CoreInterface.

Definition at line 975 of file Core.hpp.

975 { return mofemComm; }

◆ get_comm_rank()

int MoFEM::CoreTmp< 0 >::get_comm_rank ( ) const
inlineprotectedvirtual
Returns
return communicator rank/processor

Implements MoFEM::CoreInterface.

Definition at line 985 of file Core.hpp.

985 { return rAnk; }

◆ get_comm_size()

int MoFEM::CoreTmp< 0 >::get_comm_size ( ) const
inlineprotectedvirtual
Returns
return communicator size

Implements MoFEM::CoreInterface.

Definition at line 980 of file Core.hpp.

980 { return sIze; }

◆ get_dofs() [1/2]

const DofEntity_multiIndex * MoFEM::Core::get_dofs ( ) const
protectedvirtual

Get the dofs object.

Returns
const DofEntity_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 856 of file Core.cpp.

856 { return &dofsField; }

◆ get_dofs() [2/2]

MoFEMErrorCode MoFEM::Core::get_dofs ( const DofEntity_multiIndex **  dofs_ptr) const
protectedvirtual

Get dofs multi index.

Implements MoFEM::CoreInterface.

Definition at line 795 of file Core.cpp.

795  {
797  *dofs_ptr = &dofsField;
799 }

◆ get_dofs_by_name_and_ent_begin()

DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_ent_begin ( const std::string &  field_name,
const EntityHandle  ent 
) const
protectedvirtual

get begin iterator of filed dofs of given name and ent(instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,ENT,IT)

for(IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP(MFIELD,NAME,ENT,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1325 of file FieldCore.cpp.

1326  {
1327  return dofsField.get<Unique_mi_tag>().lower_bound(
1329  ent));
1330 }

◆ get_dofs_by_name_and_ent_end()

DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_ent_end ( const std::string &  field_name,
const EntityHandle  ent 
) const
protectedvirtual

get begin iterator of filed dofs of given name and ent (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,ENT,IT)

for(IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP(MFIELD,NAME,ENT,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1332 of file FieldCore.cpp.

1333  {
1334  return dofsField.get<Unique_mi_tag>().upper_bound(
1336  ent));
1337 }

◆ get_dofs_by_name_and_type_begin()

DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_type_begin ( const std::string &  field_name,
const EntityType  type 
) const
protectedvirtual

get begin iterator of filed dofs of given name and ent type (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,TYPE,IT)

for(IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP(MFIELD,NAME,TYPE,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1339 of file FieldCore.cpp.

1340  {
1341  return dofsField.get<Unique_mi_tag>().lower_bound(
1344 }

◆ get_dofs_by_name_and_type_end()

DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_type_end ( const std::string &  field_name,
const EntityType  type 
) const
protectedvirtual

get begin iterator of filed dofs of given name end ent type(instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,TYPE,IT)

for(IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP(MFIELD,NAME,TYPE,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1346 of file FieldCore.cpp.

1347  {
1348  return dofsField.get<Unique_mi_tag>().upper_bound(
1351 }

◆ get_dofs_by_name_begin()

DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_begin ( const std::string &  field_name) const
protectedvirtual

get begin iterator of filed dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)

for(IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1315 of file FieldCore.cpp.

1315  {
1316  return dofsField.get<Unique_mi_tag>().lower_bound(
1318 }

◆ get_dofs_by_name_end()

DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_end ( const std::string &  field_name) const
protectedvirtual

get begin iterator of filed dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)

for(IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1320 of file FieldCore.cpp.

1320  {
1321  return dofsField.get<Unique_mi_tag>().upper_bound(
1323 }

◆ get_ent_field_by_name_begin()

FieldEntityByUId::iterator MoFEM::Core::get_ent_field_by_name_begin ( const std::string &  field_name) const
protectedvirtual

get begin iterator of filed ents of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)

for(IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1305 of file FieldCore.cpp.

1305  {
1306  return entsFields.get<Unique_mi_tag>().lower_bound(
1308 }

◆ get_ent_field_by_name_end()

FieldEntityByUId::iterator MoFEM::Core::get_ent_field_by_name_end ( const std::string &  field_name) const
protectedvirtual

get begin iterator of filed dofs of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)

for(IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }

Parameters
field_name

Implements MoFEM::CoreInterface.

Definition at line 1310 of file FieldCore.cpp.

1310  {
1311  return entsFields.get<Unique_mi_tag>().upper_bound(
1313 }

◆ get_ents_elements_adjacency() [1/2]

const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * MoFEM::Core::get_ents_elements_adjacency ( ) const
protectedvirtual

Get the dofs elements adjacency object.

Returns
const FieldEntityEntFiniteElementAdjacencyMap_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 836 of file Core.cpp.

836  {
837  return &entFEAdjacencies;
838 }

◆ get_ents_elements_adjacency() [2/2]

MoFEMErrorCode MoFEM::Core::get_ents_elements_adjacency ( const FieldEntityEntFiniteElementAdjacencyMap_multiIndex **  dofs_elements_adjacency) const
protectedvirtual

Get the dofs elements adjacency object.

Parameters
dofs_elements_adjacency
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 827 of file Core.cpp.

829  {
831  *dofs_elements_adjacency = &entFEAdjacencies;
833 }

◆ get_ents_finite_elements() [1/2]

const EntFiniteElement_multiIndex * MoFEM::Core::get_ents_finite_elements ( ) const
protectedvirtual

Get the ents finite elements object.

Returns
const EntFiniteElement_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 850 of file Core.cpp.

850  {
851  return &entsFiniteElements;
852 }

◆ get_ents_finite_elements() [2/2]

MoFEMErrorCode MoFEM::Core::get_ents_finite_elements ( const EntFiniteElement_multiIndex **  fe_ent_ptr) const
protectedvirtual

Get entities finite elements multi-index.

Implements MoFEM::CoreInterface.

Definition at line 808 of file Core.cpp.

809  {
811  *fe_ent_ptr = &entsFiniteElements;
813 }

◆ get_fe_by_name_begin()

EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator MoFEM::Core::get_fe_by_name_begin ( const std::string &  fe_name) const
protectedvirtual

get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)

for(IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }

Parameters
fe_name

Implements MoFEM::CoreInterface.

Definition at line 839 of file FECore.cpp.

839  {
840  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
841  if (miit != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
842  return entsFiniteElements.get<Unique_mi_tag>().lower_bound(
843  EntFiniteElement::getLocalUniqueIdCalculate(0, (*miit)->getFEUId()));
844  } else {
845  return entsFiniteElements.get<Unique_mi_tag>().end();
846  }
847 }

◆ get_fe_by_name_end()

EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator MoFEM::Core::get_fe_by_name_end ( const std::string &  fe_name) const
protectedvirtual

get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)

for(IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }

Parameters
fe_name

Implements MoFEM::CoreInterface.

Definition at line 850 of file FECore.cpp.

850  {
851  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
852  if (miit != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
853  return entsFiniteElements.get<Unique_mi_tag>().upper_bound(
855  get_id_for_max_type<MBENTITYSET>(), (*miit)->getFEUId()));
856  } else {
857  return entsFiniteElements.get<Unique_mi_tag>().end();
858  }
859 }

◆ get_field_bit_number()

FieldBitNumber MoFEM::Core::get_field_bit_number ( const std::string  name) const
protectedvirtual

get field bit number

Parameters
nameof field Example:
auto field_number = mField.get_field_bit_number("DISPLACEMENT");

Implements MoFEM::CoreInterface.

Definition at line 28 of file FieldCore.cpp.

28  {
29  auto &set = fIelds.get<FieldName_mi_tag>();
30  auto miit = set.find(name);
31  if (miit == set.end())
32  THROW_MESSAGE("field < " + name +
33  " > not in database (top tip: check spelling)");
34  return (*miit)->getBitNumber();
35 }

◆ get_field_entities_by_dimension()

MoFEMErrorCode MoFEM::Core::get_field_entities_by_dimension ( const std::string  name,
int  dim,
Range ents 
) const
protectedvirtual

get entities in the field by dimension

Parameters
namefield name
dimdim
entsents
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 81 of file FieldCore.cpp.

83  {
84 
86  EntityHandle meshset = get_field_meshset(name);
87  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, true);
89 }

◆ get_field_entities_by_handle()

MoFEMErrorCode MoFEM::Core::get_field_entities_by_handle ( const std::string  name,
Range ents 
) const
protectedvirtual

get entities in the field by handle

Parameters
namefield name
entsents
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 100 of file FieldCore.cpp.

101  {
103  EntityHandle meshset = get_field_meshset(name);
104  CHKERR get_moab().get_entities_by_handle(meshset, ents, true);
106 }

◆ get_field_entities_by_type()

MoFEMErrorCode MoFEM::Core::get_field_entities_by_type ( const std::string  name,
EntityType  type,
Range ents 
) const
protectedvirtual

get entities in the field by type

Parameters
namefield name
typeentity type
entsents
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 91 of file FieldCore.cpp.

93  {
95  EntityHandle meshset = get_field_meshset(name);
96  CHKERR get_moab().get_entities_by_type(meshset, type, ents, true);
98 }

◆ get_field_ents() [1/2]

const FieldEntity_multiIndex * MoFEM::Core::get_field_ents ( ) const
protectedvirtual

Get the field ents object.

Returns
const FieldEntity_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 853 of file Core.cpp.

853  {
854  return &entsFields;
855 }

◆ get_field_ents() [2/2]

MoFEMErrorCode MoFEM::Core::get_field_ents ( const FieldEntity_multiIndex **  field_ents) const
protectedvirtual

Get field multi index.

Implements MoFEM::CoreInterface.

Definition at line 790 of file Core.cpp.

790  {
792  *field_ents = &entsFields;
794 }

◆ get_field_id()

BitFieldId MoFEM::Core::get_field_id ( const std::string &  name) const
protectedvirtual

Get field Id.

Parameters
nameof field
Returns
BitFieldId

Implements MoFEM::CoreInterface.

Definition at line 18 of file FieldCore.cpp.

18  {
19  auto &set = fIelds.get<FieldName_mi_tag>();
20  auto miit = set.find(name);
21  if (miit == set.end()) {
22  THROW_MESSAGE("field < " + name +
23  " > not in database (top tip: check spelling)");
24  }
25  return (*miit)->getId();
26 }

◆ get_field_meshset() [1/2]

EntityHandle MoFEM::Core::get_field_meshset ( const BitFieldId  id) const
protected

Definition at line 45 of file FieldCore.cpp.

45  {
46  auto &set = fIelds.get<BitFieldId_mi_tag>();
47  auto miit = set.find(id);
48  if (miit == set.end())
49  THROW_MESSAGE("field not in database (top tip: check spelling)");
50  return (*miit)->meshSet;
51 }

◆ get_field_meshset() [2/2]

EntityHandle MoFEM::Core::get_field_meshset ( const std::string  name) const
protectedvirtual

get field meshset

Parameters
nameof Field Example:
EntityHandle disp_files_meshset = mField.get_field_meshset("DISPLACEMENT");

Implements MoFEM::CoreInterface.

Definition at line 53 of file FieldCore.cpp.

53  {
54  return get_field_meshset(get_field_id(name));
55 }

◆ get_field_name()

std::string MoFEM::Core::get_field_name ( const BitFieldId  id) const
protectedvirtual

get field name from id

Parameters
id
Returns
std::string

Implements MoFEM::CoreInterface.

Definition at line 37 of file FieldCore.cpp.

37  {
38  auto &set = fIelds.get<BitFieldId_mi_tag>();
39  auto miit = set.find(id);
40  if (miit == set.end())
41  THROW_MESSAGE("field not in database (top tip: check spelling)");
42  return (*miit)->getName();
43 }

◆ get_field_structure()

const Field * MoFEM::Core::get_field_structure ( const std::string &  name,
enum MoFEMTypes  bh = MF_EXIST 
) const
protectedvirtual

get field structure

If field is not found throw error if bh == MF_EXIST, or return nullptr if bh == MF_ZERO, i.e. otherwise

Parameters
namefield name
bhcontrols behaviour
Returns
const Field*

Implements MoFEM::CoreInterface.

Definition at line 65 of file FieldCore.cpp.

66  {
67  auto miit = fIelds.get<FieldName_mi_tag>().find(name);
68  if (miit == fIelds.get<FieldName_mi_tag>().end()) {
69  if (bh == MF_EXIST)
70  throw MoFEMException(
72  std::string("field < " + name +
73  " > not in database (top tip: check spelling)")
74  .c_str());
75  else
76  return nullptr;
77  }
78  return miit->get();
79 }

◆ get_fields() [1/2]

const Field_multiIndex * MoFEM::Core::get_fields ( ) const
protectedvirtual

Get the fields object.

Returns
const Field_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 840 of file Core.cpp.

840 { return &fIelds; }

◆ get_fields() [2/2]

MoFEMErrorCode MoFEM::Core::get_fields ( const Field_multiIndex **  fields_ptr) const
protectedvirtual

Get fields multi-index from database.

Implements MoFEM::CoreInterface.

Definition at line 748 of file Core.cpp.

748  {
750  *fields_ptr = &fIelds;
752 }

◆ get_finite_element_entities_by_dimension()

MoFEMErrorCode MoFEM::Core::get_finite_element_entities_by_dimension ( const std::string  name,
int  dim,
Range ents 
) const
protectedvirtual

get entities in the finite element by dimension

Parameters
namefinite element name
dimdim
entsents
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 289 of file FECore.cpp.

290  {
291 
293 
295  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, true);
297 }

◆ get_finite_element_entities_by_handle()

MoFEMErrorCode MoFEM::Core::get_finite_element_entities_by_handle ( const std::string  name,
Range ents 
) const
protectedvirtual

get entities in the finite element by handle

Parameters
namefinite element name
entsents
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 312 of file FECore.cpp.

313  {
314 
316 
318  CHKERR get_moab().get_entities_by_handle(meshset, ents, true);
319 
321 }

◆ get_finite_element_entities_by_type()

MoFEMErrorCode MoFEM::Core::get_finite_element_entities_by_type ( const std::string  name,
EntityType  type,
Range ents 
) const
protectedvirtual

get entities in the finite element by type

Parameters
namefinite element name
typeentity type
entsents
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 299 of file FECore.cpp.

301  {
302 
304 
306  CHKERR get_moab().get_entities_by_type(meshset, type, ents, true);
307 
309 }

◆ get_finite_element_meshset() [1/2]

EntityHandle MoFEM::Core::get_finite_element_meshset ( const BitFEId  id) const
protected

Definition at line 276 of file FECore.cpp.

276  {
277  auto &fe_by_id = finiteElements.get<BitFEId_mi_tag>();
278  auto miit = fe_by_id.find(id);
279  if (miit == fe_by_id.end())
280  THROW_MESSAGE("finite element not found");
281  return (*miit)->meshset;
282 }

◆ get_finite_element_meshset() [2/2]

EntityHandle MoFEM::Core::get_finite_element_meshset ( const std::string  name) const
protectedvirtual

get finite element meshset

Implements MoFEM::CoreInterface.

Definition at line 284 of file FECore.cpp.

284  {
286 }

◆ get_finite_element_structure()

const FiniteElement * MoFEM::Core::get_finite_element_structure ( const std::string &  name,
enum MoFEMTypes  bh = MF_EXCL 
) const
protectedvirtual

get finite element struture

If finite element is not found throw error if bh == MF_EXIST, or return nullptr if bh == MF_ZERO, i.e. otherwise

Parameters
name
bh
Returns
FiniteElement*

Implements MoFEM::CoreInterface.

Definition at line 18 of file FECore.cpp.

19  {
20  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
21  if (miit == finiteElements.get<FiniteElement_name_mi_tag>().end()) {
22  if (bh == MF_EXIST) {
23  throw MoFEMException(
25  std::string("finite element < " + name +
26  " > not in database (top tip: check spelling)")
27  .c_str());
28  } else {
29  return nullptr;
30  }
31  }
32  return miit->get();
33 }

◆ get_finite_elements() [1/2]

const FiniteElement_multiIndex * MoFEM::Core::get_finite_elements ( ) const
protectedvirtual

Get the finite elements object.

Returns
const FiniteElement_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 847 of file Core.cpp.

847  {
848  return &finiteElements;
849 }

◆ get_finite_elements() [2/2]

MoFEMErrorCode MoFEM::Core::get_finite_elements ( const FiniteElement_multiIndex **  fe_ptr) const
protectedvirtual

Get finite elements multi-index.

Implements MoFEM::CoreInterface.

Definition at line 802 of file Core.cpp.

802  {
804  *fe_ptr = &finiteElements;
806 }

◆ get_meshsets_manager() [1/2]

MeshsetsManager& MoFEM::CoreTmp< 0 >::get_meshsets_manager ( )
inlineprotectedvirtual

get MeshsetsManager pointer

Implements MoFEM::CoreInterface.

Definition at line 361 of file Core.hpp.

361  {
362  return *get_meshsets_manager_ptr();
363  }

◆ get_meshsets_manager() [2/2]

const MeshsetsManager& MoFEM::CoreTmp< 0 >::get_meshsets_manager ( ) const
inlineprotectedvirtual

get MeshsetsManager pointer

Implements MoFEM::CoreInterface.

Definition at line 364 of file Core.hpp.

364  {
365  return *get_meshsets_manager_ptr();
366  }

◆ get_meshsets_manager_ptr() [1/2]

const MeshsetsManager * MoFEM::Core::get_meshsets_manager_ptr ( )
protectedvirtual

get MeshsetsManager pointer

Implements MoFEM::CoreInterface.

Definition at line 815 of file Core.cpp.

815  {
816  MeshsetsManager *meshsets_manager_ptr;
817  getInterface(meshsets_manager_ptr);
818  return meshsets_manager_ptr;
819 }

◆ get_meshsets_manager_ptr() [2/2]

const MeshsetsManager* MoFEM::CoreTmp< 0 >::get_meshsets_manager_ptr ( ) const
protectedvirtual

get MeshsetsManager pointer

Implements MoFEM::CoreInterface.

◆ get_moab() [1/2]

moab::Interface& MoFEM::CoreTmp< 0 >::get_moab ( )
inlineprotectedvirtual

get moab instance

Implements MoFEM::CoreInterface.

Definition at line 322 of file Core.hpp.

322 { return moab; }

◆ get_moab() [2/2]

const moab::Interface& MoFEM::CoreTmp< 0 >::get_moab ( ) const
inlineprotectedvirtual

get moab instance interface

Implements MoFEM::CoreInterface.

Definition at line 323 of file Core.hpp.

323 { return moab; }

◆ get_problem() [1/2]

MoFEMErrorCode MoFEM::Core::get_problem ( const std::string &  problem_name,
const Problem **  problem_ptr 
) const
protectedvirtual

Get problem database (data structure)

Implements MoFEM::CoreInterface.

Definition at line 767 of file Core.cpp.

768  {
771  const ProblemsByName &problems = pRoblems.get<Problem_mi_tag>();
772  ProblemsByName::iterator p_miit = problems.find(problem_name);
773  if (p_miit == problems.end()) {
774  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
775  "problem < %s > not found, (top tip: check spelling)",
776  problem_name.c_str());
777  }
778  *problem_ptr = &*p_miit;
780 }

◆ get_problem() [2/2]

const Problem * MoFEM::Core::get_problem ( const std::string  problem_name) const
protectedvirtual

Get the problem object.

Parameters
problem_name
Returns
const Problem*

Implements MoFEM::CoreInterface.

Definition at line 857 of file Core.cpp.

857  {
858  const Problem *prb;
859  CHK_THROW_MESSAGE(get_problem(problem_name, &prb),
860  "Problem of given name not found");
861  return prb;
862 }

◆ get_problem_finite_elements_entities()

MoFEMErrorCode MoFEM::Core::get_problem_finite_elements_entities ( const std::string  name,
const std::string &  fe_name,
const EntityHandle  meshset 
)
protectedvirtual

add finite elements to the meshset

Parameters
nameis problem name
fe_name
meshset

Implements MoFEM::CoreInterface.

Definition at line 914 of file FECore.cpp.

916  {
918  auto &prb = pRoblems.get<Problem_mi_tag>();
919  auto p_miit = prb.find(problem_name);
920  if (p_miit == prb.end())
921  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
922  "No such problem like < %s >", problem_name.c_str());
923 
924  auto fe_miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
925  if (fe_miit != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
926  auto miit =
927  p_miit->numeredFiniteElementsPtr->get<Unique_mi_tag>().lower_bound(
929  0, (*fe_miit)->getFEUId()));
930  auto hi_miit =
931  p_miit->numeredFiniteElementsPtr->get<Unique_mi_tag>().upper_bound(
933  get_id_for_max_type<MBENTITYSET>(), (*fe_miit)->getFEUId()));
934 
935  if (miit != hi_miit) {
936  std::vector<EntityHandle> ents;
937  ents.reserve(std::distance(miit, hi_miit));
938  for (; miit != hi_miit; ++miit)
939  ents.push_back((*miit)->getEnt());
940  int part = (*miit)->getPart();
941  CHKERR get_moab().tag_clear_data(th_Part, &*ents.begin(), ents.size(),
942  &part);
943  CHKERR get_moab().add_entities(meshset, &*ents.begin(), ents.size());
944  }
945  }
946 
948 }

◆ get_problems() [1/2]

const Problem_multiIndex * MoFEM::Core::get_problems ( ) const
protectedvirtual

Get the problems object.

Returns
const Problem_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 863 of file Core.cpp.

863 { return &pRoblems; }

◆ get_problems() [2/2]

MoFEMErrorCode MoFEM::Core::get_problems ( const Problem_multiIndex **  problems_ptr) const
protectedvirtual

Get pointer to problems multi-index.

Implements MoFEM::CoreInterface.

Definition at line 783 of file Core.cpp.

783  {
785  *problems_ptr = &pRoblems;
787 }

◆ get_ref_ents() [1/2]

const RefEntity_multiIndex * MoFEM::Core::get_ref_ents ( ) const
protectedvirtual

Get the ref ents object.

Returns
const RefEntity_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 841 of file Core.cpp.

841  {
842  return &refinedEntities;
843 }

◆ get_ref_ents() [2/2]

MoFEMErrorCode MoFEM::Core::get_ref_ents ( const RefEntity_multiIndex **  refined_ents_ptr) const
protectedvirtual

Get ref entities multi-index from database.

Implements MoFEM::CoreInterface.

Definition at line 755 of file Core.cpp.

755  {
757  *refined_entities_ptr = &refinedEntities;
759 }

◆ get_ref_finite_elements() [1/2]

const RefElement_multiIndex * MoFEM::Core::get_ref_finite_elements ( ) const
protectedvirtual

Get the ref finite elements object.

Returns
const RefElement_multiIndex*

Implements MoFEM::CoreInterface.

Definition at line 844 of file Core.cpp.

844  {
845  return &refinedFiniteElements;
846 }

◆ get_ref_finite_elements() [2/2]

MoFEMErrorCode MoFEM::Core::get_ref_finite_elements ( const RefElement_multiIndex **  refined_finite_elements_ptr) const
protectedvirtual

Get ref finite elements multi-index form database.

Implements MoFEM::CoreInterface.

Definition at line 760 of file Core.cpp.

761  {
763  *refined_finite_elements_ptr = &refinedFiniteElements;
765 }

◆ get_th_RefBitEdge()

Tag MoFEM::CoreTmp< 0 >::get_th_RefBitEdge ( ) const
inline

Definition at line 199 of file Core.hpp.

199 { return th_RefBitEdge; }

◆ get_th_RefBitLevel()

Tag MoFEM::CoreTmp< 0 >::get_th_RefBitLevel ( ) const
inline

Definition at line 198 of file Core.hpp.

198 { return th_RefBitLevel; }

◆ get_th_RefParentHandle()

Tag MoFEM::CoreTmp< 0 >::get_th_RefParentHandle ( ) const
inline

Definition at line 197 of file Core.hpp.

197 { return th_RefParentHandle; }

◆ getBitFEId()

BitFEId MoFEM::Core::getBitFEId ( const std::string &  fe_name) const
protected

Get field Id.

Parameters
namefield name
Returns
field id

Definition at line 258 of file FECore.cpp.

258  {
259  auto &fe_by_id = finiteElements.get<FiniteElement_name_mi_tag>();
260  auto miit = fe_by_id.find(fe_name);
261  if (miit == fe_by_id.end())
263  ("finite element < " + fe_name + " > not found (top tip: check spelling)")
264  .c_str());
265  return (*miit)->getId();
266 }

◆ getBitFEIdName()

std::string MoFEM::Core::getBitFEIdName ( const BitFEId  id) const
protected

Get field name.

Parameters
idfield id
Returns
field name

Definition at line 268 of file FECore.cpp.

268  {
269  auto &fe_by_id = finiteElements.get<BitFEId_mi_tag>();
270  auto miit = fe_by_id.find(id);
271  if (miit == fe_by_id.end())
272  THROW_MESSAGE("finite element not found");
273  return (*miit)->getName();
274 }

◆ getBitProblemId()

BitProblemId MoFEM::Core::getBitProblemId ( const std::string &  name) const
protected

Definition at line 121 of file ProblemsCore.cpp.

121  {
122  auto p_miit = pRoblems.get<Problem_mi_tag>().find(name);
123  if (p_miit == pRoblems.get<Problem_mi_tag>().end()) {
124  THROW_MESSAGE("no such problem like " + name + " >");
125  }
126  return p_miit->getId();
127 }

◆ getBuildMoFEM()

int& MoFEM::CoreTmp< 0 >::getBuildMoFEM ( ) const
inline

Get flags/semaphores for different stages.

Definition at line 225 of file Core.hpp.

225 { return *buildMoFEM; }

◆ getOptions()

MoFEMErrorCode MoFEM::Core::getOptions ( int  verb = DEFAULT_VERBOSITY)
protected

Get core options from command line.

Returns
MoFEMErrorCode

Definition at line 721 of file Core.cpp.

721  {
723  if (verb == -1)
724  verb = verbose;
725 
726  CHKERR PetscOptionsBegin(mofemComm, optionsPrefix.c_str(), "Mesh cut options",
727  "See MoFEM documentation");
728 
729  CHKERR PetscOptionsBool(
730  "-mofem_init_fields", "Initialise fields on construction", "",
732 
733  CHKERR PetscOptionsBool(
734  "-mofem_init_fields", "Initialise fields on construction", "",
736 
737  // TODO: Add read verbosity level
738  // TODO: Add option to initalise problems ??? - DO WE REALLY NEED THAT
739 
740  ierr = PetscOptionsEnd();
741  CHKERRG(ierr);
742 
744 }

◆ getProblemShift()

BitProblemId MoFEM::CoreTmp< 0 >::getProblemShift ( )
protected

Return unique problem Id.

Each time this function is called, it gives new unit problem Id for bit.

◆ getRefEntity()

RefEntityTmp<0> MoFEM::CoreTmp< 0 >::getRefEntity ( const EntityHandle  ent)
inline

Definition at line 86 of file Core.hpp.

86  {
87  return RefEntityTmp<0>(this->basicEntityDataPtr, ent);
88  }

◆ getTags()

MoFEMErrorCode MoFEM::Core::getTags ( int  verb = DEFAULT_VERBOSITY)
protected

Get tag handles.

Parameters
verbverbosity level
Returns
error code

Definition at line 522 of file Core.cpp.

522  {
524 
525  const EntityHandle root_meshset = get_moab().get_root_set();
526  if (root_meshset) {
527  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
528  "Root meshset should be 0");
529  }
530 
531  // Set version
532  {
533  Version version;
534  CHKERR getFileVersion(moab, version);
535  }
536 
537  // Global Variables
538  {
539 
540  auto check_tag_allocated = [](auto &rval) {
542  if (rval == MB_ALREADY_ALLOCATED)
543  rval = MB_SUCCESS;
544  else
545  CHKERRG(rval);
547  };
548 
549  // Safety nets
550  int def_bool = 0;
551  rval = get_moab().tag_get_handle("_MoFEMBuild", 1, MB_TYPE_INTEGER,
552  th_MoFEMBuild, MB_TAG_CREAT | MB_TAG_MESH,
553  &def_bool);
554  CHKERR check_tag_allocated(rval);
555 
556  CHKERR get_moab().tag_get_by_ptr(th_MoFEMBuild, &root_meshset, 1,
557  (const void **)&buildMoFEM);
558  }
559 
560  // Tags saved in vtk-files
561  {
562  const int def_part = -1;
563  CHKERR get_moab().tag_get_handle("PARTITION", 1, MB_TYPE_INTEGER, th_Part,
564  MB_TAG_CREAT | MB_TAG_SPARSE, &def_part);
565  }
566 
567  // Tags Ref
568  {
569 
570  // Fix size of bir ref level tags
572 
573  const int def_part = -1;
574  CHKERR get_moab().tag_get_handle("_MeshsetPartition", 1, MB_TYPE_INTEGER,
575  th_Part, MB_TAG_CREAT | MB_TAG_SPARSE,
576  &def_part);
577  EntityHandle def_handle = 0;
578  CHKERR get_moab().tag_get_handle("_RefParentHandle", 1, MB_TYPE_HANDLE,
580  MB_TAG_CREAT | MB_TAG_SPARSE, &def_handle);
581  BitRefLevel def_bit_level = 0;
582  CHKERR get_moab().tag_get_handle(
583  "_RefBitLevel", sizeof(BitRefLevel), MB_TYPE_OPAQUE, th_RefBitLevel,
584  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_bit_level);
585  BitRefLevel def_bit_level_mask = BitRefLevel().set();
586  CHKERR get_moab().tag_get_handle(
587  "_RefBitLevelMask", sizeof(BitRefLevel), MB_TYPE_OPAQUE,
588  th_RefBitLevel_Mask, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
589  &def_bit_level_mask);
590  BitRefEdges def_bit_edge = 0;
591  CHKERR get_moab().tag_get_handle(
592  "_RefBitEdge", sizeof(BitRefEdges), MB_TYPE_OPAQUE, th_RefBitEdge,
593  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_bit_edge);
594  }
595 
596  // Tags Field
597  {
598  const unsigned long int def_id = 0;
599  CHKERR get_moab().tag_get_handle(
600  "_FieldId", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FieldId,
601  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
602  FieldSpace def_space = LASTSPACE;
603  CHKERR get_moab().tag_get_handle(
604  "_FieldSpace", sizeof(FieldSpace), MB_TYPE_OPAQUE, th_FieldSpace,
605  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_space);
606  FieldApproximationBase def_base = LASTBASE;
607  CHKERR get_moab().tag_get_handle(
608  "_FieldBase", sizeof(FieldApproximationBase), MB_TYPE_OPAQUE,
609  th_FieldBase, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_base);
610  const int def_val_len = 0;
611  CHKERR get_moab().tag_get_handle(
612  "_FieldName", def_val_len, MB_TYPE_OPAQUE, th_FieldName,
613  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
614  CHKERR get_moab().tag_get_handle(
615  "_FieldName_DataNamePrefix", def_val_len, MB_TYPE_OPAQUE,
617  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
618  }
619 
620  // Tags FE
621  {
622  const unsigned long int def_id = 0;
623  const int def_val_len = 0;
624  CHKERR get_moab().tag_get_handle(
625  "_FEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_FEId,
626  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
627  CHKERR get_moab().tag_get_handle(
628  "_FEName", def_val_len, MB_TYPE_OPAQUE, th_FEName,
629  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
630  CHKERR get_moab().tag_get_handle(
631  "_FEIdCol", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdCol,
632  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
633  CHKERR get_moab().tag_get_handle(
634  "_FEIdRow", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdRow,
635  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
636  CHKERR get_moab().tag_get_handle(
637  "_FEIdData", sizeof(BitFieldId), MB_TYPE_OPAQUE, th_FEIdData,
638  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
639  }
640 
641  // Tags Problem
642  {
643  const unsigned long int def_id = 0;
644  const int def_val_len = 0;
645  CHKERR get_moab().tag_get_handle(
646  "_ProblemId", sizeof(BitProblemId), MB_TYPE_OPAQUE, th_ProblemId,
647  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
648  CHKERR get_moab().tag_get_handle(
649  "_ProblemFEId", sizeof(BitFEId), MB_TYPE_OPAQUE, th_ProblemFEId,
650  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
651  CHKERR get_moab().tag_get_handle(
652  "_ProblemName", def_val_len, MB_TYPE_OPAQUE, th_ProblemName,
653  MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
654  DofIdx def_nbdofs = 0;
655  CHKERR get_moab().tag_get_handle(
656  "_ProblemNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
657  th_ProblemNbDofsRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
658  &def_nbdofs);
659  CHKERR get_moab().tag_get_handle(
660  "_ProblemNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
661  th_ProblemNbDofsCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
662  &def_nbdofs);
663  CHKERR get_moab().tag_get_handle(
664  "_ProblemLocalNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
665  th_ProblemLocalNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
666  &def_nbdofs);
667  CHKERR get_moab().tag_get_handle(
668  "_ProblemGhostNbDofsRow", sizeof(DofIdx), MB_TYPE_OPAQUE,
669  th_ProblemGhostNbDofRow, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
670  &def_nbdofs);
671  CHKERR get_moab().tag_get_handle(
672  "_ProblemLocalNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
673  th_ProblemLocalNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
674  &def_nbdofs);
675  CHKERR get_moab().tag_get_handle(
676  "_ProblemGhostNbDofsCol", sizeof(DofIdx), MB_TYPE_OPAQUE,
677  th_ProblemGhostNbDofCol, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE,
678  &def_nbdofs);
679  }
680 
681  // Meshsets with boundary conditions and material sets
682  MeshsetsManager *meshsets_manager_ptr;
683  CHKERR getInterface(meshsets_manager_ptr);
684  CHKERR meshsets_manager_ptr->getTags(verb);
685 
686  // Series recorder
687  SeriesRecorder *series_recorder_ptr;
688  CHKERR getInterface(series_recorder_ptr);
689  CHKERR series_recorder_ptr->getTags(verb);
690 
692 }

◆ getValue()

const int MoFEM::CoreTmp< 0 >::getValue ( ) const
inlinevirtual

Get the core.

Returns
int

Implements MoFEM::CoreInterface.

Reimplemented in MoFEM::CoreTmp<-1 >.

Definition at line 85 of file Core.hpp.

85 { return value; }

◆ initialiseDatabaseFromMesh()

MoFEMErrorCode MoFEM::Core::initialiseDatabaseFromMesh ( int  verb = DEFAULT_VERBOSITY)
protected

Initialize database getting information on mesh.

Definition at line 268 of file Core.cpp.

268  {
269  MOFEM_LOG_CHANNEL("WORLD");
271  if (verb == -1)
272  verb = verbose;
273 
274  Range ref_elems_to_add;
275 
276  // Initialize database
277  Range meshsets;
278  CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets, false);
279  Range special_meshsets;
280  for (auto mit : meshsets) {
281  BitFieldId field_id;
282  // Get bit id form field tag
283  CHKERR get_moab().tag_get_data(th_FieldId, &mit, 1, &field_id);
284  // Check if meshset if field meshset
285  if (field_id != 0) {
286 
287  const void *tag_name;
288  int tag_name_size;
289  CHKERR get_moab().tag_get_by_ptr(
290  th_FieldName, &mit, 1, (const void **)&tag_name, &tag_name_size);
291 
292  if (verb > QUIET)
293  MOFEM_LOG("WORLD", Sev::verbose)
294  << "Read field "
295  << boost::string_ref((char *)tag_name, tag_name_size);
296 
297  auto p = fIelds.insert(boost::make_shared<Field>(moab, mit));
298 
299  if (!p.second) {
300  // Field meshset exists, remove duplicate meshsets from other
301  // processors.
302  Range ents;
303  CHKERR get_moab().get_entities_by_handle(mit, ents, true);
304  CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
305  CHKERR get_moab().delete_entities(&mit, 1);
306  } else {
307  special_meshsets.insert(mit);
308  }
309  }
310  // Check for finite elements
311  BitFieldId fe_id;
312  // Get bit id from fe tag
313  CHKERR get_moab().tag_get_data(th_FEId, &mit, 1, &fe_id);
314  // check if meshset is finite element meshset
315  if (fe_id != 0) {
316  std::pair<FiniteElement_multiIndex::iterator, bool> p =
317  finiteElements.insert(
318  boost::shared_ptr<FiniteElement>(new FiniteElement(moab, mit)));
319  if (verb > QUIET)
320  MOFEM_LOG("WORLD", Sev::verbose) << "Read finite element " << **p.first;
321 
322  Range ents;
323  CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents, false);
324  CHKERR get_moab().get_entities_by_handle(mit, ents, true);
325  ref_elems_to_add.merge(ents);
326  if (!p.second) {
327  // Finite element mesh set exist, could be created on other processor.
328  // Remove duplicate.
329  CHKERR get_moab().add_entities((*p.first)->getMeshset(), ents);
330  CHKERR get_moab().delete_entities(&mit, 1);
331  } else {
332  special_meshsets.insert(mit);
333  }
334  }
335  BitProblemId problem_id;
336  // get bit id form problem tag
337  CHKERR get_moab().tag_get_data(th_ProblemId, &mit, 1, &problem_id);
338  // check if meshset if problem meshset
339  if (problem_id != 0) {
340  std::pair<Problem_multiIndex::iterator, bool> p =
341  pRoblems.insert(Problem(moab, mit));
342  if (verb > QUIET) {
343  MOFEM_LOG("WORLD", Sev::verbose) << "Read problem " << *p.first;
344  MOFEM_LOG("WORLD", Sev::noisy)
345  << "\tBitRef " << p.first->getBitRefLevel() << " BitMask "
346  << p.first->getBitRefLevelMask();
347  }
348 
349  if (!p.second) {
350  // Problem meshset exists, could be created on other processor.
351  // Remove duplicate.
352  Range ents;
353  CHKERR get_moab().get_entities_by_handle(mit, ents, true);
354  CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents, true);
355  CHKERR get_moab().add_entities(p.first->meshset, ents);
356  CHKERR get_moab().delete_entities(&mit, 1);
357  } else {
358  special_meshsets.insert(mit);
359  }
360  }
361  }
362 
363  // Add entities to database
364  Range bit_ref_ents;
365  CHKERR get_moab().get_entities_by_handle(0, bit_ref_ents, false);
366  bit_ref_ents = subtract(bit_ref_ents, special_meshsets);
367  CHKERR getInterface<BitRefManager>()->filterEntitiesByRefLevel(
368  BitRefLevel().set(), BitRefLevel().set(), bit_ref_ents);
369  CHKERR getInterface<BitRefManager>()->setEntitiesBitRefLevel(bit_ref_ents);
370  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
371  ref_elems_to_add);
372 
373  // Build field entities
374  for (auto field : fIelds) {
375  if (field->getSpace() != NOSPACE) {
376  Range ents_of_id_meshset;
377  CHKERR get_moab().get_entities_by_handle(field->getMeshset(),
378  ents_of_id_meshset, false);
379  CHKERR set_field_order(ents_of_id_meshset, field->getId(), -1, verb);
380  }
381  }
382 
384  CHKERR build_fields(verb);
387  }
388  }
389 
390  if (verb > VERY_NOISY) {
391  list_fields();
393  list_problem();
394  }
395 
396  // Initialize interfaces
397  MeshsetsManager *m_manger_ptr;
398  CHKERR getInterface(m_manger_ptr);
399  CHKERR m_manger_ptr->initialiseDatabaseFromMesh(verb);
400  SeriesRecorder *series_recorder_ptr;
401  CHKERR getInterface(series_recorder_ptr);
402  CHKERR series_recorder_ptr->initialiseDatabaseFromMesh(verb);
403 
405 }

◆ Initialize()

MoFEMErrorCode MoFEM::Core::Initialize ( int *  argc,
char ***  args,
const char  file[],
const char  help[] 
)
static

Initializes the MoFEM database PETSc, MOAB and MPI.

Note
This function calls PetscInitialize, for more details see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInitialize.html

Example:

int main(int argc, char *argv[]) {
// Initailise MoFEM and Petsc
MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
try {
moab::Core mb_instance; // MoAB database
moab::Interface &moab = mb_instance;
MoFEM::Core core(moab); // MOFEM database
MoFEM::CoreInterface &m_field = core;
CHKERR foo(); // Call function
}
}
Parameters
argccount of number of command line arguments
argsthe command line arguments
file[optional] PETSc database file, also checks ~username/.petscrc
  • and .petscrc use NULL to not check for code specific file. Use * -skip_petscrc in the code specific file to skip the .petscrc files
help[optional] Help message to print, use NULL for no message
Returns
MoFEMErrorCode
Examples
add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_blas.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, matrix_function.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, petsc_smart_ptr_objects.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, wave_equation.cpp, and wavy_surface.cpp.

Definition at line 72 of file Core.cpp.

73  {
74 
75  MPI_Initialized(&mpiInitialised);
76  if (!mpiInitialised)
77  MPI_Init(argc, args);
78 
79  PetscInitialized(&isInitialized);
80  if (isInitialized == PETSC_FALSE) {
81  PetscInitialize(argc, args, file, help);
82  PetscPushErrorHandler(mofem_error_handler, PETSC_NULL);
83  }
84 
85  LogManager::createDefaultSinks(MPI_COMM_WORLD);
86  PetscVFPrintf = LogManager::logPetscFPrintf;
88  isGloballyInitialised = true;
89 
90  MOFEM_LOG_CHANNEL("WORLD");
91  char petsc_version[255];
92  CHKERR PetscGetVersion(petsc_version, 255);
93  MOFEM_LOG_C("WORLD", Sev::inform, "MoFEM version %d.%d.%d (%s %s)",
94  MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD,
95  MOAB_VERSION_STRING, petsc_version);
96  MOFEM_LOG_C("WORLD", Sev::inform, "git commit id %s", GIT_SHA1_NAME);
97 
98  auto log_time = [&](const auto perefix, auto time) {
99  MOFEM_LOG("WORLD", Sev::inform)
100  << perefix << time.date().year() << "-" << time.date().month() << "-"
101  << time.date().day() << " " << time.time_of_day().hours() << ":"
102  << time.time_of_day().minutes() << ":" << time.time_of_day().seconds();
103  };
104 
105  // Get current system time
106  log_time("Local time: ", boost::posix_time::second_clock::local_time());
107  log_time("UTC time: ", boost::posix_time::second_clock::universal_time());
108 
109  return MOFEM_SUCCESS;
110 }

◆ list_dofs_by_field_name()

MoFEMErrorCode MoFEM::Core::list_dofs_by_field_name ( const std::string &  name) const
protectedvirtual

list dofs

Implements MoFEM::CoreInterface.

Definition at line 1280 of file FieldCore.cpp.

1280  {
1282  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(
1284  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(
1286  MOFEM_LOG("SYNC", Sev::inform) << "List DOFs:";
1287  for (; dit != hi_dit; dit++)
1288  MOFEM_LOG("SYNC", Sev::inform) << *dit;
1289 
1292 }

◆ list_fields()

MoFEMErrorCode MoFEM::Core::list_fields ( ) const
protectedvirtual

list entities in the field

Implements MoFEM::CoreInterface.

Definition at line 1294 of file FieldCore.cpp.

1294  {
1296  MOFEM_LOG("SYNC", Sev::inform) << "List Fields:";
1297  for (auto &miit : fIelds.get<BitFieldId_mi_tag>())
1298  MOFEM_LOG("SYNC", Sev::inform) << *miit;
1299 
1302 }

◆ list_finite_elements()

MoFEMErrorCode MoFEM::Core::list_finite_elements ( ) const
protectedvirtual

list finite elements in database

Implements MoFEM::CoreInterface.

Definition at line 323 of file FECore.cpp.

323  {
325  for (auto &fe : finiteElements.get<FiniteElement_name_mi_tag>())
326  MOFEM_LOG("SYNC", Sev::inform) << fe;
327 
330 }

◆ list_problem()

MoFEMErrorCode MoFEM::Core::list_problem ( ) const
protectedvirtual

list problems

Implements MoFEM::CoreInterface.

Definition at line 129 of file ProblemsCore.cpp.

129  {
132  const ProblemById &set_id = pRoblems.get<BitProblemId_mi_tag>();
133  ProblemById::iterator miit = set_id.begin();
134  for (; miit != set_id.end(); miit++) {
135  std::ostringstream ss;
136  ss << *miit << std::endl;
137  PetscPrintf(mofemComm, ss.str().c_str());
138  }
140 }

◆ loop_dofs() [1/4]

MoFEMErrorCode MoFEM::Core::loop_dofs ( const Problem problem_ptr,
const std::string &  field_name,
RowColData  rc,
DofMethod method,
int  lower_rank,
int  upper_rank,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Make a loop over dofs.

Implements MoFEM::CoreInterface.

Definition at line 531 of file ProblemsCore.cpp.

534  {
536  SET_BASIC_METHOD(method, &*problem_ptr);
538  NumeredDofsByUId;
539  NumeredDofsByUId *dofs;
540  switch (rc) {
541  case ROW:
542  dofs = &problem_ptr->numeredRowDofsPtr->get<Unique_mi_tag>();
543  break;
544  case COL:
545  dofs = &problem_ptr->numeredColDofsPtr->get<Unique_mi_tag>();
546  break;
547  default:
548  SETERRQ(mofemComm, MOFEM_DATA_INCONSISTENCY, "Not implemented");
549  }
550 
551  auto field_it = fIelds.get<FieldName_mi_tag>().find(field_name);
552  if (field_it != fIelds.get<FieldName_mi_tag>().end()) {
553  method.fieldPtr = *field_it;
554  } else {
555  SETERRQ(mofemComm, MOFEM_NOT_FOUND,
556  ("Field not found " + field_name).c_str());
557  }
558 
559  auto miit = dofs->lower_bound(
560  FieldEntity::getLoBitNumberUId((*field_it)->getBitNumber()));
561  auto hi_miit = dofs->upper_bound(
562  FieldEntity::getHiBitNumberUId((*field_it)->getBitNumber()));
563 
564  method.loopSize = std::distance(miit, hi_miit);
565  method.loHiFERank = std::make_pair(lower_rank, upper_rank);
566 
567  CHKERR method.preProcess();
568 
569  int nn = 0;
570  for (; miit != hi_miit; miit++, nn++) {
571  if ((*miit)->getPart() >= lower_rank && (*miit)->getPart() <= upper_rank) {
572  method.nInTheLoop = nn; // Index of element in the loop
573  method.dofPtr = miit->get()->getDofEntityPtr();
574  method.dofNumeredPtr = *miit;
575  CHKERR method();
576  }
577  }
578 
579  CHKERR method.postProcess();
581 }

◆ loop_dofs() [2/4]

MoFEMErrorCode MoFEM::Core::loop_dofs ( const std::string &  field_name,
DofMethod method,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Make a loop over dofs.

Implements MoFEM::CoreInterface.

Definition at line 617 of file ProblemsCore.cpp.

618  {
620  if (verb == DEFAULT_VERBOSITY)
621  verb = verbose;
622  SET_BASIC_METHOD(method, nullptr);
623 
624  auto field_it = fIelds.get<FieldName_mi_tag>().find(field_name);
625  if (field_it != fIelds.get<FieldName_mi_tag>().end()) {
626  method.fieldPtr = *field_it;
627  } else {
628  SETERRQ(mofemComm, MOFEM_NOT_FOUND,
629  ("Field not found " + field_name).c_str());
630  }
631 
632  auto miit = dofsField.get<Unique_mi_tag>().lower_bound(
633  FieldEntity::getLoBitNumberUId((*field_it)->getBitNumber()));
634  auto hi_miit = dofsField.get<Unique_mi_tag>().upper_bound(
635  FieldEntity::getHiBitNumberUId((*field_it)->getBitNumber()));
636 
637  method.loopSize = std::distance(miit, hi_miit);
638  method.loHiFERank = std::make_pair(0, get_comm_size());
639 
640  CHKERR method.preProcess();
641  for (int nn = 0; miit != hi_miit; miit++, nn++) {
642  method.nInTheLoop = nn;
643  method.dofPtr = *miit;
644  CHKERR method();
645  }
646  CHKERR method.postProcess();
648 }

◆ loop_dofs() [3/4]

MoFEMErrorCode MoFEM::Core::loop_dofs ( const std::string &  problem_name,
const std::string &  field_name,
RowColData  rc,
DofMethod method,
int  lower_rank,
int  upper_rank,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Make a loop over dofs.

Implements MoFEM::CoreInterface.

Definition at line 583 of file ProblemsCore.cpp.

591  {
593  if (verb == DEFAULT_VERBOSITY)
594  verb = verbose;
596  // find p_miit
597  ProblemsByName &pRoblems_set = pRoblems.get<Problem_mi_tag>();
598  ProblemsByName::iterator p_miit = pRoblems_set.find(problem_name);
599  if (p_miit == pRoblems_set.end())
600  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "problem not in database %s",
601  problem_name.c_str());
602  CHKERR loop_dofs(&*p_miit, field_name, rc, method, lower_rank, upper_rank,
603  verb);
605 }

◆ loop_dofs() [4/4]

MoFEMErrorCode MoFEM::Core::loop_dofs ( const std::string &  problem_name,
const std::string &  field_name,
RowColData  rc,
DofMethod method,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Make a loop over dofs.

Implements MoFEM::CoreInterface.

Definition at line 607 of file ProblemsCore.cpp.

609  {
611  if (verb == DEFAULT_VERBOSITY)
612  verb = verbose;
613  CHKERR loop_dofs(problem_name, field_name, rc, method, 0, sIze, verb);
615 }

◆ loop_entities() [1/4]

MoFEMErrorCode MoFEM::Core::loop_entities ( const Problem problem_ptr,
const std::string  field_name,
RowColData  rc,
EntityMethod method,
int  lower_rank,
int  upper_rank,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Loop over field entities in the problem.

Parameters
problem_ptr
field_name
rc
method
lower_rank
upper_rank
verb
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 650 of file ProblemsCore.cpp.

653  {
655  if (verb == DEFAULT_VERBOSITY)
656  verb = verbose;
657  decltype(problem_ptr->numeredRowDofsPtr) dofs;
658  switch (rc) {
659  case ROW:
660  dofs = problem_ptr->numeredRowDofsPtr;
661  break;
662  case COL:
663  dofs = problem_ptr->numeredColDofsPtr;
664  break;
665  default:
667  "It works only with rows or columns");
668  }
669 
670  auto field_it = fIelds.get<FieldName_mi_tag>().find(field_name);
671  if (field_it != fIelds.get<FieldName_mi_tag>().end()) {
672  method.fieldPtr = *field_it;
673  } else {
674  SETERRQ(mofemComm, MOFEM_NOT_FOUND,
675  ("Field not found " + field_name).c_str());
676  }
677 
678  auto miit = dofs->lower_bound(
679  FieldEntity::getLoBitNumberUId((*field_it)->getBitNumber()));
680  auto hi_miit = dofs->upper_bound(
681  FieldEntity::getHiBitNumberUId((*field_it)->getBitNumber()));
682 
683  using FieldEntity_view_multiIndex = multi_index_container<
684 
685  boost::shared_ptr<FieldEntity>,
686  indexed_by<
687 
688  ordered_unique<
689 
690  tag<Ent_mi_tag>,
693 
694  >>;
695 
696  FieldEntity_view_multiIndex ents_view;
697  auto hint = ents_view.begin();
698  for (; miit != hi_miit; ++miit)
699  if ((*miit)->getPart() >= lower_rank && (*miit)->getPart() <= upper_rank)
700  ents_view.emplace_hint(hint, (*miit)->getFieldEntityPtr());
701 
702  SET_BASIC_METHOD(method, problem_ptr);
703 
704  method.loopSize = ents_view.size();
705  method.loHiFERank = std::make_pair(lower_rank, upper_rank);
706 
707  CHKERR method.preProcess();
708  method.nInTheLoop = 0;
709  for (auto &field_ent : ents_view) {
710  method.entPtr = field_ent;
711  CHKERR method();
712  ++method.nInTheLoop;
713  }
714  CHKERR method.postProcess();
716 }

◆ loop_entities() [2/4]

MoFEMErrorCode MoFEM::Core::loop_entities ( const std::string  field_name,
EntityMethod method,
Range const *const  ents = nullptr,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Loop over field entities.

Parameters
field_namefield entities
methoduser method
entsif given loop only on subset of entities in the field
verb
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 742 of file ProblemsCore.cpp.

744  {
746  if (verb == DEFAULT_VERBOSITY)
747  verb = verbose;
748  SET_BASIC_METHOD(method, nullptr);
749 
750  auto field_it = fIelds.get<FieldName_mi_tag>().find(field_name);
751  if (field_it != fIelds.get<FieldName_mi_tag>().end()) {
752  method.fieldPtr = *field_it;
753  } else {
754  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "Field not found %s",
755  field_name.c_str());
756  }
757 
758  auto lo_eit = entsFields.get<Unique_mi_tag>().lower_bound(
759  FieldEntity::getLoBitNumberUId((*field_it)->getBitNumber()));
760  auto hi_eit = entsFields.get<Unique_mi_tag>().upper_bound(
761  FieldEntity::getHiBitNumberUId((*field_it)->getBitNumber()));
762 
763  typedef multi_index_container<
764  boost::shared_ptr<FieldEntity>,
765  indexed_by<ordered_unique<
766  tag<Ent_mi_tag>, const_mem_fun<FieldEntity::interface_RefEntity,
768  FieldEntity_view_multiIndex;
769 
770  FieldEntity_view_multiIndex ents_view;
771  ents_view.insert(lo_eit, hi_eit);
772 
773  method.loopSize = ents_view.size();
774  method.loHiFERank = std::make_pair(0, get_comm_size());
775 
776  CHKERR method.preProcess();
777  method.nInTheLoop = 0;
778 
779  if (ents)
780  for (auto p = ents->const_pair_begin(); p != ents->const_pair_end(); ++p)
781  for (auto feit = ents_view.lower_bound(p->first);
782  feit != ents_view.upper_bound(p->second); ++feit) {
783  method.entPtr = *feit;
784  CHKERR method();
785  ++method.nInTheLoop;
786  }
787  else
788  for (auto &field_ent : ents_view) {
789  method.entPtr = field_ent;
790  CHKERR method();
791  ++method.nInTheLoop;
792  }
793 
794  CHKERR method.postProcess();
796 }

◆ loop_entities() [3/4]

MoFEMErrorCode MoFEM::Core::loop_entities ( const std::string  problem_name,
const std::string  field_name,
RowColData  rc,
EntityMethod method,
int  lower_rank,
int  upper_rank,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Loop over field entities in the problem.

Parameters
problem_name
field_name
rc
method
lower_rank
upper_rank
verb
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 718 of file ProblemsCore.cpp.

721  {
723  if (verb == DEFAULT_VERBOSITY)
724  verb = verbose;
725  // find p_miit
726  auto &prb = pRoblems.get<Problem_mi_tag>();
727  auto p_miit = prb.find(problem_name);
728  if (p_miit == prb.end())
729  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "problem not in database %s",
730  problem_name.c_str());
731  CHKERR loop_entities(&*p_miit, field_name, rc, method, lower_rank, upper_rank,
732  verb);
734 }

◆ loop_entities() [4/4]

MoFEMErrorCode MoFEM::Core::loop_entities ( const std::string  problem_name,
const std::string  field_name,
RowColData  rc,
EntityMethod method,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Loop over field entities in the problem.

Parameters
problem_name
field_name
rc
method
verb
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 736 of file ProblemsCore.cpp.

738  {
739  return loop_entities(problem_name, field_name, rc, method, rAnk, rAnk, verb);
740 }

◆ loop_finite_elements() [1/3]

MoFEMErrorCode MoFEM::Core::loop_finite_elements ( const Problem problem_ptr,
const std::string &  fe_name,
FEMethod method,
int  lower_rank,
int  upper_rank,
boost::shared_ptr< NumeredEntFiniteElement_multiIndex fe_ptr = nullptr,
MoFEMTypes  bh = MF_EXIST,
CacheTupleWeakPtr  cache_ptr = CacheTupleSharedPtr(),
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Make a loop over finite elements on partitions from upper to lower rank.

This function is like swiss knife, is can be used to post-processing or matrix and vectors assembly. It makes loop over given finite element for given problem. The particular methods executed on each element are given by class derived form Interface::FEMethod. At beginning of each loop user defined function (method) preProcess() is called, for each element operator() is executed, at the end loop finalizes with user defined function (method) postProcess().

Note
If fe_ptr is given it is expected that multi-index is supbes of problem multi-index. If this is not the case behavior of the code is undetermined.

For more details please look to examples.

Interface::FEMethod

Parameters
problem_ptrpointer to problem consisting set of elements
fe_namename of element in problem
methodclass derived form Interface::FEMethod
lower_ranklower rank of process owned by finite element
upper_ranklower rank of process owned by finite element
fe_ptrpointer to finite elements multi-index
bhif bH = MF_EXIST, throws error if fe_name does not exist
cache_datacache data vector
cache_rowcache row vector
cache_colcache row vector
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 427 of file ProblemsCore.cpp.

431  {
433  if (verb == DEFAULT_VERBOSITY)
434  verb = verbose;
435 
436  CacheTupleSharedPtr tmp_cache_ptr;
437  if (!cache_ptr.use_count()) {
438  tmp_cache_ptr = boost::make_shared<CacheTuple>();
439  CHKERR cache_problem_entities(problem_ptr->getName(), tmp_cache_ptr);
440  method.cacheWeakPtr = tmp_cache_ptr;
441  } else {
442  method.cacheWeakPtr = cache_ptr;
443  }
444 
445  if (!fe_ptr)
446  fe_ptr = problem_ptr->numeredFiniteElementsPtr;
447 
448  auto miit = fe_ptr->get<Composite_Name_And_Part_mi_tag>().lower_bound(
449  boost::make_tuple(fe_name, lower_rank));
450  auto hi_miit = fe_ptr->get<Composite_Name_And_Part_mi_tag>().upper_bound(
451  boost::make_tuple(fe_name, upper_rank));
452 
453  if (miit == hi_miit && (bh & MF_EXIST)) {
454  if (!check_finite_element(fe_name)) {
455  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "finite element < %s > not found",
456  fe_name.c_str());
457  }
458  }
459 
460  method.feName = fe_name;
461  method.loopSize =
462  std::distance(miit, hi_miit); // Set numbers of elements in the loop
463  method.loHiFERank = std::make_pair(lower_rank, upper_rank);
464 
465  SET_BASIC_METHOD(method, &*problem_ptr)
466 
467  PetscLogEventBegin(MOFEM_EVENT_preProcess, 0, 0, 0, 0);
468  CHKERR method.preProcess();
469  PetscLogEventEnd(MOFEM_EVENT_preProcess, 0, 0, 0, 0);
470 
471  PetscLogEventBegin(MOFEM_EVENT_operator, 0, 0, 0, 0);
472  for (int nn = 0; miit != hi_miit; miit++, nn++) {
473 
474  method.nInTheLoop = nn; // Index of element in the loop
475  method.numeredEntFiniteElementPtr = *miit;
476 
477  if (method.exeTestHook) {
478  if (method.exeTestHook(&method)) {
479  CHKERR method();
480  }
481  } else {
482  CHKERR method();
483  }
484 
485  }
486  PetscLogEventEnd(MOFEM_EVENT_operator, 0, 0, 0, 0);
487 
488  PetscLogEventBegin(MOFEM_EVENT_postProcess, 0, 0, 0, 0);
489  CHKERR method.postProcess();
490  PetscLogEventEnd(MOFEM_EVENT_postProcess, 0, 0, 0, 0);
491 
493 }

◆ loop_finite_elements() [2/3]

MoFEMErrorCode MoFEM::Core::loop_finite_elements ( const std::string  problem_name,
const std::string &  fe_name,
FEMethod method,
boost::shared_ptr< NumeredEntFiniteElement_multiIndex fe_ptr = nullptr,
MoFEMTypes  bh = MF_EXIST,
CacheTupleWeakPtr  cache_ptr = CacheTupleSharedPtr(),
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Make a loop over finite elements.

This function is like swiss knife, is can be used to post-processing or matrix and vectors assembly. It makes loop over given finite element for given problem. The particular methods executed on each element are given by class derived form Interface::FEMethod. At beginning of each loop user defined function (method) preProcess() is called, for each element operator() is executed, at the end loop finalizes with user defined function (method) postProcess().

Methods are executed only for local elements at given processor.

For more details pleas look to examples.

Note
If fe_ptr is given it is expected that multi-index is supbes of problem multi-index. If this is not the case behavior of the code is undetermined.
Parameters
problem_nameproblem consisting set of elements
fe_namename of element in problem
methodclass derived form Interface::FEMethod
fe_ptrpointer to finite elements multi-index
bhif bH = MF_EXIST, throws error if fe_name does not exist
cache_tuple_ptrcache
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 495 of file ProblemsCore.cpp.

499  {
501  if (verb == DEFAULT_VERBOSITY)
502  verb = verbose;
503 
504  CHKERR loop_finite_elements(problem_name, fe_name, method, rAnk, rAnk, fe_ptr,
505  bh, cache_ptr, verb);
506 
508 }

◆ loop_finite_elements() [3/3]

MoFEMErrorCode MoFEM::Core::loop_finite_elements ( const std::string  problem_name,
const std::string &  fe_name,
FEMethod method,
int  lower_rank,
int  upper_rank,
boost::shared_ptr< NumeredEntFiniteElement_multiIndex fe_ptr = nullptr,
MoFEMTypes  bh = MF_EXIST,
CacheTupleWeakPtr  cache_ptr = CacheTupleSharedPtr(),
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Make a loop over finite elements on partitions from upper to lower rank.

This function is like swiss knife, is can be used to post-processing or matrix and vectors assembly. It makes loop over given finite element for given problem. The particular methods executed on each element are given by class derived form Interface::FEMethod. At beginning of each loop user defined function (method) preProcess() is called, for each element operator() is executed, at the end loop finalizes with user defined function (method) postProcess().

Note
If fe_ptr is given it is expected that multi-index is supbes of problem multi-index. If this is not the case behavior of the code is undetermined.

For more details please look to examples.

Parameters
problem_namepointer to problem consisting set of elements
fe_namename of element in problem
methodclass derived form Interface::FEMethod
lower_ranklower rank of process owned by finite element
upper_ranklower rank of process owned by finite element
fe_ptrpointer to finite elements multi-index
bhif bH = MF_EXIST, throws error if fe_name does not exist
cache_datacache data vector
cache_rowcache row vector
cache_colcache row vector
verbverbosity level
Returns
error code

Implements MoFEM::CoreInterface.

Definition at line 510 of file ProblemsCore.cpp.

514  {
516  if (verb == DEFAULT_VERBOSITY)
517  verb = verbose;
518 
519  auto &prb_by_name = pRoblems.get<Problem_mi_tag>();
520  auto p_miit = prb_by_name.find(problem_name);
521  if (p_miit == prb_by_name.end())
522  SETERRQ1(mofemComm, MOFEM_INVALID_DATA, "Problem <%s> is not in database",
523  problem_name.c_str());
524 
525  CHKERR loop_finite_elements(&*p_miit, fe_name, method, lower_rank, upper_rank,
526  fe_ptr, bh, cache_ptr, verb);
527 
529 }

◆ make_shared_ref_entity()

boost::shared_ptr< RefEntityTmp< 0 > > MoFEM::Core::make_shared_ref_entity ( const EntityHandle  ent)
virtual

Get RefEntity.

Parameters
ent
Returns
boost::shared_ptr<RefEntityTmp<0>>

Implements MoFEM::CoreInterface.

Reimplemented in MoFEM::CoreTmp<-1 >.

Definition at line 928 of file Core.cpp.

928  {
929  return this->makeSharedRefEntity(*this, ent);
930 }

◆ makeSharedRefEntity()

boost::shared_ptr< RefEntityTmp< 0 > > MoFEM::Core::makeSharedRefEntity ( MoFEM::Interface m_field,
const EntityHandle  ent 
)
static

Definition at line 894 of file Core.cpp.

894  {
895 
896  boost::shared_ptr<RefEntityTmp<0>> ref_ent_ptr;
897 
898  switch (m_field.getValue()) {
899  case -1:
900  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
901 
902  new RefEntityTmp<-1>(m_field.get_basic_entity_data_ptr(), ent)
903 
904  );
905  break;
906  case 0:
907  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
908 
909  new RefEntityTmp<0>(m_field.get_basic_entity_data_ptr(), ent)
910 
911  );
912  break;
913  case 1:
914  ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
915 
916  new RefEntityTmp<1>(m_field.get_basic_entity_data_ptr(), ent)
917 
918  );
919  break;
920  default:
921  THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
922  }
923 
924  return ref_ent_ptr;
925 }

◆ modify_finite_element_add_field_col()

MoFEMErrorCode MoFEM::Core::modify_finite_element_add_field_col ( const std::string &  fe_name,
const std::string  name_row 
)
protectedvirtual

set field col which finite element use

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
namefinite element name
namefield name

Implements MoFEM::CoreInterface.

Definition at line 182 of file FECore.cpp.

183  {
185  *buildMoFEM &= 1 << 0;
187  FiniteElements_by_name;
188  FiniteElements_by_name &finite_element_name_set =
189  finiteElements.get<FiniteElement_name_mi_tag>();
190  FiniteElements_by_name::iterator it_fe =
191  finite_element_name_set.find(fe_name);
192  if (it_fe == finite_element_name_set.end())
194  "this FiniteElement is there");
195  bool success = finite_element_name_set.modify(
196  it_fe, FiniteElement_col_change_bit_add(get_field_id(name_col)));
197  if (!success)
199  "modification unsuccessful");
201 }

◆ modify_finite_element_add_field_data()

MoFEMErrorCode MoFEM::Core::modify_finite_element_add_field_data ( const std::string &  fe_name,
const std::string  name_filed 
)
protectedvirtual

set finite element field data

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
namefinite element name
namefield name

This function will set memory in the form of a vector

Implements MoFEM::CoreInterface.

Definition at line 138 of file FECore.cpp.

139  {
141  *buildMoFEM &= 1 << 0;
143  FiniteElements_by_name;
144  FiniteElements_by_name &finite_element_name_set =
145  finiteElements.get<FiniteElement_name_mi_tag>();
146  FiniteElements_by_name::iterator it_fe =
147  finite_element_name_set.find(fe_name);
148  if (it_fe == finite_element_name_set.end())
149  SETERRQ(mofemComm, MOFEM_NOT_FOUND,
150  "This finite element is not defined (advise: check spelling)");
151  bool success = finite_element_name_set.modify(
152  it_fe, FiniteElement_change_bit_add(get_field_id(name_data)));
153  if (!success)
155  "modification unsuccessful");
157 }

◆ modify_finite_element_add_field_row()

MoFEMErrorCode MoFEM::Core::modify_finite_element_add_field_row ( const std::string &  fe_name,
const std::string  name_row 
)
protectedvirtual

set field row which finite element use

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
namefinite element name
namefield name

Implements MoFEM::CoreInterface.

Definition at line 160 of file FECore.cpp.

161  {
163  *buildMoFEM &= 1 << 0;
165  FiniteElements_by_name;
166  FiniteElements_by_name &finite_element_name_set =
167  finiteElements.get<FiniteElement_name_mi_tag>();
168  FiniteElements_by_name::iterator it_fe =
169  finite_element_name_set.find(fe_name);
170  if (it_fe == finite_element_name_set.end())
171  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "this < %s > is not there",
172  fe_name.c_str());
173  bool success = finite_element_name_set.modify(
174  it_fe, FiniteElement_row_change_bit_add(get_field_id(name_row)));
175  if (!success)
177  "modification unsuccessful");
179 }

◆ modify_finite_element_adjacency_table()

MoFEMErrorCode MoFEM::Core::modify_finite_element_adjacency_table ( const std::string &  fe_name,
const EntityType  type,
ElementAdjacencyFunct  function 
)
protectedvirtual

modify finite element table, only for advanced user

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.

Using that functions means that you like to do something not usual.

Implements MoFEM::CoreInterface.

Definition at line 117 of file FECore.cpp.

119  {
121  *buildMoFEM &= 1 << 0;
123  FiniteElements_by_name;
124  FiniteElements_by_name &finite_element_name_set =
125  finiteElements.get<FiniteElement_name_mi_tag>();
126  FiniteElements_by_name::iterator it_fe =
127  finite_element_name_set.find(fe_name);
128  if (it_fe == finite_element_name_set.end())
129  SETERRQ(mofemComm, MOFEM_NOT_FOUND,
130  "This finite element is not defined (advise: check spelling)");
131  boost::shared_ptr<FiniteElement> fe;
132  fe = *it_fe;
133  fe->elementAdjacencyTable[type] = function;
135 }

◆ modify_finite_element_off_field_col()

MoFEMErrorCode MoFEM::Core::modify_finite_element_off_field_col ( const std::string &  fe_name,
const std::string  name_row 
)
protectedvirtual

unset field col which finite element use

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
namefinite element name
namefield name

Implements MoFEM::CoreInterface.

Definition at line 241 of file FECore.cpp.

242  {
244  *buildMoFEM &= 1 << 0;
245  auto &finite_element_name_set =
246  finiteElements.get<FiniteElement_name_mi_tag>();
247  auto it_fe = finite_element_name_set.find(fe_name);
248  if (it_fe == finite_element_name_set.end())
249  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "this FiniteElement is there");
250  bool success = finite_element_name_set.modify(
251  it_fe, FiniteElement_col_change_bit_off(get_field_id(name_col)));
252  if (!success)
254  "modification unsuccessful");
256 }

◆ modify_finite_element_off_field_data()

MoFEMErrorCode MoFEM::Core::modify_finite_element_off_field_data ( const std::string &  fe_name,
const std::string  name_filed 
)
protectedvirtual

unset finite element field data

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
namefinite element name
namefield name

This function will set memory in the form of a vector

Implements MoFEM::CoreInterface.

Definition at line 204 of file FECore.cpp.

205  {
207  *buildMoFEM &= 1 << 0;
208  auto &finite_element_name_set =
209  finiteElements.get<FiniteElement_name_mi_tag>();
210  auto it_fe = finite_element_name_set.find(fe_name);
211  if (it_fe == finite_element_name_set.end())
212  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "this FiniteElement is there");
213  bool success = finite_element_name_set.modify(
214  it_fe, FiniteElement_change_bit_off(get_field_id(name_data)));
215  if (!success)
217  "modification unsuccessful");
219 }

◆ modify_finite_element_off_field_row()

MoFEMErrorCode MoFEM::Core::modify_finite_element_off_field_row ( const std::string &  fe_name,
const std::string  name_row 
)
protectedvirtual

unset field row which finite element use

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
namefinite element name
namefield name

Implements MoFEM::CoreInterface.

Definition at line 222 of file FECore.cpp.

223  {
225  *buildMoFEM &= 1 << 0;
226  auto &finite_element_name_set =
227  finiteElements.get<FiniteElement_name_mi_tag>();
228  auto it_fe = finite_element_name_set.find(fe_name);
229  if (it_fe == finite_element_name_set.end())
230  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "this < %s > is not there",
231  fe_name.c_str());
232  bool success = finite_element_name_set.modify(
233  it_fe, FiniteElement_row_change_bit_off(get_field_id(name_row)));
234  if (!success)
236  "modification unsuccessful");
238 }

◆ modify_problem_add_finite_element()

MoFEMErrorCode MoFEM::Core::modify_problem_add_finite_element ( const std::string  name_problem,
const std::string &  fe_name 
)
protectedvirtual

add finite element to problem, this add entities assigned to finite element to a particular problem

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
nameProblem name
nameFinite Element name

Implements MoFEM::CoreInterface.

Definition at line 143 of file ProblemsCore.cpp.

144  {
147  ProblemsByName &set = pRoblems.get<Problem_mi_tag>();
148  ProblemsByName::iterator miit = set.find(name_problem);
149  if (miit == set.end()) {
150  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "this problem <%s> is not there",
151  name_problem.c_str());
152  }
153  BitFEId f_id = getBitFEId(fe_name);
154  bool success = set.modify(miit, ProblemFiniteElementChangeBitAdd(f_id));
155  if (!success)
156  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
157  "modification unsuccessful");
159 }

◆ modify_problem_mask_ref_level_add_bit()

MoFEMErrorCode MoFEM::Core::modify_problem_mask_ref_level_add_bit ( const std::string &  name_problem,
const BitRefLevel bit 
)
protectedvirtual

set dof mask ref level for problem

Implements MoFEM::CoreInterface.

Definition at line 218 of file ProblemsCore.cpp.

219  {
222  ProblemsByName &set = pRoblems.get<Problem_mi_tag>();
223  ProblemsByName::iterator miit = set.find(name_problem);
224  if (miit == set.end()) {
225  std::ostringstream ss;
226  ss << name_problem;
227  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "this problem <%s> is there",
228  ss.str().c_str());
229  }
230  bool success = set.modify(miit, ProblemChangeRefLevelBitDofMaskAdd(bit));
231  if (!success)
232  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
233  "modification unsuccessful");
235 }

◆ modify_problem_mask_ref_level_set_bit()

MoFEMErrorCode MoFEM::Core::modify_problem_mask_ref_level_set_bit ( const std::string &  name_problem,
const BitRefLevel bit 
)
protectedvirtual

set dof mask ref level for problem

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.

Implements MoFEM::CoreInterface.

Definition at line 238 of file ProblemsCore.cpp.

239  {
241  ProblemsByName;
242  ProblemsByName &set = pRoblems.get<Problem_mi_tag>();
243  ProblemsByName::iterator miit = set.find(name_problem);
244  if (miit == set.end()) {
245  std::ostringstream ss;
246  ss << name_problem;
247  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "this problem <%s> is there",
248  ss.str().c_str());
249  }
250  bool success = set.modify(miit, ProblemChangeRefLevelBitDofMaskSet(bit));
251  if (!success)
252  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
253  "modification unsuccessful");
255 }

◆ modify_problem_ref_level_add_bit()

MoFEMErrorCode MoFEM::Core::modify_problem_ref_level_add_bit ( const std::string &  name_problem,
const BitRefLevel bit 
)
protectedvirtual

add ref level to problem

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.

if same finite element is solved using different level of refinements, than the level of refinement has to be specificied to problem in query

Parameters
nameProblem name
BitRefLevelbitLevel Example:
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF1","ELASTIC");
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF2","ELASTIC");
mField.modify_problem_ref_level_add_bit("BEAM_BENDING_ON_MESH_REF1",bit_level1);
mField.modify_problem_ref_level_add_bit("BEAM_BENDING_ON_MESH_REF2",bit_level2);
Two Problems exist and solved independently, both are elastic, but solved using different mesh refinement

Implements MoFEM::CoreInterface.

Definition at line 181 of file ProblemsCore.cpp.

182  {
185  ProblemsByName &set = pRoblems.get<Problem_mi_tag>();
186  ProblemsByName::iterator miit = set.find(name_problem);
187  std::ostringstream ss;
188  ss << name_problem;
189  if (miit == set.end())
190  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "this problem <%s> is there",
191  ss.str().c_str());
192  bool success = set.modify(miit, ProblemChangeRefLevelBitAdd(bit));
193  if (!success)
194  SETERRQ(PETSC_COMM_SELF, 1, "modification unsuccessful");
196 }

◆ modify_problem_ref_level_set_bit()

MoFEMErrorCode MoFEM::Core::modify_problem_ref_level_set_bit ( const std::string &  name_problem,
const BitRefLevel bit 
)
protectedvirtual

set ref level for problem

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.

if same finite element is solved using different level of refinements, than the level of refinement has to be specificied to problem in query

Parameters
nameProblem name
BitRefLevelbitLevel Example:
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF1","ELASTIC");
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF2","ELASTIC");
mField.modify_problem_ref_level_set_bit("BEAM_BENDING_ON_MESH_REF1",bit_level1);
mField.modify_problem_ref_level_set_bit("BEAM_BENDING_ON_MESH_REF2",bit_level2);
Two Problems exist and solved independently, both are elastic, but solved using different mesh refinement

Implements MoFEM::CoreInterface.

Definition at line 199 of file ProblemsCore.cpp.

200  {
203  ProblemsByName &set = pRoblems.get<Problem_mi_tag>();
204  ProblemsByName::iterator miit = set.find(name_problem);
205  std::ostringstream ss;
206  ss << name_problem;
207  if (miit == set.end())
208  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "this problem <%s> is there",
209  ss.str().c_str());
210  bool success = set.modify(miit, ProblemChangeRefLevelBitSet(bit));
211  if (!success)
212  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
213  "modification unsuccessful");
215 }

◆ modify_problem_unset_finite_element()

MoFEMErrorCode MoFEM::Core::modify_problem_unset_finite_element ( const std::string  name_problem,
const std::string &  fe_name 
)
protectedvirtual

unset finite element from problem, this remove entities assigned to finite element to a particular problem

Note: If problem is build, it need to be cleaned to make this effective

Note
add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Parameters
nameProblem name
nameFinite Element name

Implements MoFEM::CoreInterface.

Definition at line 162 of file ProblemsCore.cpp.

163  {
166  ProblemsByName &set = pRoblems.get<Problem_mi_tag>();
167  ProblemsByName::iterator miit = set.find(name_problem);
168  if (miit == set.end()) {
169  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "this problem <%s> is not there",
170  name_problem.c_str());
171  }
172  BitFEId f_id = getBitFEId(fe_name);
173  bool success = set.modify(miit, ProblemFiniteElementChangeBitUnSet(f_id));
174  if (!success)
175  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
176  "modification unsuccessful");
178 }

◆ problem_basic_method_postProcess() [1/2]

MoFEMErrorCode MoFEM::Core::problem_basic_method_postProcess ( const Problem problem_ptr,
BasicMethod method,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Set data for BasicMethod.

This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.

FIXME: Here we need example

Parameters
pointerto problem data structure
methoduser method derived from BasicMethod

Implements MoFEM::CoreInterface.

Definition at line 395 of file ProblemsCore.cpp.

396  {
398  SET_BASIC_METHOD(method, problem_ptr)
399 
400  PetscLogEventBegin(MOFEM_EVENT_postProcess, 0, 0, 0, 0);
401  CHKERR method.postProcess();
402  PetscLogEventEnd(MOFEM_EVENT_postProcess, 0, 0, 0, 0);
403 
405 }

◆ problem_basic_method_postProcess() [2/2]

MoFEMErrorCode MoFEM::Core::problem_basic_method_postProcess ( const std::string &  problem_name,
BasicMethod method,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Set data for BasicMethod.

This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.

FIXME: Here we need example

Parameters
problem_namename of the problem
methoduser method derived from BasicMethod

Implements MoFEM::CoreInterface.

Definition at line 408 of file ProblemsCore.cpp.

409  {
411  if (verb == -1)
412  verb = verbose;
414 
415  // find p_miit
416  ProblemsByName &pRoblems_set = pRoblems.get<Problem_mi_tag>();
417  ProblemsByName::iterator p_miit = pRoblems_set.find(problem_name);
418  if (p_miit == pRoblems_set.end())
419  SETERRQ1(mofemComm, 1, "problem is not in database %s",
420  problem_name.c_str());
421 
422  CHKERR problem_basic_method_postProcess(&*p_miit, method, verb);
423 
425 }

◆ problem_basic_method_preProcess() [1/2]

MoFEMErrorCode MoFEM::Core::problem_basic_method_preProcess ( const Problem problem_ptr,
BasicMethod method,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Set data for BasicMethod.

This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.

FIXME: Here we need example

Parameters
pointerto problem data structure
methoduser method derived from BasicMethod

Implements MoFEM::CoreInterface.

Definition at line 363 of file ProblemsCore.cpp.

365  {
367  if (verb == -1)
368  verb = verbose;
369  // finite element
370  SET_BASIC_METHOD(method, problem_ptr)
371  PetscLogEventBegin(MOFEM_EVENT_preProcess, 0, 0, 0, 0);
372  CHKERR method.preProcess();
373  PetscLogEventEnd(MOFEM_EVENT_preProcess, 0, 0, 0, 0);
375 }

◆ problem_basic_method_preProcess() [2/2]

MoFEMErrorCode MoFEM::Core::problem_basic_method_preProcess ( const std::string &  problem_name,
BasicMethod method,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Set data for BasicMethod.

This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.

FIXME: Here we need example

Parameters
problem_namename of the problem
methoduser method derived from BasicMethod

Implements MoFEM::CoreInterface.

Definition at line 378 of file ProblemsCore.cpp.

379  {
381  if (verb == -1)
382  verb = verbose;
384  // find p_miit
385  ProblemsByName &pRoblems_set = pRoblems.get<Problem_mi_tag>();
386  ProblemsByName::iterator p_miit = pRoblems_set.find(problem_name);
387  if (p_miit == pRoblems_set.end())
388  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "problem is not in database %s",
389  problem_name.c_str());
390  CHKERR problem_basic_method_preProcess(&*p_miit, method, verb);
392 }

◆ query_interface()

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

Getting interface of core database.

Parameters
uuidunique ID of interface
ifacereturned pointer to interface
Returns
error code

Implements MoFEM::UnknownInterface.

Definition at line 43 of file Core.cpp.

44  {
46  *iface = NULL;
47  if (type_index == boost::typeindex::type_id<CoreInterface>()) {
48  *iface = static_cast<CoreInterface *>(const_cast<Core *>(this));
50  } else if (type_index ==
51  boost::typeindex::type_id<DeprecatedCoreInterface>()) {
52  *iface = static_cast<DeprecatedCoreInterface *>(const_cast<Core *>(this));
54  }
55 
56  // Get sub-interface
57  auto it = iFaces.find(type_index);
58  if (it != iFaces.end()) {
59  *iface = it->second;
61  }
62 
63  *iface = NULL;
64  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
66 }

◆ rebuild_database()

MoFEMErrorCode MoFEM::Core::rebuild_database ( int  verb = DEFAULT_VERBOSITY)
protectedvirtual

Clear database and initialize it once again.

Parameters
verbVerbosity level
Returns
Error code

Implements MoFEM::CoreInterface.

Definition at line 702 of file Core.cpp.

702  {
704  if (verb == -1)
705  verb = verbose;
706  CHKERR this->clearMap();
707  CHKERR this->getTags(verb);
710 }

◆ registerSubInterfaces()

MoFEMErrorCode MoFEM::Core::registerSubInterfaces ( )
protected

Register insterfaces.

Returns
MoFEMErrorCode

Definition at line 437 of file Core.cpp.

437  {
439 
440  iFaces.clear();
441 
442  // Register sub interfaces
443  CHKERR regSubInterface<LogManager>();
444  CHKERR regSubInterface<Simple>();
445  CHKERR regSubInterface<OperatorsTester>();
446  CHKERR regSubInterface<PipelineManager>();
447  CHKERR regSubInterface<ProblemsManager>();
448  CHKERR regSubInterface<MatrixManager>();
449  CHKERR regSubInterface<ISManager>();
450  CHKERR regSubInterface<VecManager>();
451  CHKERR regSubInterface<FieldBlas>();
452  CHKERR regSubInterface<BitRefManager>();
453  CHKERR regSubInterface<Tools>();
454  CHKERR regSubInterface<CommInterface>();
455  CHKERR regSubInterface<MeshsetsManager>();
456  CHKERR regSubInterface<NodeMergerInterface>();
457  CHKERR regSubInterface<PrismsFromSurfaceInterface>();
458  CHKERR regSubInterface<MeshRefinement>();
459  CHKERR regSubInterface<PrismInterface>();
460  CHKERR regSubInterface<CutMeshInterface>();
461  CHKERR regSubInterface<SeriesRecorder>();
462 #ifdef WITH_TETGEN
463  CHKERR regSubInterface<TetGenInterface>();
464 #endif
465 #ifdef WITH_MED
466  CHKERR regSubInterface<MedInterface>();
467 #endif
468  CHKERR regSubInterface<FieldEvaluatorInterface>();
469  CHKERR regSubInterface<BcManager>();
470 
472 };

◆ regSubInterface()

template<class IFACE >
MoFEMErrorCode MoFEM::Core::regSubInterface
protected

Register subinterfac in core interface.

Template Parameters
IFACE
Returns
MoFEMErrorCode

Definition at line 150 of file Core.cpp.

150  {
152  CHKERR registerInterface<IFACE>(true);
153  IFACE *ptr = new IFACE(*this);
154 
155  // If sub interface has function getSubInterfaceOptions run
156  // it after construction. getSubInterfaceOptions is used to
157  // get parameters from command line.
158  // See SFINAE:
159  // https://stackoverflow.com/questions/257288/is-it-possible-to-write-a-template-to-check-for-a-functions-existence
160  // https://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error
161  auto get_sub_iface_options = [](auto *const ptr) {
162  return get_sub_iface_options_imp(ptr, 0);
163  };
164  CHKERR get_sub_iface_options(ptr);
165 
166  auto type_idx = boost::typeindex::type_id<IFACE>();
167  iFaces.insert(type_idx, ptr);
169 }

◆ remove_ents()

MoFEMErrorCode MoFEM::Core::remove_ents ( const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities form mofem database

Implements MoFEM::CoreInterface.

Definition at line 429 of file DeleteCore.cpp.

429  {
431  if (verb == -1)
432  verb = verbose;
434  CHKERR remove_ents_from_field(ents, verb);
435 
436  for (Range::const_pair_iterator p_eit = ents.pair_begin();
437  p_eit != ents.pair_end(); ++p_eit) {
438 
439  RefElement_multiIndex::index<Ent_mi_tag>::type::iterator frit, hi_frit;
440  frit = refinedFiniteElements.get<Ent_mi_tag>().lower_bound(p_eit->first);
441  hi_frit =
442  refinedFiniteElements.get<Ent_mi_tag>().upper_bound(p_eit->second);
443  refinedFiniteElements.get<Ent_mi_tag>().erase(frit, hi_frit);
444 
445  RefEntity_multiIndex::index<Ent_mi_tag>::type::iterator rit, hi_rit;
446  rit = refinedEntities.get<Ent_mi_tag>().lower_bound(p_eit->first);
447  hi_rit = refinedEntities.get<Ent_mi_tag>().upper_bound(p_eit->second);
448  refinedEntities.get<Ent_mi_tag>().erase(rit, hi_rit);
449  }
450 
452 }

◆ remove_ents_by_bit_ref()

MoFEMErrorCode MoFEM::Core::remove_ents_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities form mofem database

Implements MoFEM::CoreInterface.

Definition at line 454 of file DeleteCore.cpp.

455  {
457  if (verb == -1)
458  verb = verbose;
459  Range ents;
460  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
461  CHKERR remove_ents(ents, verb);
463 }

◆ remove_ents_from_field() [1/3]

MoFEMErrorCode MoFEM::Core::remove_ents_from_field ( const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities from all fields

Note
not collective

Implements MoFEM::CoreInterface.

Definition at line 176 of file DeleteCore.cpp.

176  {
178  if (verb == -1)
179  verb = verbose;
180  CHKERR clear_ents_fields(ents, verb);
181  for (Field_multiIndex::iterator fit = fIelds.begin(); fit != fIelds.end();
182  fit++) {
183  EntityHandle meshset = fit->get()->getMeshset();
184  CHKERR get_moab().remove_entities(meshset, ents);
185  }
187 }

◆ remove_ents_from_field() [2/3]

MoFEMErrorCode MoFEM::Core::remove_ents_from_field ( const std::string  name,
const EntityHandle  meshset,
const EntityType  type,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities from field

Note
not collective

Implements MoFEM::CoreInterface.

Definition at line 152 of file DeleteCore.cpp.

154  {
156  if (verb == -1)
157  verb = verbose;
158  Range ents;
159  CHKERR get_moab().get_entities_by_type(meshset, type, ents);
160  CHKERR remove_ents_from_field(name, ents, verb);
162 }

◆ remove_ents_from_field() [3/3]

MoFEMErrorCode MoFEM::Core::remove_ents_from_field ( const std::string  name,
const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities from field

Note
not collective

Implements MoFEM::CoreInterface.

Definition at line 164 of file DeleteCore.cpp.

165  {
167  if (verb == -1)
168  verb = verbose;
169  EntityHandle meshset;
170  meshset = get_field_meshset(name);
171  CHKERR clear_ents_fields(name, ents, verb);
172  CHKERR get_moab().remove_entities(meshset, ents);
174 }

◆ remove_ents_from_field_by_bit_ref()

MoFEMErrorCode MoFEM::Core::remove_ents_from_field_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities from field

Note
not collective

Implements MoFEM::CoreInterface.

Definition at line 189 of file DeleteCore.cpp.

191  {
193  if (verb == -1)
194  verb = verbose;
195  Range ents;
196  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
197  CHKERR remove_ents_from_field(ents, verb);
199 }

◆ remove_ents_from_finite_element() [1/3]

MoFEMErrorCode MoFEM::Core::remove_ents_from_finite_element ( const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities from finite elements in database

Implements MoFEM::CoreInterface.

Definition at line 404 of file DeleteCore.cpp.

405  {
407  if (verb == -1)
408  verb = verbose;
409  CHKERR clear_finite_elements(ents, verb);
410  for (FiniteElement_multiIndex::iterator fe_it = finiteElements.begin();
411  fe_it != finiteElements.end(); fe_it++) {
412  EntityHandle meshset = fe_it->get()->getMeshset();
413  CHKERR get_moab().remove_entities(meshset, ents);
414  }
416 }

◆ remove_ents_from_finite_element() [2/3]

MoFEMErrorCode MoFEM::Core::remove_ents_from_finite_element ( const std::string  name,
const EntityHandle  meshset,
const EntityType  type,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities from given refinement level to finite element database

Implements MoFEM::CoreInterface.

Definition at line 379 of file DeleteCore.cpp.

382  {
384  if (verb == -1)
385  verb = verbose;
386  Range ents;
387  CHKERR get_moab().get_entities_by_type(meshset, type, ents, false);
388  CHKERR remove_ents_from_finite_element(name, ents, verb);
390 }

◆ remove_ents_from_finite_element() [3/3]

MoFEMErrorCode MoFEM::Core::remove_ents_from_finite_element ( const std::string  name,
const Range  ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove entities from finite element database

Implements MoFEM::CoreInterface.

Definition at line 392 of file DeleteCore.cpp.

394  {
396  if (verb == -1)
397  verb = verbose;
398  CHKERR clear_finite_elements(name, ents, verb);
399  const EntityHandle idm = get_finite_element_meshset(name);
400  CHKERR get_moab().remove_entities(idm, ents);
402 }

◆ remove_ents_from_finite_element_by_bit_ref()

MoFEMErrorCode MoFEM::Core::remove_ents_from_finite_element_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

remove elements from given refinement level to finite element database

Parameters
BitRefLevelbit
BitRefLevelmask
verboselevel

Implements MoFEM::CoreInterface.

Definition at line 418 of file DeleteCore.cpp.

419  {
421  if (verb == -1)
422  verb = verbose;
423  Range ents;
424  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
427 }

◆ remove_parents_by_bit_ref()

MoFEMErrorCode MoFEM::Core::remove_parents_by_bit_ref ( const BitRefLevel  bit,
const BitRefLevel  mask,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Remove parent from entities on bit level.

Evert entity created by refinement, split or any other change on the mesh can have parent. This function remove parent from entity,

Note
Functions makeing topological changes on entities should repsect parents child relation. This erase that relation. If you going to split faces and create interface is recommended to call this function before split opeartion.
Parameters
bitlevel
maskof bit level
verbverbosity level
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Definition at line 465 of file DeleteCore.cpp.

467  {
469  if (verb == -1)
470  verb = verbose;
471  Range ents;
472  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
473  CHKERR remove_parents_by_ents(ents, verb);
475 }

◆ remove_parents_by_ents()

MoFEMErrorCode MoFEM::Core::remove_parents_by_ents ( const Range ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Remove parents from entities.

Implements MoFEM::CoreInterface.

Definition at line 477 of file DeleteCore.cpp.

477  {
479 
480  std::vector<EntityHandle> leftovers_ents;
481  leftovers_ents.reserve(ents.size());
482 
483  for (auto pit = ents.pair_begin(); pit != ents.pair_end(); ++pit) {
484 
485  EntityHandle f = pit->first;
486  const EntityHandle s = pit->second;
487  auto lo = refinedEntities.lower_bound(f);
488  for (; f <= s; ++f) {
489 
490  auto check = [this](auto lo, auto f) {
491  if (lo == refinedEntities.end())
492  return false;
493  if ((*lo)->getEnt() == f)
494  return true;
495  return false;
496  };
497 
498  if (check(lo, f)) {
499  bool success = refinedEntities.modify(lo, RefEntity_change_parent(0));
500  if (!success)
501  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
502  "Operation of removing parent unsuccessful");
503  ++lo;
504  } else
505  leftovers_ents.emplace_back(f);
506  }
507  }
508 
509  if (!leftovers_ents.empty()) {
510  std::vector<EntityHandle> zero_parents(leftovers_ents.size());
511  CHKERR get_moab().tag_set_data(th_RefParentHandle, &leftovers_ents[0],
512  leftovers_ents.size(),
513  &*zero_parents.begin());
514  }
516 }

◆ remove_parents_by_parents()

MoFEMErrorCode MoFEM::Core::remove_parents_by_parents ( const Range ents,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Remove paremts from entities having parents in passed range.

Implements MoFEM::CoreInterface.

Definition at line 518 of file DeleteCore.cpp.

518  {
520  for (Range::iterator eit = ents.begin(); eit != ents.end(); ++eit) {
521  RefEntity_multiIndex::index<Ent_Ent_mi_tag>::type::iterator it;
522  while ((it = refinedEntities.get<Ent_Ent_mi_tag>().find(*eit)) !=
523  refinedEntities.get<Ent_Ent_mi_tag>().end()) {
524  bool success = refinedEntities.get<Ent_Ent_mi_tag>().modify(
525  it, RefEntity_change_parent(0));
526  if (!success) {
527  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
528  "Operation of removing parent unsuccessful");
529  }
530  }
531  }
533 }

◆ set_field_order() [1/4]

MoFEMErrorCode MoFEM::Core::set_field_order ( const EntityHandle  meshset,
const EntityType  type,
const BitFieldId  id,
const ApproximationOrder  order,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 899 of file FieldCore.cpp.

901  {
903  if (verb == -1)
904  verb = verbose;
905  *buildMoFEM = 0;
906  Range ents;
907  CHKERR get_moab().get_entities_by_type(meshset, type, ents);
908  CHKERR this->set_field_order(ents, id, order, verb);
910 }

◆ set_field_order() [2/4]

MoFEMErrorCode MoFEM::Core::set_field_order ( const EntityHandle  meshset,
const EntityType  type,
const std::string &  name,
const ApproximationOrder  order,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Set order approximation of the entities in the field.

Note
not collective
Parameters
meshsetcontaining set of the entities (use 0 for all the entities in the meshset)
typeselected type of the entities f.e. MBTET, MBTRI, MBEDGE, MBVERTEX, see moab documentation
orderapproximation order

Implements MoFEM::CoreInterface.

Definition at line 911 of file FieldCore.cpp.

914  {
916  if (verb == -1)
917  verb = verbose;
918  *buildMoFEM = 0;
919  CHKERR this->set_field_order(meshset, type, get_field_id(name), order, verb);
921 }

◆ set_field_order() [3/4]

MoFEMErrorCode MoFEM::Core::set_field_order ( const Range ents,
const BitFieldId  id,
const ApproximationOrder  order,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 874 of file FieldCore.cpp.

875  {
876  MOFEM_LOG_CHANNEL("WORLD");
877  MOFEM_LOG_TAG("WORLD", "FieldCore");
878  MOFEM_LOG_CHANNEL("SYNC");
879  MOFEM_LOG_TAG("SYNC", "FieldCore");
882 
883  // check field & meshset
884  auto field_it = fIelds.get<BitFieldId_mi_tag>().find(id);
885  if (field_it == fIelds.get<BitFieldId_mi_tag>().end())
886  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "no filed found");
887 
888  MOFEM_LOG("WORLD", Sev::noisy)
889  << "Field " << (*field_it)->getName() << " core value < "
890  << this->getValue() << " > field value ( "
891  << static_cast<int>((*field_it)->getBitNumber()) << " )"
892  << " nb. of ents " << ents.size();
893 
894  CHKERR this->setFieldOrderImpl(*field_it, ents, order, verb);
895 
897 }

◆ set_field_order() [4/4]

MoFEMErrorCode MoFEM::Core::set_field_order ( const Range ents,
const std::string &  name,
const ApproximationOrder  order,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Set order approximation of the entities in the field.

Note
not collective
Parameters
entities
typeselected type of the entities f.e. MBTET, MBTRI, MBEDGE, MBVERTEX, see moab documentation
orderapproximation order

Implements MoFEM::CoreInterface.

Definition at line 922 of file FieldCore.cpp.

923  {
925  if (verb == -1)
926  verb = verbose;
927  *buildMoFEM = 0;
928  CHKERR this->set_field_order(ents, get_field_id(name), order, verb);
930 }

◆ set_field_order_by_entity_type_and_bit_ref() [1/2]

MoFEMErrorCode MoFEM::Core::set_field_order_by_entity_type_and_bit_ref ( const BitRefLevel bit,
const BitRefLevel mask,
const EntityType  type,
const BitFieldId  id,
const ApproximationOrder  order,
int  verb = DEFAULT_VERBOSITY 
)
protected

Definition at line 931 of file FieldCore.cpp.

933  {
935  if (verb == -1)
936  verb = verbose;
937  *buildMoFEM = 0;
938  Range ents;
939  CHKERR BitRefManager(*this).getEntitiesByTypeAndRefLevel(bit, mask, type,
940  ents, verb);
941  CHKERR this->set_field_order(ents, id, order, verb);
943 }

◆ set_field_order_by_entity_type_and_bit_ref() [2/2]

MoFEMErrorCode MoFEM::Core::set_field_order_by_entity_type_and_bit_ref ( const BitRefLevel bit,
const BitRefLevel mask,
const EntityType  type,
const std::string &  name,
const ApproximationOrder  order,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Set order approximation of the entities in the field.

Note
not collective
Parameters
bitrefinement level
maskbit mask
typeselected type of the entities f.e. MBTET, MBTRI, MBEDGE, MBVERTEX, see moab documentation
orderapproximation order

Implements MoFEM::CoreInterface.

Definition at line 945 of file FieldCore.cpp.

947  {
949  if (verb == -1)
950  verb = verbose;
951  *buildMoFEM = 0;
952  Range ents;
953  CHKERR BitRefManager(*this).getEntitiesByTypeAndRefLevel(bit, mask, type,
954  ents, verb);
955  CHKERR this->set_field_order(ents, get_field_id(name), order, verb);
957 }

◆ set_moab_interface()

MoFEMErrorCode MoFEM::Core::set_moab_interface ( moab::Interface &  new_moab,
int  verb = VERBOSE 
)
protectedvirtual

Set the moab interface object.

Parameters
new_moab
verb
Returns
MoFEMErrorCode

Implements MoFEM::CoreInterface.

Reimplemented in MoFEM::CoreTmp<-1 >.

Definition at line 712 of file Core.cpp.

712  {
713  return this->setMoabInterface(new_moab, verb);
714 };

◆ setFieldOrder()

MoFEMErrorCode MoFEM::CoreTmp< 0 >::setFieldOrder ( const Range ents,
const BitFieldId  id,
const ApproximationOrder  order,
int  ver 
)
protected

◆ setFieldOrderImpl()

MoFEMErrorCode MoFEM::Core::setFieldOrderImpl ( boost::shared_ptr< Field field_ptr,
const Range ents,
const ApproximationOrder  order,
int  verb 
)
protected

Definition at line 450 of file FieldCore.cpp.

453  {
455 
456  if (verb == DEFAULT_VERBOSITY)
457  verb = verbose;
458  *buildMoFEM = 0;
459 
460  const auto field_meshset = field_ptr->getMeshset();
461  const auto bit_number = field_ptr->getBitNumber();
462 
463  // intersection with field meshset
464  Range ents_of_id_meshset;
465  CHKERR get_moab().get_entities_by_handle(field_meshset, ents_of_id_meshset,
466  false);
467  Range field_ents = intersect(ents, ents_of_id_meshset);
468  if (verb > QUIET) {
469  MOFEM_LOG_C("SYNC", Sev::noisy,
470  "change nb. of ents for order in the field <%s> %d",
471  field_ptr->getName().c_str(), field_ents.size(), ents.size());
472  }
473 
474  // ent view by field id (in set all MoabEnts has the same FieldId)
475  auto eiit = entsFields.get<Unique_mi_tag>().lower_bound(
476  FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
477  FieldEntity_multiIndex_ent_view ents_id_view;
478  if (eiit != entsFields.get<Unique_mi_tag>().end()) {
479  auto hi_eiit = entsFields.get<Unique_mi_tag>().upper_bound(
480  FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
481  std::copy(eiit, hi_eiit, std::back_inserter(ents_id_view));
482  }
483 
484  if (verb > QUIET)
485  MOFEM_LOG_C("SYNC", Sev::noisy,
486  "current nb. of ents in the multi index field <%s> %d",
487  field_ptr->getName().c_str(), ents_id_view.size());
488 
489  // loop over ents
490  int nb_ents_set_order_up = 0;
491  int nb_ents_set_order_down = 0;
492  int nb_ents_set_order_new = 0;
493 
494  FieldEntity_change_order modify_order_no_size_change(order, false);
495  FieldEntity_change_order modify_order_size_change(order, true);
496 
497  for (auto pit = field_ents.const_pair_begin();
498  pit != field_ents.const_pair_end(); pit++) {
499  EntityHandle first = pit->first;
500  EntityHandle second = pit->second;
501 
502  const auto type = static_cast<EntityType>(first >> MB_ID_WIDTH);
503 
504  // Sanity check
505  switch (field_ptr->getSpace()) {
506  case H1:
507  break;
508  case HCURL:
509  if (type == MBVERTEX)
510  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
511  "Hcurl space on vertices makes no sense");
512 
513  break;
514  case HDIV:
515  if (type == MBVERTEX)
516  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
517  "Hdiv space on vertices makes no sense");
518 
519  if (type == MBEDGE)
520  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
521  "Hdiv space on edges makes no sense");
522 
523  break;
524  default:
525  break;
526  }
527 
528  // Entity is in database, change order only if needed
529  Range ents_in_database;
530  auto vit = ents_id_view.get<1>().lower_bound(first);
531  auto hi_vit = ents_id_view.get<1>().upper_bound(second);
532  if (order >= 0) {
533  for (; vit != hi_vit; ++vit) {
534  ents_in_database.insert(vit->get()->getEnt());
535  // entity is in database and order is changed or reset
536  const ApproximationOrder old_approximation_order =
537  (*vit)->getMaxOrder();
538 
539  if (old_approximation_order != order) {
540 
541  FieldEntity_multiIndex::iterator miit =
542  entsFields.get<Unique_mi_tag>().find((*vit)->getLocalUniqueId());
543 
544  if ((*miit)->getMaxOrder() < order)
545  nb_ents_set_order_up++;
546  if ((*miit)->getMaxOrder() > order)
547  nb_ents_set_order_down++;
548 
549  // set dofs inactive if order is reduced, and set new order to entity
550  // if order is increased (note that dofs are not build if order is
551  // increased)
552 
553  bool can_change_size = true;
554  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(
556  (*miit)->getEnt()));
557  if (dit != dofsField.get<Unique_mi_tag>().end()) {
558  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(
560  (*miit)->getEnt()));
561 
562  if (dit != hi_dit)
563  can_change_size = false;
564  for (; dit != hi_dit; dit++) {
565  if ((*dit)->getDofOrder() > order) {
566  bool success = dofsField.modify(dofsField.project<0>(dit),
567  DofEntity_active_change(false));
568  if (!success)
569  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
570  "modification unsuccessful");
571  }
572  }
573  }
574 
575  bool success =
576  entsFields.modify(entsFields.project<0>(miit),
577  can_change_size ? modify_order_size_change
578  : modify_order_no_size_change);
579  if (!success)
580  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
581  "modification unsuccessful");
582  }
583  }
584  }
585 
586  Range new_ents = subtract(Range(first, second), ents_in_database);
587  for (Range::const_pair_iterator pit = new_ents.const_pair_begin();
588  pit != new_ents.const_pair_end(); ++pit) {
589  const auto first = pit->first;
590  const auto second = pit->second;
591  const auto ent_type = get_moab().type_from_handle(first);
592 
593  if (!field_ptr->getFieldOrderTable()[ent_type])
594  SETERRQ3(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
595  "Number of degrees of freedom for entity %s for %s space on "
596  "base %s can "
597  "not be deduced",
598  moab::CN::EntityTypeName(ent_type),
599  field_ptr->getSpaceName().c_str(),
600  field_ptr->getApproxBaseName().c_str());
601 
602  auto get_nb_dofs_on_order = [&](const int order) {
603  return order >= 0 ? (field_ptr->getFieldOrderTable()[ent_type])(order)
604  : 0;
605  };
606  const int nb_dofs_on_order = get_nb_dofs_on_order(order);
607  if (nb_dofs_on_order || order == -1) {
608 
609  const int field_rank = field_ptr->getNbOfCoeffs();
610  const int nb_dofs = nb_dofs_on_order * field_rank;
611 
612  // Entity is not in database and order is changed or reset
613  auto miit_ref_ent =
614  refinedEntities.get<Ent_mi_tag>().lower_bound(first);
615 
616  auto create_tags_for_max_order = [&](const Range &ents) {
618  if (order >= 0) {
619  std::vector<ApproximationOrder> o_vec(ents.size(), order);
620  CHKERR get_moab().tag_set_data(field_ptr->th_AppOrder, ents,
621  &*o_vec.begin());
622  }
624  };
625 
626  auto create_tags_for_data = [&](const Range &ents) {
628  if (order >= 0) {
629 
630  if (nb_dofs > 0) {
631  if (ent_type == MBVERTEX) {
632  std::vector<FieldData> d_vec(nb_dofs * ents.size(), 0);
633  CHKERR get_moab().tag_set_data(field_ptr->th_FieldDataVerts,
634  ents, &*d_vec.begin());
635  } else {
636  std::vector<int> tag_size(ents.size(), nb_dofs);
637  std::vector<FieldData> d_vec(nb_dofs, 0);
638  std::vector<void const *> d_vec_ptr(ents.size(),
639  &*d_vec.begin());
640  CHKERR get_moab().tag_set_by_ptr(field_ptr->th_FieldData, ents,
641  &*d_vec_ptr.begin(),
642  &*tag_size.begin());
643  }
644  }
645  }
646 
648  };
649 
650  auto get_ents_in_ref_ent = [&](auto miit_ref_ent) {
651  auto hi = refinedEntities.get<Ent_mi_tag>().upper_bound(second);
652  Range in;
653  for (; miit_ref_ent != hi; ++miit_ref_ent)
654  in.insert(miit_ref_ent->get()->getEnt());
655  return in;
656  };
657 
658  auto get_ents_max_order = [&](const Range &ents) {
659  boost::shared_ptr<std::vector<const void *>> vec(
660  new std::vector<const void *>());
661  vec->resize(ents.size());
662  CHKERR get_moab().tag_get_by_ptr(field_ptr->th_AppOrder, ents,
663  &*vec->begin());
664  return vec;
665  };
666 
667  auto get_ents_field_data_vector_adaptor =
668  [&](const Range &ents,
669  boost::shared_ptr<std::vector<const void *>> &ents_max_orders) {
670  // create shared pointer and reserve memory
671  boost::shared_ptr<std::vector<double *>> vec(
672  new std::vector<double *>());
673  vec->reserve(ents.size());
674 
675  if (order >= 0 && nb_dofs == 0) {
676  // set empty vector adaptor
677  for (int i = 0; i != ents.size(); ++i)
678  vec->emplace_back(nullptr);
679  } else {
680  moab::ErrorCode rval;
681  std::vector<int> tag_size(ents.size());
682  std::vector<const void *> d_vec_ptr(ents.size());
683 
684  // get tags data
685  if (ent_type == MBVERTEX)
686  rval = get_moab().tag_get_by_ptr(field_ptr->th_FieldDataVerts,
687  ents, &*d_vec_ptr.begin(),
688  &*tag_size.begin());
689  else
690  rval = get_moab().tag_get_by_ptr(field_ptr->th_FieldData,
691  ents, &*d_vec_ptr.begin(),
692  &*tag_size.begin());
693 
694  auto cast = [](auto p) {
695  return const_cast<FieldData *const>(
696  static_cast<const FieldData *>(p));
697  };
698 
699  // some of entities has tag not set or zero dofs on entity
700  if (rval == MB_SUCCESS) {
701  // all is ok, all entities has tag set
702  auto tit = d_vec_ptr.begin();
703  auto oit = ents_max_orders->begin();
704  for (auto sit = tag_size.begin(); sit != tag_size.end();
705  ++sit, ++tit, ++oit)
706  vec->emplace_back(cast(*tit));
707 
708  } else {
709  // set empty vector adaptor
710  for (int i = 0; i != ents.size(); ++i)
711  vec->emplace_back(nullptr);
712 
713  // check order on all entities, and if for that order non zero
714  // dofs are expected get pointer to tag data and reset vector
715  // adaptor
716  auto oit = ents_max_orders->begin();
717  auto dit = vec->begin();
718  for (auto eit = ents.begin(); eit != ents.end();
719  ++eit, ++oit, ++dit) {
720 
721  const int ent_order =
722  *static_cast<const ApproximationOrder *>(*oit);
723  const int ent_nb_dofs = get_nb_dofs_on_order(ent_order);
724 
725  if (ent_nb_dofs) {
726  int tag_size;
727  const void *ret_val;
728  if (ent_type == MBVERTEX) {
729  rval = get_moab().tag_get_by_ptr(
730  field_ptr->th_FieldDataVerts, &*eit, 1, &ret_val,
731  &tag_size);
732  } else {
733  rval = get_moab().tag_get_by_ptr(
734  field_ptr->th_FieldData, &*eit, 1, &ret_val,
735  &tag_size);
736  if (rval != MB_SUCCESS) {
737 
738  const int set_tag_size[] = {ent_nb_dofs * field_rank};
739  std::array<FieldData, MAX_DOFS_ON_ENTITY> set_d_vec;
740  std::fill(set_d_vec.begin(),
741  &set_d_vec[set_tag_size[0]], 0);
742  const void *set_d_vec_ptr[] = {set_d_vec.data()};
743  CHKERR get_moab().tag_set_by_ptr(
744  field_ptr->th_FieldData, &*eit, 1, set_d_vec_ptr,
745  set_tag_size);
746  rval = get_moab().tag_get_by_ptr(
747  field_ptr->th_FieldData, &*eit, 1, &ret_val,
748  &tag_size);
749 
750  if (rval != MB_SUCCESS) {
751  MOFEM_LOG_ATTRIBUTES("SELF",
754  MOFEM_LOG("SELF", Sev::error)
755  << "Error is triggered in MOAB, field tag data "
756  "for same reason can not be for accessed.";
757  MOFEM_LOG("SELF", Sev::error)
758  << "Set order: " << order;
759  MOFEM_LOG("SELF", Sev::error)
760  << "Nb. dofs on entity for given order: "
761  << set_tag_size[0];
762  MOFEM_LOG("SELF", Sev::error)
763  << "Entity type: "
764  << moab::CN::EntityTypeName(ent_type);
765  MOFEM_LOG("SELF", Sev::error)
766  << "Field: " << *field_ptr;
767  CHKERR rval;
768  }
769  }
770  }
771  const_cast<FieldData *&>(*dit) = cast(ret_val);
772  }
773  }
774  }
775  }
776  return vec;
777  };
778 
779  auto ents_in_ref_ent = get_ents_in_ref_ent(miit_ref_ent);
780 
781  CHKERR create_tags_for_max_order(ents_in_ref_ent);
782  CHKERR create_tags_for_data(ents_in_ref_ent);
783  auto ents_max_order = get_ents_max_order(ents_in_ref_ent);
784  auto ent_field_data =
785  get_ents_field_data_vector_adaptor(ents_in_ref_ent, ents_max_order);
786 
787  // reserve memory for field dofs
788  auto ents_array = boost::make_shared<std::vector<FieldEntity>>();
789  // Add sequence to field data structure. Note that entities are
790  // allocated once into vector. This vector is passed into sequence as a
791  // weak_ptr. Vector is destroyed at the point last entity inside that
792  // vector is destroyed.
793  ents_array->reserve(second - first + 1);
794  auto vit_max_order = ents_max_order->begin();
795  auto vit_field_data = ent_field_data->begin();
796  for (int i = 0; i != ents_in_ref_ent.size(); ++i) {
797 
798  ents_array->emplace_back(
799  field_ptr, *miit_ref_ent,
800  boost::shared_ptr<double *const>(ent_field_data,
801  &*vit_field_data),
802  boost::shared_ptr<const int>(
803  ents_max_order, static_cast<const int *>(*vit_max_order)));
804  ++vit_max_order;
805  ++vit_field_data;
806  ++miit_ref_ent;
807  }
808  if (!ents_array->empty())
809  if ((*ents_array)[0].getFieldRawPtr() != field_ptr.get())
810  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
811  "Get field ent poiter and field pointer do not match for "
812  "field %s",
813  field_ptr->getName().c_str());
814  nb_ents_set_order_new += ents_array->size();
815 
816  // Check if any of entities in the range has bit level but is not added
817  // to database. That generate data inconsistency and error.
818  if (ents_in_ref_ent.size() < (second - first + 1)) {
819  Range ents_not_in_database =
820  subtract(Range(first, second), ents_in_ref_ent);
821  std::vector<const void *> vec_bits(ents_not_in_database.size());
822  CHKERR get_moab().tag_get_by_ptr(
823  get_basic_entity_data_ptr()->th_RefBitLevel, ents_not_in_database,
824  &*vec_bits.begin());
825  auto cast = [](auto p) {
826  return static_cast<const BitRefLevel *>(p);
827  };
828  for (auto v : vec_bits)
829  if (cast(v)->any())
830  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
831  "Try to add entities which are not seeded or added to "
832  "database");
833  }
834 
835  // Add entities to database
836  auto hint = entsFields.end();
837  for (auto &v : *ents_array)
838  hint = entsFields.emplace_hint(hint, ents_array, &v);
839  }
840  }
841  }
842 
843  if (verb > QUIET) {
844  MOFEM_LOG_C("SYNC", Sev::noisy,
845  "nb. of entities in field <%s> for which order was "
846  "increased %d (order %d)",
847  field_ptr->getName().c_str(), nb_ents_set_order_up, order);
848  MOFEM_LOG_C("SYNC", Sev::noisy,
849  "nb. of entities in field <%s> for which order was "
850  "reduced %d (order %d)",
851  field_ptr->getName().c_str(), nb_ents_set_order_down, order);
852  MOFEM_LOG_C(
853  "SYNC", Sev::noisy,
854  "nb. of entities in field <%s> for which order set %d (order %d)",
855  field_ptr->getName().c_str(), nb_ents_set_order_new, order);
856  }
857 
858  if (verb > QUIET) {
859  auto eiit = entsFields.get<Unique_mi_tag>().lower_bound(
860  FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
861  auto hi_eiit = entsFields.get<Unique_mi_tag>().upper_bound(
862  FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
863  MOFEM_LOG_C("SYNC", Sev::noisy,
864  "nb. of ents in the multi index field <%s> %d",
865  field_ptr->getName().c_str(), std::distance(eiit, hi_eiit));
866  }
867 
868  if (verb > QUIET)
869  MOFEM_LOG_SEVERITY_SYNC(mofemComm, Sev::noisy);
870 
872 }

◆ setMoabInterface()

MoFEMErrorCode MoFEM::Core::setMoabInterface ( moab::Interface &  new_moab,
int  verb = VERBOSE 
)
protected

Definition at line 407 of file Core.cpp.

407  {
409  if (verb == -1)
410  verb = verbose;
411 
412  // clear moab database
413  CHKERR clearMap();
414 
415  // set new reference
416  moab = std::ref(new_moab);
417 
418  // check if moab has set communicator if not set communicator internally
419  ParallelComm *pComm = ParallelComm::get_pcomm(&new_moab, MYPCOMM_INDEX);
420  if (pComm == NULL) {
421  pComm = new ParallelComm(&new_moab, wrapMPIMOABComm->get_comm());
422  }
423 
424  // create MoFEM tags
425  CHKERR getTags();
426 
427  // Create basic entity data struture
428  basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
430 
431  // Initalise database
433 
435 };

◆ setRefEntBasicDataPtr()

void MoFEM::Core::setRefEntBasicDataPtr ( MoFEM::Interface m_field,
boost::shared_ptr< BasicEntityData > &  ptr 
)
static

Definition at line 875 of file Core.cpp.

876  {
877 
878  switch (m_field.getValue()) {
879  case -1:
881  break;
882  case 0:
883  set_ref_ent_basic_data_ptr_impl<0>(ptr);
884  break;
885  case 1:
886  set_ref_ent_basic_data_ptr_impl<1>(ptr);
887  break;
888  default:
889  THROW_MESSAGE("Core index can vary from -1 to MAX_CORE_TMP");
890  }
891 };

Member Data Documentation

◆ basicEntityDataPtr

boost::shared_ptr<BasicEntityData> MoFEM::CoreTmp< 0 >::basicEntityDataPtr
protected
Returns
pointer to BasicEntityData structure

BasicEntityData is structure which every BasicEntity have. It keeps data about tags to handles on the mesh, in particular tag to BitRefLevel and tag with handle to parent.

Definition at line 281 of file Core.hpp.

◆ buildMoFEM

int* MoFEM::CoreTmp< 0 >::buildMoFEM
mutableprotected

keeps flags/semaphores for different stages

Definition at line 1000 of file Core.hpp.

◆ dofsField

DofEntity_multiIndex MoFEM::CoreTmp< 0 >::dofsField
protected

dofs on fields

Definition at line 305 of file Core.hpp.

◆ entFEAdjacencies

adjacencies of elements to dofs

Definition at line 311 of file Core.hpp.

◆ entsFields

FieldEntity_multiIndex MoFEM::CoreTmp< 0 >::entsFields
protected

entities on fields

Definition at line 304 of file Core.hpp.

◆ entsFiniteElements

EntFiniteElement_multiIndex MoFEM::CoreTmp< 0 >::entsFiniteElements
protected

finite element entities

Definition at line 308 of file Core.hpp.

◆ fIelds

Field_multiIndex MoFEM::CoreTmp< 0 >::fIelds
protected

fields

Definition at line 303 of file Core.hpp.

◆ finiteElements

FiniteElement_multiIndex MoFEM::CoreTmp< 0 >::finiteElements
protected

finite elements

Definition at line 307 of file Core.hpp.

◆ iFaces

boost::ptr_map<boost::typeindex::type_index, UnknownInterface> MoFEM::CoreTmp< 0 >::iFaces
mutableprotected

Hash map of pointers to interfaces.

Definition at line 998 of file Core.hpp.

◆ initaliseAndBuildField

PetscBool MoFEM::CoreTmp< 0 >::initaliseAndBuildField
protected

If true build field on database initialisation

Definition at line 1004 of file Core.hpp.

◆ initaliseAndBuildFiniteElements

PetscBool MoFEM::CoreTmp< 0 >::initaliseAndBuildFiniteElements
protected

Definition at line 1007 of file Core.hpp.

◆ isGloballyInitialised

bool MoFEM::Core::isGloballyInitialised = false
staticprotected

Core base globally initialized.

Definition at line 1010 of file Core.hpp.

◆ isInitialized

PetscBool MoFEM::Core::isInitialized
staticprotected

petsc was initialised by other agent

Definition at line 1012 of file Core.hpp.

◆ moab

std::reference_wrapper<moab::Interface> MoFEM::CoreTmp< 0 >::moab
protected

moab database

Definition at line 321 of file Core.hpp.

◆ MOFEM_EVENT_createMat

PetscLogEvent MoFEM::CoreTmp< 0 >::MOFEM_EVENT_createMat
protected

Definition at line 958 of file Core.hpp.

◆ MOFEM_EVENT_operator

PetscLogEvent MoFEM::CoreTmp< 0 >::MOFEM_EVENT_operator
protected

Event for evaluating operator of finite element.

Definition at line 955 of file Core.hpp.

◆ MOFEM_EVENT_postProcess

PetscLogEvent MoFEM::CoreTmp< 0 >::MOFEM_EVENT_postProcess
protected

Event for postProcess finite element.

Definition at line 957 of file Core.hpp.

◆ MOFEM_EVENT_preProcess

PetscLogEvent MoFEM::CoreTmp< 0 >::MOFEM_EVENT_preProcess
protected

Event for preProcess finite element.

Definition at line 953 of file Core.hpp.

◆ mofemComm

MPI_Comm MoFEM::CoreTmp< 0 >::mofemComm
mutableprotected

MoFEM communicator.

Definition at line 966 of file Core.hpp.

◆ mpiInitialised

int MoFEM::Core::mpiInitialised
staticprotected

mpi was initialised by other agent

Definition at line 1011 of file Core.hpp.

◆ optionsPrefix

std::string MoFEM::CoreTmp< 0 >::optionsPrefix
protected

Prefix for options on command line.

Definition at line 1002 of file Core.hpp.

◆ pComm

ParallelComm* MoFEM::CoreTmp< 0 >::pComm
mutableprotected

MOAB communicator structure.

Definition at line 967 of file Core.hpp.

◆ pRoblems

Problem_multiIndex MoFEM::CoreTmp< 0 >::pRoblems
protected

problems multi-index

Definition at line 313 of file Core.hpp.

◆ rAnk

int MoFEM::CoreTmp< 0 >::rAnk
protected

MOFEM communicator rank.

Definition at line 970 of file Core.hpp.

◆ refinedEntities

RefEntity_multiIndex MoFEM::CoreTmp< 0 >::refinedEntities
protected

refined entities

Definition at line 300 of file Core.hpp.

◆ refinedFiniteElements

RefElement_multiIndex MoFEM::CoreTmp< 0 >::refinedFiniteElements
protected

refined elements

Definition at line 301 of file Core.hpp.

◆ sIze

int MoFEM::CoreTmp< 0 >::sIze
protected

MoFEM communicator size.

Definition at line 969 of file Core.hpp.

◆ th_ElemType

Tag MoFEM::CoreTmp< 0 >::th_ElemType
protected

Needed for VTK files.

Definition at line 269 of file Core.hpp.

◆ th_FEId

Tag MoFEM::CoreTmp< 0 >::th_FEId
protected

Definition at line 262 of file Core.hpp.

◆ th_FEIdCol

Tag MoFEM::CoreTmp< 0 >::th_FEIdCol
protected

Definition at line 263 of file Core.hpp.

◆ th_FEIdData

Tag MoFEM::CoreTmp< 0 >::th_FEIdData
protected

Definition at line 263 of file Core.hpp.

◆ th_FEIdRow

Tag MoFEM::CoreTmp< 0 >::th_FEIdRow
protected

Definition at line 263 of file Core.hpp.

◆ th_FEName

Tag MoFEM::CoreTmp< 0 >::th_FEName
protected

Definition at line 262 of file Core.hpp.

◆ th_FieldBase

Tag MoFEM::CoreTmp< 0 >::th_FieldBase
protected

Definition at line 261 of file Core.hpp.

◆ th_FieldId

Tag MoFEM::CoreTmp< 0 >::th_FieldId
protected

Definition at line 260 of file Core.hpp.

◆ th_FieldName

Tag MoFEM::CoreTmp< 0 >::th_FieldName
protected

Definition at line 260 of file Core.hpp.

◆ th_FieldName_DataNamePrefix

Tag MoFEM::CoreTmp< 0 >::th_FieldName_DataNamePrefix
protected

Definition at line 260 of file Core.hpp.

◆ th_FieldSpace

Tag MoFEM::CoreTmp< 0 >::th_FieldSpace
protected

Definition at line 260 of file Core.hpp.

◆ th_MoFEMBuild

Tag MoFEM::CoreTmp< 0 >::th_MoFEMBuild
protected

Internal use storing state, used to detect error and inconsistencies

Definition at line 270 of file Core.hpp.

◆ th_Part

Tag MoFEM::CoreTmp< 0 >::th_Part
protected

Tag for partition number.

Definition at line 257 of file Core.hpp.

◆ th_ProblemFEId

Tag MoFEM::CoreTmp< 0 >::th_ProblemFEId
protected

Definition at line 264 of file Core.hpp.

◆ th_ProblemGhostNbDofCol

Tag MoFEM::CoreTmp< 0 >::th_ProblemGhostNbDofCol
protected

Definition at line 267 of file Core.hpp.

◆ th_ProblemGhostNbDofRow

Tag MoFEM::CoreTmp< 0 >::th_ProblemGhostNbDofRow
protected

Definition at line 266 of file Core.hpp.

◆ th_ProblemId

Tag MoFEM::CoreTmp< 0 >::th_ProblemId
protected

Definition at line 264 of file Core.hpp.

◆ th_ProblemLocalNbDofCol

Tag MoFEM::CoreTmp< 0 >::th_ProblemLocalNbDofCol
protected

Definition at line 267 of file Core.hpp.

◆ th_ProblemLocalNbDofRow

Tag MoFEM::CoreTmp< 0 >::th_ProblemLocalNbDofRow
protected

Definition at line 266 of file Core.hpp.

◆ th_ProblemName

Tag MoFEM::CoreTmp< 0 >::th_ProblemName
protected

Definition at line 264 of file Core.hpp.

◆ th_ProblemNbDofsCol

Tag MoFEM::CoreTmp< 0 >::th_ProblemNbDofsCol
protected

Definition at line 265 of file Core.hpp.

◆ th_ProblemNbDofsRow

Tag MoFEM::CoreTmp< 0 >::th_ProblemNbDofsRow
protected

Definition at line 265 of file Core.hpp.

◆ th_ProblemShift

Tag MoFEM::CoreTmp< 0 >::th_ProblemShift
protected

Definition at line 268 of file Core.hpp.

◆ th_RefBitEdge

Tag MoFEM::CoreTmp< 0 >::th_RefBitEdge
protected

Definition at line 258 of file Core.hpp.

◆ th_RefBitLevel

Tag MoFEM::CoreTmp< 0 >::th_RefBitLevel
protected

Definition at line 258 of file Core.hpp.

◆ th_RefBitLevel_Mask

Tag MoFEM::CoreTmp< 0 >::th_RefBitLevel_Mask
protected

Definition at line 258 of file Core.hpp.

◆ th_RefFEMeshset

Tag MoFEM::CoreTmp< 0 >::th_RefFEMeshset
protected

Definition at line 259 of file Core.hpp.

◆ th_RefParentHandle

Tag MoFEM::CoreTmp< 0 >::th_RefParentHandle
protected

Definition at line 258 of file Core.hpp.

◆ value

constexpr const int MoFEM::CoreTmp< 0 >::value = 0
staticconstexpr

Definition at line 84 of file Core.hpp.

◆ verbose

int MoFEM::CoreTmp< 0 >::verbose
protected

Verbosity level.

Definition at line 993 of file Core.hpp.

◆ wrapMPIMOABComm

boost::shared_ptr<WrapMPIComm> MoFEM::CoreTmp< 0 >::wrapMPIMOABComm
protected

manage creation and destruction of MOAB communicator

Definition at line 991 of file Core.hpp.


The documentation for this struct was generated from the following files:
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:576
DEFAULT_VERBOSITY
@ DEFAULT_VERBOSITY
Definition: definitions.h:207
MoFEM::CoreTmp< 0 >::get_meshsets_manager_ptr
MeshsetsManager * get_meshsets_manager_ptr()
get MeshsetsManager pointer
Definition: Core.cpp:815
MoFEM::CoreTmp< 0 >::getOptions
MoFEMErrorCode getOptions(int verb=DEFAULT_VERBOSITY)
Get core options from command line.
Definition: Core.cpp:721
MoFEM::CoreTmp< 0 >::setFieldOrderImpl
MoFEMErrorCode setFieldOrderImpl(boost::shared_ptr< Field > field_ptr, const Range &ents, const ApproximationOrder order, int verb)
Definition: FieldCore.cpp:450
MoFEM::CoreTmp< 0 >::setMoabInterface
MoFEMErrorCode setMoabInterface(moab::Interface &new_moab, int verb=VERBOSE)
Definition: Core.cpp:407
MoFEM::CoreTmp< 0 >::MOFEM_EVENT_operator
PetscLogEvent MOFEM_EVENT_operator
Event for evaluating operator of finite element.
Definition: Core.hpp:955
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:215
MoFEM::CoreTmp< 0 >::build_fields
MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1262
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
H1
@ H1
continuous field
Definition: definitions.h:85
MoFEM::FieldEntity_multiIndex_ent_view
multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< sequenced<>, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt > > > > FieldEntity_multiIndex_ent_view
Definition: FieldEntsMultiIndices.hpp:456
MOFEM_LOG_SEVERITY_SYNC
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
Definition: LogManager.hpp:352
sdf_hertz.d
float d
Definition: sdf_hertz.py:5
LASTBASE
@ LASTBASE
Definition: definitions.h:69
MoFEM::CoreTmp< 0 >::registerSubInterfaces
MoFEMErrorCode registerSubInterfaces()
Register insterfaces.
Definition: Core.cpp:437
BITFEID_SIZE
#define BITFEID_SIZE
max number of finite elements
Definition: definitions.h:221
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
EntityHandle
MoFEM::LogManager::getLog
static LoggerType & getLog(const std::string channel)
Get logger by channel.
Definition: LogManager.cpp:395
MoFEM::CoreTmp< 0 >::th_FEIdData
Tag th_FEIdData
Definition: Core.hpp:263
MoFEM::CoreTmp< 0 >::rAnk
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:970
MoFEM::CoreTmp< 0 >::remove_parents_by_parents
MoFEMErrorCode remove_parents_by_parents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove paremts from entities having parents in passed range.
Definition: DeleteCore.cpp:518
MoFEM::CoreTmp< 0 >::build_finite_elements
MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)
Build finite elements.
Definition: FECore.cpp:658
convert.args
args
Definition: convert.py:66
MoFEM::FieldEntity::getLoLocalEntityBitNumber
static UId getLoLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
Definition: FieldEntsMultiIndices.hpp:247
MoFEM::CoreTmp< 0 >::value
static constexpr int value
Definition: Core.hpp:84
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:596
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
MoFEM::CoreTmp< 0 >::wrapMPIMOABComm
boost::shared_ptr< WrapMPIComm > wrapMPIMOABComm
manage creation and destruction of MOAB communicator
Definition: Core.hpp:991
MoFEM::CoreTmp< 0 >::th_ProblemNbDofsCol
Tag th_ProblemNbDofsCol
Definition: Core.hpp:265
MoFEM::CoreTmp< 0 >::th_ProblemGhostNbDofCol
Tag th_ProblemGhostNbDofCol
Definition: Core.hpp:267
MoFEM::CoreTmp< 0 >::loop_dofs
MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)
Make a loop over dofs.
Definition: ProblemsCore.cpp:531
help
static char help[]
Definition: activate_deactivate_dofs.cpp:13
MoFEM::Types::BitProblemId
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:44
mofem_error_handler
static PetscErrorCode mofem_error_handler(MPI_Comm comm, int line, const char *fun, const char *file, PetscErrorCode n, PetscErrorType p, const char *mess, void *ctx)
Definition: ErrorHandler.cpp:6
MoFEM::CoreTmp< 0 >::entsFiniteElements
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:308
MoFEM::CoreTmp< 0 >::buildMoFEM
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1000
SET_BASIC_METHOD
#define SET_BASIC_METHOD(METHOD, PROBLEM_PTR)
Definition: ProblemsCore.cpp:348
MoFEM::CoreTmp< 0 >::list_problem
MoFEMErrorCode list_problem() const
list problems
Definition: ProblemsCore.cpp:129
VERY_NOISY
@ VERY_NOISY
Definition: definitions.h:212
MoFEM::Types::BitFieldId
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:42
MoFEM::CoreTmp< 0 >::problem_basic_method_postProcess
MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
Set data for BasicMethod.
Definition: ProblemsCore.cpp:395
MoFEM::CoreTmp< 0 >::refinedEntities
RefEntity_multiIndex refinedEntities
refined entities
Definition: Core.hpp:300
MOFEM_LOG_ATTRIBUTES
#define MOFEM_LOG_ATTRIBUTES(channel, bit)
Add attributes to channel.
Definition: LogManager.hpp:296
MoFEM::CoreTmp< 0 >::get_field_structure
const Field * get_field_structure(const std::string &name, enum MoFEMTypes bh=MF_EXIST) const
get field structure
Definition: FieldCore.cpp:65
MoFEM::CoreTmp< 0 >::remove_parents_by_ents
MoFEMErrorCode remove_parents_by_ents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove parents from entities.
Definition: DeleteCore.cpp:477
MoFEM::CoreTmp< 0 >::th_ProblemId
Tag th_ProblemId
Definition: Core.hpp:264
MoFEM::interface_RefEntity< RefEntity >::getEnt
EntityHandle getEnt() const
Get the entity handle.
Definition: RefEntsMultiIndices.hpp:603
MoFEM::CoreTmp< 0 >::th_ProblemLocalNbDofRow
Tag th_ProblemLocalNbDofRow
Definition: Core.hpp:266
MoFEM::CoreTmp< 0 >::clear_finite_elements
MoFEMErrorCode clear_finite_elements(const Range &ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:273
MoFEM::UnknownInterface::getFileVersion
static MoFEMErrorCode getFileVersion(moab::Interface &moab, Version &version)
Get database major version.
Definition: UnknownInterface.cpp:16
MoFEM::FieldEntity::interface_type_RefEntity
interface_RefEntity< RefEntity > interface_type_RefEntity
Definition: FieldEntsMultiIndices.hpp:27
MOFEM_SUCCESS
@ MOFEM_SUCCESS
Definition: definitions.h:30
MoFEM::CoreTmp< 0 >::loop_entities
MoFEMErrorCode loop_entities(const Problem *problem_ptr, const std::string field_name, RowColData rc, EntityMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)
Loop over field entities in the problem.
Definition: ProblemsCore.cpp:650
DeleteCoreFunctionBegin
#define DeleteCoreFunctionBegin
Definition: DeleteCore.cpp:21
MoFEM::CoreTmp< 0 >::BUILD_ADJ
@ BUILD_ADJ
Definition: Core.hpp:214
MoFEM::CoreTmp< 0 >::th_FieldName_DataNamePrefix
Tag th_FieldName_DataNamePrefix
Definition: Core.hpp:260
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::CoreTmp< 0 >::clearMap
MoFEMErrorCode clearMap()
Cleaning database.
Definition: Core.cpp:474
MoFEM::no_handle
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:12
MoFEM::CoreTmp< 0 >::entFEAdjacencies
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:311
MoFEM::CoreTmp< 0 >::th_ProblemName
Tag th_ProblemName
Definition: Core.hpp:264
DATA
@ DATA
Definition: definitions.h:123
MoFEM::CoreTmp< 0 >::th_FEName
Tag th_FEName
Definition: Core.hpp:262
MoFEM::CoreTmp< 0 >::makeSharedRefEntity
static boost::shared_ptr< RefEntityTmp< 0 > > makeSharedRefEntity(MoFEM::Interface &m_field, const EntityHandle ent)
Definition: Core.cpp:894
MOFEM_IMPOSSIBLE_CASE
@ MOFEM_IMPOSSIBLE_CASE
Definition: definitions.h:35
MoFEM::Types::BitFEId
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:43
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
MoFEM::CoreTmp< 0 >::th_ProblemGhostNbDofRow
Tag th_ProblemGhostNbDofRow
Definition: Core.hpp:266
MoFEM::CoreTmp< 0 >::list_finite_elements
MoFEMErrorCode list_finite_elements() const
list finite elements in database
Definition: FECore.cpp:323
sdf.r
int r
Definition: sdf.py:8
USER_BASE
@ USER_BASE
user implemented approximation base
Definition: definitions.h:68
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM::LogManager::logPetscFPrintf
static PetscErrorCode logPetscFPrintf(FILE *fd, const char format[], va_list Argp)
Use to handle PETSc output.
Definition: LogManager.cpp:411
MoFEM::CoreTmp< 0 >::get_moab
moab::Interface & get_moab()
Definition: Core.hpp:322
ROW
@ ROW
Definition: definitions.h:123
MoFEM::CoreTmp< 0 >::addProblem
MoFEMErrorCode addProblem(const BitProblemId id, const std::string &name, int verb=DEFAULT_VERBOSITY)
add problem
Definition: ProblemsCore.cpp:27
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
MoFEM::BitRefManager::fixTagSize
static MoFEMErrorCode fixTagSize(moab::Interface &moab, bool *changed=nullptr)
Fix tag size when BITREFLEVEL_SIZE of core library is different than file BITREFLEVEL_SIZE.
Definition: BitRefManager.cpp:1232
MoFEM::CoreTmp< 0 >::buildFieldForNoField
MoFEMErrorCode buildFieldForNoField(const BitFieldId id, std::map< EntityType, int > &dof_counter, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1065
MOFEM_LOG_FUNCTION
#define MOFEM_LOG_FUNCTION()
Set scope.
Definition: LogManager.hpp:325
MoFEM::CoreTmp< 0 >::clear_ents_fields
MoFEMErrorCode clear_ents_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:113
MoFEM::CoreTmp< 0 >::get_fe_by_name_end
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_end(const std::string &fe_name) const
get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MF...
Definition: FECore.cpp:850
MoFEM::CoreTmp< 0 >::clear_adjacencies_entities
MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
clear adjacency map for entities on given bit level
Definition: DeleteCore.cpp:201
MoFEM::CoreTmp< 0 >::pRoblems
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:313
MoFEM::CoreTmp< 0 >::MOFEM_EVENT_preProcess
PetscLogEvent MOFEM_EVENT_preProcess
Event for preProcess finite element.
Definition: Core.hpp:953
FieldSpace
FieldSpace
approximation spaces
Definition: definitions.h:82
MoFEM::LogManager::BitLineID
@ BitLineID
Definition: LogManager.hpp:48
MoFEM::LogManager::BitScope
@ BitScope
Definition: LogManager.hpp:49
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
VERBOSE
@ VERBOSE
Definition: definitions.h:209
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::CoreTmp< 0 >::th_RefParentHandle
Tag th_RefParentHandle
Definition: Core.hpp:258
MoFEM::CoreTmp< 0 >::get_field_meshset
EntityHandle get_field_meshset(const BitFieldId id) const
Definition: FieldCore.cpp:45
MoFEM::CoreTmp< 0 >::get_comm_size
int get_comm_size() const
Definition: Core.hpp:980
MoFEM::CoreTmp< 0 >::MOFEM_EVENT_createMat
PetscLogEvent MOFEM_EVENT_createMat
Definition: Core.hpp:958
MoFEM::CoreTmp< 0 >::addEntsToFieldByDim
MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:287
MoFEM::CoreTmp< 0 >::get_field_bit_number
FieldBitNumber get_field_bit_number(const std::string name) const
get field bit number
Definition: FieldCore.cpp:28
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::CoreTmp< 0 >::iFaces
boost::ptr_map< boost::typeindex::type_index, UnknownInterface > iFaces
Hash map of pointers to interfaces.
Definition: Core.hpp:998
MoFEM::CoreTmp< 0 >::th_FieldBase
Tag th_FieldBase
Definition: Core.hpp:261
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
MoFEM::Types::UId
uint128_t UId
Unique Id.
Definition: Types.hpp:31
MoFEM::CoreTmp< 0 >::mpiInitialised
static int mpiInitialised
mpi was initialised by other agent
Definition: Core.hpp:1011
MoFEM::CoreTmp< 0 >::list_fields
MoFEMErrorCode list_fields() const
list entities in the field
Definition: FieldCore.cpp:1294
MoFEM::FieldEntity::makeSharedFieldDataAdaptorPtr
static boost::shared_ptr< FieldData *const > makeSharedFieldDataAdaptorPtr(const boost::shared_ptr< Field > &field_ptr, const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Return shared pointer to entity field data vector adaptor.
Definition: FieldEntsMultiIndices.cpp:35
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
MoFEM::CoreTmp< 0 >::th_FEIdRow
Tag th_FEIdRow
Definition: Core.hpp:263
MoFEM::CoreTmp< 0 >::refinedFiniteElements
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:301
MoFEM::Types::FieldCoefficientsNumber
int FieldCoefficientsNumber
Number of field coefficients.
Definition: Types.hpp:27
convert.type
type
Definition: convert.py:64
MoFEM::CoreTmp< 0 >::th_FieldSpace
Tag th_FieldSpace
Definition: Core.hpp:260
MoFEM::FieldEntity::getLocalUniqueIdCalculate
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
Definition: FieldEntsMultiIndices.hpp:136
MoFEM::CoreInterface::get_basic_entity_data_ptr
virtual boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()=0
Get pointer to basic entity data.
MoFEM::EntFiniteElement::getLocalUniqueIdCalculate
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.
Definition: FEMultiIndices.hpp:528
MoFEM::CoreTmp< 0 >::BUILD_FIELD
@ BUILD_FIELD
Definition: Core.hpp:212
MOFEM_LOG_SYNCHRONISE
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:345
MoFEM::CoreTmp< 0 >::th_ProblemFEId
Tag th_ProblemFEId
Definition: Core.hpp:264
MoFEM::FieldEntity::getLoBitNumberUId
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
Definition: FieldEntsMultiIndices.hpp:222
MoFEM::CoreTmp< 0 >::isGloballyInitialised
static bool isGloballyInitialised
Core base globally initialized.
Definition: Core.hpp:1010
COL
@ COL
Definition: definitions.h:123
MoFEM::CoreTmp< 0 >::sIze
int sIze
MoFEM communicator size.
Definition: Core.hpp:969
MoFEM::CoreTmp< 0 >::initaliseAndBuildField
PetscBool initaliseAndBuildField
Definition: Core.hpp:1004
MoFEM::CoreTmp< 0 >::th_RefBitLevel_Mask
Tag th_RefBitLevel_Mask
Definition: Core.hpp:258
LASTSPACE
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:89
MoFEM::get_id_for_max_type
EntityHandle get_id_for_max_type()
Definition: RefEntsMultiIndices.hpp:13
ProblemCoreFunctionBegin
#define ProblemCoreFunctionBegin
Definition: ProblemsCore.cpp:8
MoFEM::CoreTmp< 0 >::BUILD_PROBLEM
@ BUILD_PROBLEM
Definition: Core.hpp:215
MoFEM::CoreTmp< 0 >::add_ents_to_finite_element_by_bit_ref
MoFEMErrorCode add_ents_to_finite_element_by_bit_ref(const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)
add TET entities from given refinement level to finite element database given by name
Definition: FECore.cpp:408
MoFEM::CoreTmp< 0 >::clear_adjacencies_finite_elements
MoFEMErrorCode clear_adjacencies_finite_elements(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
clear adjacency map for finite elements on given bit level
Definition: DeleteCore.cpp:312
MoFEM::CoreTmp< 0 >::isInitialized
static PetscBool isInitialized
petsc was initialised by other agent
Definition: Core.hpp:1012
MoFEM::LogManager::getOptions
static MoFEMErrorCode getOptions()
Get logger option.
Definition: LogManager.cpp:152
MoFEM::CoreTmp< 0 >::buildFieldForL2H1HcurlHdiv
MoFEMErrorCode buildFieldForL2H1HcurlHdiv(const BitFieldId id, std::map< EntityType, int > &dof_counter, std::map< EntityType, int > &inactive_dof_counter, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1088
MoFEM::CoreTmp< 0 >::buildField
MoFEMErrorCode buildField(const boost::shared_ptr< Field > &field, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1200
MoFEM::CoreTmp< 0 >::PARTITION_PROBLEM
@ PARTITION_PROBLEM
Definition: Core.hpp:216
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MoFEM::type_from_handle
auto type_from_handle(const EntityHandle h)
get type from entity handle
Definition: Templates.hpp:1869
MB_ID_WIDTH
#define MB_ID_WIDTH
Definition: definitions.h:227
MoFEM::CoreTmp< 0 >::initaliseAndBuildFiniteElements
PetscBool initaliseAndBuildFiniteElements
Definition: Core.hpp:1007
BYDATA
@ BYDATA
Definition: definitions.h:133
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
MoFEM::CoreTmp< 0 >::th_FieldName
Tag th_FieldName
Definition: Core.hpp:260
MoFEM::CacheTupleSharedPtr
boost::shared_ptr< CacheTuple > CacheTupleSharedPtr
Definition: FEMultiIndices.hpp:495
MoFEM::CoreTmp< 0 >::finiteElements
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:307
MoFEM::CoreTmp< 0 >::th_FieldId
Tag th_FieldId
Definition: Core.hpp:260
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
MoFEM::CoreTmp< 0 >::th_ProblemNbDofsRow
Tag th_ProblemNbDofsRow
Definition: Core.hpp:265
MoFEM::DofEntity::getLoFieldEntityUId
static UId getLoFieldEntityUId(const FieldBitNumber bit, const EntityHandle ent)
Definition: DofsMultiIndices.hpp:69
MoFEM::CoreTmp< 0 >::th_Part
Tag th_Part
Tag for partition number.
Definition: Core.hpp:257
MoFEM::CoreTmp< 0 >::buildFiniteElements
MoFEMErrorCode buildFiniteElements(const boost::shared_ptr< FiniteElement > &fe, const Range *ents_ptr=NULL, int verb=DEFAULT_VERBOSITY)
Definition: FECore.cpp:462
MoFEM::CoreTmp< 0 >::moab
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:321
MOFEM_NOT_FOUND
@ MOFEM_NOT_FOUND
Definition: definitions.h:33
main
int main(int argc, char *argv[])
Definition: activate_deactivate_dofs.cpp:15
MoFEM::CoreTmp< 0 >::loop_finite_elements
MoFEMErrorCode loop_finite_elements(const Problem *problem_ptr, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)
Make a loop over finite elements on partitions from upper to lower rank.
Definition: ProblemsCore.cpp:427
MoFEM::CoreTmp< 0 >::get_basic_entity_data_ptr
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()
Get pointer to basic entity data.
Definition: Core.hpp:290
MoFEM::CoreTmp< 0 >::mofemComm
MPI_Comm mofemComm
MoFEM communicator.
Definition: Core.hpp:966
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::CoreTmp< 0 >::th_RefBitEdge
Tag th_RefBitEdge
Definition: Core.hpp:258
FECoreFunctionBegin
#define FECoreFunctionBegin
Definition: FECore.cpp:7
MoFEM::CoreTmp< 0 >::CoreTmp
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
Definition: Core.cpp:209
convert.n
n
Definition: convert.py:82
MoFEM::CoreTmp< 0 >::pComm
ParallelComm * pComm
MOAB communicator structure.
Definition: Core.hpp:967
MoFEM::CoreTmp< 0 >::buildFieldForNoFieldImpl
MoFEMErrorCode buildFieldForNoFieldImpl(boost::shared_ptr< Field > field_ptr, std::map< EntityType, int > &dof_counter, int verb)
Definition: FieldCore.cpp:960
MAX_DOFS_ON_ENTITY
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:236
MoFEM::CoreTmp< 0 >::problem_basic_method_preProcess
MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
Set data for BasicMethod.
Definition: ProblemsCore.cpp:363
MoFEM::CoreTmp< 0 >::verbose
int verbose
Verbosity level.
Definition: Core.hpp:993
MoFEM::set_ref_ent_basic_data_ptr_impl
void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr< BasicEntityData > &ptr)
Definition: Core.cpp:866
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
MoFEM::CoreTmp< 0 >::PARTITION_FE
@ PARTITION_FE
Definition: Core.hpp:217
Range
MoFEM::CoreTmp< 0 >::Initialize
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:72
FTensor::dd
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
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
BYCOL
@ BYCOL
Definition: definitions.h:132
MoFEM::Types::ApproximationOrder
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:26
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
MoFEM::CoreTmp< 0 >::get_problem
MoFEMErrorCode get_problem(const std::string &problem_name, const Problem **problem_ptr) const
Get problem database (data structure)
Definition: Core.cpp:767
MoFEM::DofEntity::getHiFieldEntityUId
static UId getHiFieldEntityUId(const FieldBitNumber bit, const EntityHandle ent)
Definition: DofsMultiIndices.hpp:75
MoFEM::CoreTmp< 0 >::optionsPrefix
std::string optionsPrefix
Prefix for options on command line.
Definition: Core.hpp:1002
MoFEM::CoreTmp< 0 >::fIelds
Field_multiIndex fIelds
fields
Definition: Core.hpp:303
MoFEM::CoreTmp< 0 >::PARTITION_MESH
@ PARTITION_MESH
Definition: Core.hpp:219
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1094
MoFEM::CoreTmp< 0 >::getTags
MoFEMErrorCode getTags(int verb=DEFAULT_VERBOSITY)
Get tag handles.
Definition: Core.cpp:522
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
MoFEM::Types::BitRefEdges
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:34
MoFEM::CoreTmp< 0 >::set_field_order
MoFEMErrorCode set_field_order(const Range &ents, const BitFieldId id, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:874
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MoFEM::CoreTmp< 0 >::remove_ents_from_finite_element
MoFEMErrorCode remove_ents_from_finite_element(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)
remove entities from given refinement level to finite element database
Definition: DeleteCore.cpp:379
MoFEM::MPC::LAST
@ LAST
MoFEM::Types::FieldData
double FieldData
Field data type.
Definition: Types.hpp:25
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::CoreTmp< 0 >::coreGenericConstructor
MoFEMErrorCode coreGenericConstructor(moab::Interface &moab, MPI_Comm comm, const int verbose)
Definition: Core.cpp:171
MoFEM::CoreTmp< 0 >::th_ProblemLocalNbDofCol
Tag th_ProblemLocalNbDofCol
Definition: Core.hpp:267
MoFEM::LogManager::createDefaultSinks
static void createDefaultSinks(MPI_Comm comm)
Create default sinks.
Definition: LogManager.cpp:313
FieldCoreFunctionBegin
#define FieldCoreFunctionBegin
Definition: FieldCore.cpp:8
FieldApproximationBase
FieldApproximationBase
approximation base
Definition: definitions.h:58
MoFEM::FieldEntity::getHiBitNumberUId
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
Definition: FieldEntsMultiIndices.hpp:228
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
MoFEM::interface_RefEntity< RefEntity >::interface_RefEntity
interface_RefEntity(const boost::shared_ptr< RefEntity > &sptr)
Definition: RefEntsMultiIndices.hpp:574
MoFEM::FieldEntity::getHiLocalEntityBitNumber
static UId getHiLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
Definition: FieldEntsMultiIndices.hpp:258
MoFEM::CoreTmp< 0 >::BUILD_FE
@ BUILD_FE
Definition: Core.hpp:213
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEM::CoreTmp< 0 >::th_FEIdCol
Tag th_FEIdCol
Definition: Core.hpp:263
BYROW
@ BYROW
Definition: definitions.h:131
MoFEM::CoreTmp< 0 >::get_finite_element_meshset
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:276
MoFEM::CoreTmp< 0 >::dofsField
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:305
MoFEM::CoreTmp< 0 >::clear_dofs_fields
MoFEMErrorCode clear_dofs_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:57
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEM::CoreTmp< 0 >::get_field_id
BitFieldId get_field_id(const std::string &name) const
Get field Id.
Definition: FieldCore.cpp:18
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
QUIET
@ QUIET
Definition: definitions.h:208
MoFEM::CoreTmp< 0 >::cache_problem_entities
MoFEMErrorCode cache_problem_entities(const std::string prb_name, CacheTupleWeakPtr cache_ptr)
Cache variables.
Definition: ProblemsCore.cpp:798
MoFEM::field_it
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
Definition: Projection10NodeCoordsOnField.cpp:123
MoFEM::CoreTmp< 0 >::clear_problem
MoFEMErrorCode clear_problem(const std::string name, int verb=DEFAULT_VERBOSITY)
clear problem
Definition: ProblemsCore.cpp:269
MoFEM::CoreInterface
Interface.
Definition: Interface.hpp:27
MoFEM::CoreTmp< 0 >::entsFields
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:304
MoFEM::CoreTmp< 0 >::PARTITION_GHOST_DOFS
@ PARTITION_GHOST_DOFS
Definition: Core.hpp:218
MF_NOT_THROW
@ MF_NOT_THROW
Definition: definitions.h:101
MoFEM::CoreTmp< 0 >::getBitFEId
BitFEId getBitFEId(const std::string &fe_name) const
Get field Id.
Definition: FECore.cpp:258
MoFEM::CoreTmp< 0 >::check_finite_element
bool check_finite_element(const std::string &name) const
Check if finite element is in database.
Definition: FECore.cpp:35
MF_EXCL
@ MF_EXCL
Definition: definitions.h:99
MoFEM::CoreTmp< 0 >::get_fe_by_name_begin
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_begin(const std::string &fe_name) const
get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(...
Definition: FECore.cpp:839
MoFEM::CoreTmp< 0 >::setRefEntBasicDataPtr
static void setRefEntBasicDataPtr(MoFEM::Interface &m_field, boost::shared_ptr< BasicEntityData > &ptr)
Definition: Core.cpp:875
MoFEM::get_id_for_min_type
EntityHandle get_id_for_min_type()
Definition: RefEntsMultiIndices.hpp:18
MoFEM::CoreTmp< 0 >::th_MoFEMBuild
Tag th_MoFEMBuild
Definition: Core.hpp:270
MoFEM::CoreTmp< 0 >::addField
MoFEMErrorCode addField(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_coefficients, const TagType tag_type, const enum MoFEMTypes bh, int verb)
Template for add_field.
Definition: FieldCore.cpp:108
MF_EXIST
@ MF_EXIST
Definition: definitions.h:100
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEM::CoreTmp< 0 >::remove_ents
MoFEMErrorCode remove_ents(const Range ents, int verb=DEFAULT_VERBOSITY)
remove entities form mofem database
Definition: DeleteCore.cpp:429
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEM::get_sub_iface_options_imp
static auto get_sub_iface_options_imp(T *const ptr, int) -> decltype(ptr->getSubInterfaceOptions())
Definition: Core.cpp:138
MoFEM::CoreTmp< 0 >::build_adjacencies
MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)
build adjacencies
Definition: FECore.cpp:745
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:483
MoFEM::CoreTmp< 0 >::MOFEM_EVENT_postProcess
PetscLogEvent MOFEM_EVENT_postProcess
Event for postProcess finite element.
Definition: Core.hpp:957
MoFEM::CoreTmp< 0 >::th_FEId
Tag th_FEId
Definition: Core.hpp:262
MoFEM::CoreTmp< 0 >::basicEntityDataPtr
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:281
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
MOFEM_INVALID_DATA
@ MOFEM_INVALID_DATA
Definition: definitions.h:36
MoFEM::CoreInterface::getValue
virtual const int getValue() const =0
Get the core.
MoFEM::CoreTmp< 0 >::initialiseDatabaseFromMesh
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize database getting information on mesh.
Definition: Core.cpp:268
MoFEM::CoreTmp< 0 >::th_RefBitLevel
Tag th_RefBitLevel
Definition: Core.hpp:258
MoFEM::CoreTmp< 0 >::getValue
const int getValue() const
Get the core.
Definition: Core.hpp:85
MoFEM::UnknownInterface::getInterface
IFACE getInterface() const
Get interface pointer to pointer of interface.
Definition: UnknownInterface.hpp:159
NOFIELD
@ NOFIELD
scalar or vector of scalars describe (no true field)
Definition: definitions.h:84
MoFEM::CoreTmp< 0 >::remove_ents_from_field
MoFEMErrorCode remove_ents_from_field(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)
remove entities from field
Definition: DeleteCore.cpp:152
MoFEM::Types::DofIdx
int DofIdx
Index of DOF.
Definition: Types.hpp:18