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

Core (interface) class. More...

#include <src/interfaces/Core.hpp>

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

Classes

struct  WrapMPIComm
 

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
template<class IFace >
DEPRECATED MoFEMErrorCode query_interface (IFace *&ptr) const
 
template<class IFace >
DEPRECATED IFace * query_interface () const
 
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 seed_ref_level_MESHSET (const EntityHandle meshset, const BitRefLevel &bit, int verb=-1)
 
DEPRECATED MoFEMErrorCode seed_finite_elements (const EntityHandle meshset, int verb=-1)
 
DEPRECATED MoFEMErrorCode seed_finite_elements (const Range &entities, int verb=-1)
 
DEPRECATED MoFEMErrorCode get_entities_by_type_and_ref_level (const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type, const EntityHandle meshset, int verb=-1)
 add all ents from ref level given by bit to meshset More...
 
DEPRECATED MoFEMErrorCode get_entities_by_type_and_ref_level (const BitRefLevel &bit, const BitRefLevel &mask, const EntityType type, Range &ents, int verb=-1)
 add all ents from ref level given by bit to meshset More...
 
DEPRECATED MoFEMErrorCode get_entities_by_ref_level (const BitRefLevel &bit, const BitRefLevel &mask, const EntityHandle meshset)
 add all ents from ref level given by bit to meshset More...
 
DEPRECATED MoFEMErrorCode get_entities_by_ref_level (const BitRefLevel &bit, const BitRefLevel &mask, Range &ents)
 add all ents from ref level given by bit to meshset More...
 
DEPRECATED bool check_msId_meshset (const int msId, const CubitBCType cubit_bc_type)
 check for CUBIT Id and CUBIT type More...
 
DEPRECATED MoFEMErrorCode add_cubit_msId (const CubitBCType cubit_bc_tyep, const int msId, const std::string name="")
 add cubit meshset More...
 
DEPRECATED MoFEMErrorCode set_cubit_msId_attribites (const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
 set attributes to cubit meshset More...
 
DEPRECATED MoFEMErrorCode set_cubit_msId_attribites_data_structure (const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
 set (material) data structure to cubit meshset More...
 
DEPRECATED MoFEMErrorCode set_cubit_msId_bc_data_structure (const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
 set boundary data structure to meshset More...
 
DEPRECATED MoFEMErrorCode delete_cubit_msId (const CubitBCType cubit_bc_type, const int msId)
 delete cubit meshset More...
 
DEPRECATED MoFEMErrorCode get_cubit_msId (const int msId, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr)
 get cubit meshset More...
 
DEPRECATED MoFEMErrorCode get_cubit_msId_entities_by_dimension (const int ms_id, const CubitBCType cubit_bc_type, const int dimension, Range &entities, const bool recursive=false)
 
DEPRECATED MoFEMErrorCode get_cubit_msId_entities_by_dimension (const int ms_id, const CubitBCType cubit_bc_type, Range &entities, const bool recursive=false)
 
DEPRECATED MoFEMErrorCode get_cubit_msId_entities_by_dimension (const int msId, const unsigned int cubit_bc_type, const int dimension, Range &entities, const bool recursive=false)
 get entities from CUBIT/meshset of a particular entity dimension More...
 
DEPRECATED MoFEMErrorCode get_cubit_msId_entities_by_dimension (const int msId, const unsigned int cubit_bc_type, Range &entities, const bool recursive=false)
 get entities related to CUBIT/meshset, More...
 
DEPRECATED MoFEMErrorCode get_cubit_msId_meshset (const int msId, const unsigned int cubit_bc_type, EntityHandle &meshset)
 get meshset from CUBIT Id and CUBIT type More...
 
DEPRECATED MoFEMErrorCode get_cubit_meshsets (const unsigned int cubit_bc_type, Range &meshsets)
 get all CUBIT meshsets by CUBIT type More...
 
DEPRECATED MoFEMErrorCode print_cubit_displacement_set () const
 
DEPRECATED MoFEMErrorCode print_cubit_pressure_set () const
 
DEPRECATED MoFEMErrorCode print_cubit_force_set () const
 
DEPRECATED MoFEMErrorCode print_cubit_materials_set () const
 
DEPRECATED MoFEMErrorCode update_meshset_by_entities_children (const EntityHandle parent, const BitRefLevel &child_bit, const EntityHandle child, EntityType child_type, const bool recursive=false, int verb=-1)
 Get child entities form meshset containing parent entities. More...
 
DEPRECATED MoFEMErrorCode update_field_meshset_by_entities_children (const BitRefLevel &child_bit, int verb=-1)
 update fields meshesets by child entities More...
 
DEPRECATED MoFEMErrorCode update_field_meshset_by_entities_children (const std::string name, const BitRefLevel &child_bit, int verb=-1)
 update field mesheset by child entities More...
 
DEPRECATED MoFEMErrorCode update_finite_element_meshset_by_entities_children (const std::string name, const BitRefLevel &child_bit, const EntityType fe_ent_type, int verb=-1)
 update finite element mesheset by child entities More...
 
DEPRECATED MoFEMErrorCode shift_right_bit_ref (const int shift, int verb=-1)
 right shift bit ref level More...
 
DEPRECATED MoFEMErrorCode build_problem (const std::string &name, const bool square_matrix, int verb=-1)
 build problem data structures More...
 
DEPRECATED MoFEMErrorCode build_problem (Problem *problem_ptr, const bool square_matrix, int verb=-1)
 build problem data structures More...
 
DEPRECATED MoFEMErrorCode build_problem_on_distributed_mesh (const std::string &name, const bool square_matrix=true, int verb=-1)
 build problem data structures, assuming that mesh is distributed (collective) More...
 
DEPRECATED MoFEMErrorCode build_problem_on_distributed_mesh (Problem *problem_ptr, const bool square_matrix=true, int verb=-1)
 build problem data structures, assuming that mesh is distributed (collective) 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 partition_simple_problem (const std::string &name, int verb=-1)
 partition problem dofs More...
 
DEPRECATED MoFEMErrorCode partition_problem (const std::string &name, int verb=-1)
 partition problem dofs (collective) More...
 
DEPRECATED MoFEMErrorCode partition_compose_problem (const std::string &name, const std::string &problem_for_rows, const bool copy_rows, const std::string &problem_for_cols, const bool copy_cols, int verb=-1)
 build indexing and partition problem inheriting indexing and partitioning from two other problems More...
 
DEPRECATED MoFEMErrorCode build_sub_problem (const std::string &out_name, const std::vector< std::string > &fields_row, const std::vector< std::string > &fields_col, const std::string &main_problem, const bool square_matrix=true, int verb=-1)
 build sub problem More...
 
DEPRECATED MoFEMErrorCode partition_ghost_dofs (const std::string &name, int verb=-1)
 determine ghost nodes More...
 
DEPRECATED MoFEMErrorCode partition_finite_elements (const std::string &name, bool part_from_moab=false, int low_proc=-1, int hi_proc=-1, int verb=-1)
 partition finite elements More...
 
DEPRECATED MoFEMErrorCode get_problem_elements_layout (const std::string &name, const std::string &fe_name, PetscLayout *layout, int verb=-1)
 Get layout of elements in the problemIn layout is stored information how many elements is on each processor, for more information look int petsc documentation http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/IS/PetscLayoutCreate.html#PetscLayoutCreate More...
 
DEPRECATED MoFEMErrorCode VecCreateSeq (const std::string &name, RowColData rc, Vec *V) const
 create local vector for problem More...
 
DEPRECATED MoFEMErrorCode VecCreateGhost (const std::string &name, RowColData rc, Vec *V) const
 create ghost vector for problem (collective)collective - need to be run on all processors in communicator More...
 
DEPRECATED MoFEMErrorCode ISCreateFromProblemFieldToOtherProblemField (const std::string &x_problem, const std::string &x_field_name, RowColData x_rc, const std::string &y_problem, const std::string &y_field_name, RowColData y_rc, std::vector< int > &idx, std::vector< int > &idy, int verb=-1) const
 create IS for give two problems and field More...
 
DEPRECATED MoFEMErrorCode ISCreateFromProblemFieldToOtherProblemField (const std::string &x_problem, const std::string &x_field_name, RowColData x_rc, const std::string &y_problem, const std::string &y_field_name, RowColData y_rc, IS *ix, IS *iy, int verb=-1) const
 create IS for give two problems and field More...
 
DEPRECATED MoFEMErrorCode ISCreateProblemOrder (const std::string &problem, RowColData rc, int min_order, int max_order, IS *is, int verb=-1) const
 create IS for given order range (collective) More...
 
DEPRECATED MoFEMErrorCode ISCreateProblemFieldAndRank (const std::string &problem, RowColData rc, const std::string &field, int min_coeff_idx, int max_coeff_idx, IS *is, int verb=-1) const
 create IS for given problem, field and rank range (collective) More...
 
DEPRECATED MoFEMErrorCode VecScatterCreate (Vec xin, const std::string &x_problem, const std::string &x_field_name, RowColData x_rc, Vec yin, const std::string &y_problem, const std::string &y_field_name, RowColData y_rc, VecScatter *newctx, int verb=-1) const
 create scatter for vectors form one to another problem (collective)User specify what name of field on one problem is scattered to another. More...
 
DEPRECATED MoFEMErrorCode VecScatterCreate (Vec xin, const std::string &x_problem, RowColData x_rc, Vec yin, const std::string &y_problem, RowColData y_rc, VecScatter *newctx, int verb=-1) const
 create scatter for vectors form one to another problem (collective) More...
 
DEPRECATED MoFEMErrorCode set_local_ghost_vector (const Problem *problem_ptr, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode) const
 set values of vector from/to meshdatabase More...
 
DEPRECATED MoFEMErrorCode set_local_ghost_vector (const std::string &name, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode) const
 set values of vector from/to meshdatabase More...
 
DEPRECATED MoFEMErrorCode set_global_ghost_vector (const Problem *problem_ptr, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode) const
 set values of vector from/to mesh database (collective)collective - need tu be run on all processors in communicator More...
 
DEPRECATED MoFEMErrorCode set_global_ghost_vector (const std::string &name, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode) const
 set values of vector from/to mesh database (collective)collective - need tu be run on all processors in communicator More...
 
DEPRECATED MoFEMErrorCode set_other_local_ghost_vector (const Problem *problem_ptr, const std::string &fiel_name, const std::string &cpy_field_name, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode, int verb=-1)
 Copy vector to field which is not part of the problem. More...
 
DEPRECATED MoFEMErrorCode set_other_local_ghost_vector (const std::string &name, const std::string &field_name, const std::string &cpy_field_name, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode, int verb=-1)
 Copy vector to field which is not part of the problem. More...
 
DEPRECATED MoFEMErrorCode set_other_global_ghost_vector (const Problem *problem_ptr, const std::string &field_name, const std::string &cpy_field_name, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode, int verb=-1)
 Copy vector to field which is not part of the problem (collective)collective - need tu be run on all processors in communicator. More...
 
DEPRECATED MoFEMErrorCode set_other_global_ghost_vector (const std::string &name, const std::string &field_name, const std::string &cpy_field_name, RowColData rc, Vec V, InsertMode mode, ScatterMode scatter_mode, int verb=-1)
 Copy vector to field which is not part of the problem (collective)collective - need tu be run on all processors in communicator. More...
 
DEPRECATED MoFEMErrorCode field_axpy (const double alpha, const std::string &fiel_name_x, const std::string &field_name_y, bool error_if_missing=false, bool creat_if_missing=false)
 axpy fields More...
 
DEPRECATED MoFEMErrorCode field_scale (const double alpha, const std::string &field_name)
 scale field More...
 
DEPRECATED MoFEMErrorCode set_field (const double val, const EntityType type, const std::string &field_name)
 use FieldBlas More...
 
DEPRECATED MoFEMErrorCode set_field (const double val, const EntityType type, const Range &ents, const std::string &field_name)
 set field More...
 
DEPRECATED MoFEMErrorCode get_adjacencies_equality (const EntityHandle from_entiti, const int to_dimension, Range &adj_entities) const
 Get the adjacencies associated with a entity to entities of a specified dimension. \ separate interface, i.e. BitLevelManager. More...
 
DEPRECATED MoFEMErrorCode get_adjacencies_any (const EntityHandle from_entiti, const int to_dimension, Range &adj_entities) const
 Get the adjacencies associated with a entity to entities of a specified dimension.bit ref level of adjacent entities is any of bit ref level of adjacent entities. More...
 
DEPRECATED MoFEMErrorCode get_adjacencies (const Problem *problem_ptr, const EntityHandle *from_entities, const int num_netities, const int to_dimension, Range &adj_entities, const int operation_type=moab::Interface::INTERSECT, const int verb=0) const
 Get the adjacencies associated with a entity to entities of a specified dimension. \ separate interface, i.e. BitLevelManage. More...
 
DEPRECATED MoFEMErrorCode get_adjacencies (const BitRefLevel &bit, const EntityHandle *from_entities, const int num_netities, const int to_dimension, Range &adj_entities, const int operation_type=moab::Interface::INTERSECT, const int verb=0) const
 Get the adjacencies associated with a entity to entities of a specified dimension. \ separate interface, i.e. BitLevelManage. More...
 
DEPRECATED MoFEMErrorCode clear_dofs_fields (const BitRefLevel &bit, const BitRefLevel &mask, int verb=-1)
 
DEPRECATED MoFEMErrorCode clear_ents_fields (const BitRefLevel &bit, const BitRefLevel &mask, int verb=-1)
 
DEPRECATED MoFEMErrorCode clear_finite_elements (const BitRefLevel &bit, const BitRefLevel &mask, int verb=-1)
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_VERTICEs (const Range &nodes, const std::string &name, int verb=-1)
 set field entities on verticesThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_VERTICEs (const EntityHandle meshset, const std::string &name, int verb=-1)
 set field entities on verticesThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_EDGEs (const Range &edges, const std::string &name, int verb=-1)
 set field entities form adjacencies of edgesThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_EDGEs (const EntityHandle meshset, const std::string &name, int verb=-1)
 set field entities form adjacencies of edgesThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_TRIs (const EntityHandle meshset, const std::string &name, int verb=-1)
 set field entities form adjacencies of trianglesThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_TRIs (const Range &tris, const std::string &name, int verb=-1)
 set field entities form adjacencies of trianglesThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_TETs (const EntityHandle meshset, const std::string &name, int verb=-1)
 set field entities from adjacencies of tetrahedronThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_TETs (const Range &tets, const std::string &name, int verb=-1)
 set field entities from adjacencies of tetrahedronThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_QUADs (const Range &quads, const std::string &name, int verb=-1)
 set field entities from adjacencies of quadsThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_QUADs (EntityHandle meshset, const std::string &name, int verb=-1)
 set field entities from adjacencies of quadsThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_PRISMs (const Range &prisms, const std::string &name, int verb=-1)
 set field entities from adjacencies of prismsThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode add_ents_to_field_by_PRISMs (EntityHandle meshset, const std::string &name, int verb=-1)
 set field entities from adjacencies of prismsThe lower dimension entities are added depending on the space type More...
 
DEPRECATED MoFEMErrorCode MatCreateMPIAIJWithArrays (const std::string &name, Mat *Aij, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode MatCreateMPIAdj_with_Idx_mi_tag (const std::string &name, Mat *Adj, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode MatCreateSeqAIJWithArrays (const std::string &name, Mat *Aij, PetscInt **i, PetscInt **j, PetscScalar **v, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode loop_finite_elements (const Problem *problem_ptr, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, MoFEMTypes bh, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode loop_finite_elements (const std::string &problem_name, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, MoFEMTypes bh, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode loop_finite_elements (const std::string &problem_name, const std::string &fe_name, FEMethod &method, MoFEMTypes bh, int verb=DEFAULT_VERBOSITY)
 
virtual 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)=0
 Make a loop over finite elements. More...
 
virtual 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)=0
 Make a loop over finite elements on partitions from upper to lower rank. More...
 
virtual 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)=0
 Make a loop over finite elements on partitions from upper to lower rank. More...
 
DEPRECATED MoFEMErrorCode make_entities_multishared (const EntityHandle *entities, const int num_entities, const int my_proc=0, int verb=DEFAULT_VERBOSITY)
 make entities from proc 0 shared on all proc More...
 
DEPRECATED MoFEMErrorCode make_entities_multishared (Range &entities, const int my_proc=0, int verb=DEFAULT_VERBOSITY)
 make entities from proc 0 shared on all proc More...
 
DEPRECATED MoFEMErrorCode make_field_entities_multishared (const std::string field_name, const int owner_proc=0, int verb=DEFAULT_VERBOSITY)
 make field entities multi shared More...
 
DEPRECATED MoFEMErrorCode exchange_field_data (const std::string field_name, int verb=DEFAULT_VERBOSITY)
 Exchange field data. More...
 
DEPRECATED MoFEMErrorCode synchronise_entities (Range &ent, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode synchronise_field_entities (const std::string &name, int verb=DEFAULT_VERBOSITY)
 
DEPRECATED MoFEMErrorCode remove_parents_by_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, 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 (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of 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
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 

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...
 
BitFieldId getFieldShift ()
 Return unique field Id. More...
 
BitFEId getFEShift ()
 Return unique finite element Id. 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 (const MOFEMuuid &uid)
 Register subinterfac in core interface. More...
 
- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. More...
 

Protected Attributes

boost::shared_ptr< WrapMPIComm > wrapMPIComm
 
int verbose
 Verbosity level. More...
 
int * fShift
 Ptr to tag handle storing last set bit in field ID. More...
 
int * feShift
 Ptr to tag handle storing last set bit in finite element ID. More...
 
int * pShift
 Ptr to tag handle storing last set bit in problem ID. More...
 
boost::ptr_map< unsigned long, 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 (const MOFEMuuid &uuid, 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
 
Tag get_th_RefType () 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_RefType
 
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_FieldShift
 
Tag th_FEShift
 
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)
 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 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\not collective. 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 getBitFieldId (const std::string &name) const
 
FieldBitNumber get_field_bit_number (const std::string name) const
 get field bit number 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)
 get field structure More...
 

Finite elements

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_by_VERTICEs (const Range &vert, const std::string &name)
 add VERTICES entities from range to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_EDGEs (const Range &vert, const std::string &name)
 add EDGES entities from range to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_EDGEs (const EntityHandle meshset, const std::string &name, const bool recursive=false)
 add EDGES finite elements More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TRIs (const Range &tris, const std::string &name)
 add TRI entities from range to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TRIs (const EntityHandle meshset, const std::string &name, const bool recursive=false)
 add TRI entities from meshset to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TETs (const Range &tets, const std::string &name)
 add TET entities from range to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_TETs (const EntityHandle meshset, const std::string &name, const bool recursive=false)
 add TET entities from meshset to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_PRISMs (const Range &prims, const BitFEId id)
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_PRISMs (const Range &prims, const std::string &name)
 add PRISM entities from meshset to finite element database given by name More...
 
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_by_PRISMs (const EntityHandle meshset, const std::string &name, const bool recursive=false)
 add TET entities from meshset 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)
 add TET elements from given refinement level to finite element database given by name More...
 
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)
 add TET entities from given refinement level to finite element database given by name More...
 
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 &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 &MoFEMFiniteElement_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 &MoFEMFiniteElement_name)
 unset finite element from problem, this remove entities assigned to finite element to a particular problemNote: If problem is build, it need to be cleaned to make this effective 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 elementsBuild finite element data structures. Have to be run before problem and adjacencies are constructed. 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 elementsBuild finite element data structures. Have to be run before problem and adjacencies are constructed. 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 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)
 build problem data structures, assuming that mesh is distributed (collective) More...
 
DEPRECATED MoFEMErrorCode build_problems (int verb=DEFAULT_VERBOSITY)
 build problem data structures More...
 

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 BasicMethodThis 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. More...
 
MoFEMErrorCode problem_basic_method_postProcess (const std::string &problem_name, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
 Set data for BasicMethodThis 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. 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)for(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)for(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)for(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)for(IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_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...
 
EntFiniteElementByName::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...
 
EntFiniteElementByName::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 cOmm
 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
 

Detailed Description

template<>
struct MoFEM::CoreTmp< 0 >

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, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_elastic.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_blas_set_vertex_dofs.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, gauss_points_on_quad.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, hello_world.cpp, helmholtz.cpp, lesson3_poisson.cpp, lesson6_radiation.cpp, lesson7_plastic.cpp, lesson8_contact.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, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, scalar_check_approximation_2d.cpp, simple_contact.cpp, simple_elasticity.cpp, simple_interface.cpp, split_sideset.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, unsaturated_transport.cpp, and wave_equation.cpp.

Definition at line 77 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 207 of file Core.hpp.

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 194 of file Core.cpp.

199  : CoreTmp(moab, comm, verbose, CoreValue<0>()) {
200 
201  // Register sub-interfaces
202  ierr = this->registerSubInterfaces();
203  CHKERRABORT(comm, ierr);
204  ierr = this->clearMap();
205  CHKERRABORT(comm, ierr);
206  ierr = this->getTags();
207  CHKERRABORT(comm, ierr);
208  ierr = this->getOptions(verbose);
209  CHKERRABORT(comm, ierr);
210 
211  this->basicEntityDataPtr = boost::make_shared<BasicEntityData>(moab);
213 
215  CHKERRABORT(comm, ierr);
216 }
static void setRefEntBasicDataPtr(MoFEM::Interface &m_field, boost::shared_ptr< BasicEntityData > &ptr)
Definition: Core.cpp:921
MoFEMErrorCode getTags(int verb=DEFAULT_VERBOSITY)
Get tag handles.
Definition: Core.cpp:539
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize database getting information on mesh.
Definition: Core.cpp:254
int verbose
Verbosity level.
Definition: Core.hpp:1006
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:318
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
Definition: Core.cpp:194
MoFEMErrorCode registerSubInterfaces()
Register insterfaces.
Definition: Core.cpp:435
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:278
MoFEMErrorCode getOptions(int verb=DEFAULT_VERBOSITY)
Get core options from command line.
Definition: Core.cpp:768
MoFEMErrorCode clearMap()
Cleaning database.
Definition: Core.cpp:490

◆ ~CoreTmp()

MoFEM::Core::~CoreTmp ( )

Definition at line 243 of file Core.cpp.

243  {
244  PetscBool is_finalized;
245  PetscFinalized(&is_finalized);
246  // Destroy interfaces
247  iFaces.clear();
248  // This is deprecated ONE should use MoFEM::Core::Initialize
249  if (isGloballyInitialised && is_finalized) {
250  isGloballyInitialised = false;
251  }
252 }
static bool isGloballyInitialised
Core base globally initialized.
Definition: Core.hpp:1027
boost::ptr_map< unsigned long, UnknownInterface > iFaces
Hash map of pointers to interfaces.
Definition: Core.hpp:1015

◆ 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 44 of file CoreTemplates.hpp.

46  : moab(moab), cOmm(0), verbose(verbose),
47  initaliseAndBuildField(PETSC_FALSE),
48  initaliseAndBuildFiniteElements(PETSC_FALSE) {
49 
51  CHKERRABORT(comm, ierr);
52 
53  if (verbose > QUIET) {
54  MOFEM_LOG_CHANNEL("WORLD");
55  MOFEM_LOG_C("WORLD", Sev::verbose, "Core number < %d >", V);
56  }
57 }
MoFEMErrorCode coreGenericConstructor(moab::Interface &moab, MPI_Comm comm, const int verbose)
Definition: Core.cpp:160
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:306
PetscBool initaliseAndBuildFiniteElements
Definition: Core.hpp:1024
int verbose
Verbosity level.
Definition: Core.hpp:1006
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:87
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:318
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:279
PetscBool initaliseAndBuildField
Definition: Core.hpp:1021
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965

Member Function Documentation

◆ add_ents_to_field_by_dim() [1/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 345 of file FieldCore.cpp.

347  {
348  Range ents_dim = ents.subset_by_dimension(dim);
349  return addEntsToFieldByDim(ents_dim, dim, name, verb);
350 }
const int dim
MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:266

◆ add_ents_to_field_by_dim() [2/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 365 of file FieldCore.cpp.

368  {
370  Range ents;
371  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
372  CHKERR addEntsToFieldByDim(ents, dim, name, verb);
374 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
const int dim
MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:266
#define CHKERR
Inline error check.
Definition: definitions.h:604

◆ add_ents_to_field_by_type() [1/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 352 of file FieldCore.cpp.

355  {
357  Range ents_type = ents.subset_by_type(type);
358  if (!ents_type.empty()) {
359  const int dim = get_moab().dimension_from_handle(ents_type[0]);
360  CHKERR addEntsToFieldByDim(ents_type, dim, name, verb);
361  }
363 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const int dim
MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:266
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ add_ents_to_field_by_type() [2/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 376 of file FieldCore.cpp.

379  {
381  Range ents;
382  CHKERR get_moab().get_entities_by_type(meshset, type, ents, recursive);
383  if (!ents.empty()) {
384  const int dim = get_moab().dimension_from_handle(ents[0]);
385  CHKERR addEntsToFieldByDim(ents, dim, name, verb);
386  }
388 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const int dim
MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:266
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 451 of file FECore.cpp.

453  {
455 
456  if (verb == -1)
457  verb = verbose;
458  *buildMoFEM &= 1 << 0;
459  const BitFEId id = getBitFEId(name);
461 
462  auto &ref_MoFEMFiniteElement = refinedFiniteElements.get<Ent_mi_tag>();
463  auto miit = ref_MoFEMFiniteElement.lower_bound(get_id_for_min_type(type));
464  auto hi_miit = ref_MoFEMFiniteElement.upper_bound(get_id_for_max_type(type));
465 
466  int nb_add_fes = 0;
467  for (; miit != hi_miit; miit++) {
468  BitRefLevel bit2 = miit->get()->getBitRefLevel();
469  if ((bit2 & mask) != bit2)
470  continue;
471  if ((bit2 & bit).any()) {
472  EntityHandle ent = miit->get()->getEnt();
473  CHKERR get_moab().add_entities(idm, &ent, 1);
474  nb_add_fes++;
475  }
476  }
477 
478  MOFEM_LOG("SYNC", Sev::inform)
479  << "Finite element " << name << " added. Nb. of elements added "
480  << nb_add_fes << " out of " << std::distance(miit, hi_miit);
481 
483 
485 }
EntityHandle get_id_for_max_type()
EntityHandle get_id_for_min_type()
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:298
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
int verbose
Verbosity level.
Definition: Core.hpp:1006
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
BitFEId getBitFEId(const std::string &name) const
Get field Id.
Definition: FECore.cpp:241
#define FECoreFunctionBegin
Definition: FECore.cpp:21
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:259
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:340

◆ 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 332 of file FECore.cpp.

334  {
335  EntityHandle idm = no_handle;
336  *buildMoFEM &= 1 << 0;
339  Range ents;
340  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
341  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
342  CHKERR get_moab().add_entities(idm, ents);
344 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:27
const int dim
BitFEId getBitFEId(const std::string &name) const
Get field Id.
Definition: FECore.cpp:241
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:259
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 359 of file FECore.cpp.

360  {
361  EntityHandle idm = no_handle;
362  *buildMoFEM &= 1 << 0;
365  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
366  ents.subset_by_dimension(dim));
367  CHKERR get_moab().add_entities(idm, ents.subset_by_dimension(dim));
369 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:27
const int dim
BitFEId getBitFEId(const std::string &name) const
Get field Id.
Definition: FECore.cpp:241
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:259
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ add_ents_to_finite_element_by_EDGEs() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_EDGEs ( const Range &  edge,
const std::string &  name 
)
protectedvirtual

add EDGES entities from range to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
rangecontains tetrahedron
nameFinite Element name

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 378 of file FECore.cpp.

379  {
381  CHKERR add_ents_to_finite_element_by_type(edges, MBEDGE, name);
383 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ add_ents_to_finite_element_by_EDGEs() [2/2]

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

add EDGES finite elements

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
meshset
namename of finite element
recursivetake entities from meshsets in meshset
Returns
error code

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 371 of file FECore.cpp.

372  {
374  CHKERR add_ents_to_finite_element_by_type(meshset, MBEDGE, name, recursive);
376 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ 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 487 of file FECore.cpp.

488  {
490  *buildMoFEM &= 1 << 0;
491  const BitFEId id = getBitFEId(name);
493  if (recursive == false) {
494  CHKERR get_moab().add_entities(idm, &meshset, 1);
495  } else {
496  Range meshsets;
497  CHKERR get_moab().get_entities_by_type(meshset, MBENTITYSET, meshsets,
498  false);
499  CHKERR get_moab().add_entities(idm, meshsets);
500  }
502 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
BitFEId getBitFEId(const std::string &name) const
Get field Id.
Definition: FECore.cpp:241
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:259
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ add_ents_to_finite_element_by_PRISMs() [1/3]

DEPRECATED MoFEMErrorCode MoFEM::CoreTmp< 0 >::add_ents_to_finite_element_by_PRISMs ( const Range &  prims,
const BitFEId  id 
)
protected

◆ add_ents_to_finite_element_by_PRISMs() [2/3]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_PRISMs ( const Range &  prims,
const std::string &  name 
)
protectedvirtual

add PRISM entities from meshset to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
rangecontains tetrahedron
nameFinite Element name

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 418 of file FECore.cpp.

419  {
421  CHKERR add_ents_to_finite_element_by_type(prims, MBPRISM, name);
423 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ add_ents_to_finite_element_by_PRISMs() [3/3]

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

add TET entities from meshset to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
meshsetcontains tetrahedron
nameFinite Element name
recursiveif true parent meshset is searched recursively

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 424 of file FECore.cpp.

425  {
427  CHKERR add_ents_to_finite_element_by_type(meshset, MBPRISM, name, recursive);
429 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ add_ents_to_finite_element_by_TETs() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_TETs ( const Range &  tets,
const std::string &  name 
)
protectedvirtual

add TET entities from range to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
rangecontains tetrahedron
nameFinite Element name

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 405 of file FECore.cpp.

406  {
408  CHKERR add_ents_to_finite_element_by_type(tets, MBTET, name);
410 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ add_ents_to_finite_element_by_TETs() [2/2]

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

add TET entities from meshset to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
meshsetcontains tetrahedron
nameFinite Element name
recursiveif true parent meshset is searched recursively

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 411 of file FECore.cpp.

412  {
414  CHKERR add_ents_to_finite_element_by_type(meshset, MBTET, name, recursive);
416 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ add_ents_to_finite_element_by_TRIs() [1/2]

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_TRIs ( const Range &  tris,
const std::string &  name 
)
protectedvirtual

add TRI entities from range to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
rangecontains tetrahedron
nameFinite Element name

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 392 of file FECore.cpp.

393  {
395  CHKERR add_ents_to_finite_element_by_type(tris, MBTRI, name);
397 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ add_ents_to_finite_element_by_TRIs() [2/2]

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

add TRI entities from meshset to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
rangecontains tetrahedron
nameFinite Element name
recursiveif true parent meshset is searched recursively

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 398 of file FECore.cpp.

399  {
401  CHKERR add_ents_to_finite_element_by_type(meshset, MBTRI, name, recursive);
403 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ 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 315 of file FECore.cpp.

317  {
318  *buildMoFEM &= 1 << 0;
319  EntityHandle idm = no_handle;
321 
323  Range ents;
324  CHKERR get_moab().get_entities_by_type(meshset, type, ents, recursive);
325  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
326  CHKERR get_moab().add_entities(idm, ents);
327 
329 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:27
BitFEId getBitFEId(const std::string &name) const
Get field Id.
Definition: FECore.cpp:241
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:259
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 346 of file FECore.cpp.

347  {
348  EntityHandle idm = no_handle;
349  *buildMoFEM &= 1 << 0;
352  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
353  ents.subset_by_type(type));
354  CHKERR get_moab().add_entities(idm, ents.subset_by_type(type));
356 } // namespace MoFEM
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:27
BitFEId getBitFEId(const std::string &name) const
Get field Id.
Definition: FECore.cpp:241
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:259
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ add_ents_to_finite_element_by_VERTICEs()

MoFEMErrorCode MoFEM::Core::add_ents_to_finite_element_by_VERTICEs ( const Range &  vert,
const std::string &  name 
)
protectedvirtual

add VERTICES entities from range to finite element database given by name

Deprecated:
use add_ents_to_finite_element_by_type
Parameters
rangecontains tetrahedron
nameFinite Element name

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 385 of file FECore.cpp.

386  {
388  CHKERR add_ents_to_finite_element_by_type(vert, MBVERTEX, name);
390 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
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
Definition: FECore.cpp:315

◆ 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 std::string &  name,
EntityType  type,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

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

Deprecated:
use add_ents_to_finite_element_by_bit_ref with mask explicitly given
Parameters
BitRefLevelbit
finiteelement name
finiteelenent type
verrboselevel

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 432 of file FECore.cpp.

434  {
437  type, verb);
438 
440 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
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:451
#define CHKERR
Inline error check.
Definition: definitions.h:604
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 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

Deprecated:
use add_ents_to_finite_element_by_bit_ref with mask explicitly given
Parameters
BitRefLevelbit
BitRefLevelmask
finiteelement name
finiteelement type
verrboselevel

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 442 of file FECore.cpp.

444  {
446  CHKERR add_ents_to_finite_element_by_bit_ref(bit, mask, name, type, verb);
447 
449 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
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:451
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 257 of file FieldCore.cpp.

261  {
262  return this->addField(name, space, base, nb_of_coefficients, tag_type, bh,
263  verb);
264 }
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:109

◆ 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 41 of file FECore.cpp.

42  {
44  *buildMoFEM &= 1 << 0;
45  if (verb == -1) {
46  verb = verbose;
47  }
49  FiniteElements_by_name;
50  FiniteElements_by_name &finite_element_name_set =
51  finiteElements.get<FiniteElement_name_mi_tag>();
52  FiniteElements_by_name::iterator it_fe =
53  finite_element_name_set.find(fe_name);
54  if (bh == MF_EXCL) {
55  if (it_fe != finite_element_name_set.end()) {
56  SETERRQ1(cOmm, MOFEM_NOT_FOUND, "this < %s > is there", fe_name.c_str());
57  }
58  } else {
59  if (it_fe != finite_element_name_set.end())
61  }
62  EntityHandle meshset;
63  CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
64 
65  // id
66  BitFEId id = getFEShift();
67  CHKERR get_moab().tag_set_data(th_FEId, &meshset, 1, &id);
68 
69  // Add finite element meshset to partion meshset. In case of no elements
70  // on processor part, when mesh file is read, finite element meshset is
71  // prevented from deletion by moab reader.
72  auto add_meshset_to_partition = [&](auto meshset) {
74  const void *tag_vals[] = {&rAnk};
75  ParallelComm *pcomm = ParallelComm::get_pcomm(
76  &get_moab(), get_basic_entity_data_ptr()->pcommID);
77  Tag part_tag = pcomm->part_tag();
78  Range tagged_sets;
79  CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
80  tag_vals, 1, tagged_sets,
81  moab::Interface::UNION);
82  for (auto s : tagged_sets)
83  CHKERR get_moab().add_entities(s, &meshset, 1);
85  };
86  CHKERR add_meshset_to_partition(meshset);
87 
88  // id name
89  void const *tag_data[] = {fe_name.c_str()};
90  int tag_sizes[1];
91  tag_sizes[0] = fe_name.size();
92  CHKERR get_moab().tag_set_by_ptr(th_FEName, &meshset, 1, tag_data, tag_sizes);
93 
94  // add FiniteElement
95  auto p = finiteElements.insert(
96  boost::shared_ptr<FiniteElement>(new FiniteElement(moab, meshset)));
97  if (!p.second)
98  SETERRQ(cOmm, MOFEM_OPERATION_UNSUCCESSFUL, "FiniteElement not inserted");
99 
100  if (verb > QUIET)
101  MOFEM_LOG("WORLD", Sev::inform) << "Add finite element " << fe_name;
102 
104 }
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:304
moab::Interface & get_moab()
Definition: Core.hpp:319
static Index< 'p', 3 > p
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
int verbose
Verbosity level.
Definition: Core.hpp:1006
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
BitFEId getFEShift()
Return unique finite element Id.
Definition: Core.cpp:478
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:318
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:969
#define FECoreFunctionBegin
Definition: FECore.cpp:21
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()
Get pointer to basic entity data.
Definition: Core.hpp:287
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965

◆ 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()) {
92  CHKERR addProblem(id, name, verb);
93  } else if (bh == MF_EXCL) {
94  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "problem is in database %s",
95  name.c_str());
96  }
98 }
BitProblemId getProblemShift()
Return unique problem Id.
Definition: Core.cpp:484
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:310
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:55
int verbose
Verbosity level.
Definition: Core.hpp:1006
MoFEMErrorCode addProblem(const BitProblemId id, const std::string &name, int verb=DEFAULT_VERBOSITY)
add problem
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ addEntsToFieldByDim()

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

Definition at line 266 of file FieldCore.cpp.

267  {
268 
269  *buildMoFEM = 0;
270  EntityHandle idm = no_handle;
271  if (verb == -1)
272  verb = verbose;
274  idm = get_field_meshset(name);
275  FieldSpace space;
276  CHKERR get_moab().tag_get_data(th_FieldSpace, &idm, 1, &space);
277  std::vector<int> nb_ents_on_dim(3, 0);
278  switch (space) {
279  case L2:
280  CHKERR get_moab().add_entities(idm, ents);
281  if (verb >= VERY_VERBOSE) {
282  std::ostringstream ss;
283  ss << "add entities to field " << name;
284  ss << " nb. add ents " << ents.size();
285  ss << std::endl;
286  PetscSynchronizedPrintf(cOmm, ss.str().c_str());
287  }
288  break;
289  case H1:
290  CHKERR get_moab().add_entities(idm, ents);
291  for (int dd = 0; dd != dim; ++dd) {
292  Range adj_ents;
293  CHKERR get_moab().get_adjacencies(ents, dd, false, adj_ents,
294  moab::Interface::UNION);
295  if (dd == 0) {
296  Range topo_nodes;
297  CHKERR get_moab().get_connectivity(ents, topo_nodes, true);
298  Range mid_nodes;
299  CHKERR get_moab().get_connectivity(ents, mid_nodes, false);
300  mid_nodes = subtract(mid_nodes, topo_nodes);
301  adj_ents = subtract(adj_ents, mid_nodes);
302  }
303  CHKERR get_moab().add_entities(idm, adj_ents);
304  nb_ents_on_dim[dd] = adj_ents.size();
305  }
306  break;
307  case HCURL:
308  CHKERR get_moab().add_entities(idm, ents);
309  for (int dd = 1; dd != dim; ++dd) {
310  Range adj_ents;
311  CHKERR get_moab().get_adjacencies(ents, dd, false, adj_ents,
312  moab::Interface::UNION);
313  CHKERR get_moab().add_entities(idm, adj_ents);
314  nb_ents_on_dim[dd] = adj_ents.size();
315  }
316  break;
317  case HDIV:
318  CHKERR get_moab().add_entities(idm, ents);
319  if (dim > 2) {
320  Range adj_ents;
321  CHKERR get_moab().get_adjacencies(ents, 2, false, adj_ents,
322  moab::Interface::UNION);
323  CHKERR get_moab().add_entities(idm, adj_ents);
324  nb_ents_on_dim[2] = adj_ents.size();
325  }
326  break;
327  default:
328  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
329  "sorry, unknown space added to entity");
330  }
331  if (verb >= VERY_VERBOSE) {
332  std::ostringstream ss;
333  ss << "add entities to field " << name;
334  ss << " nb. add ents " << ents.size();
335  ss << " nb. add faces " << nb_ents_on_dim[2];
336  ss << " nb. add edges " << nb_ents_on_dim[1];
337  ss << " nb. add nodes " << nb_ents_on_dim[0];
338  ss << std::endl;
339  PetscSynchronizedPrintf(cOmm, ss.str().c_str());
340  PetscSynchronizedFlush(cOmm, PETSC_STDOUT);
341  }
343 }
field with continuous normal traction
Definition: definitions.h:179
EntityHandle get_field_meshset(const BitFieldId id) const
Definition: FieldCore.cpp:49
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:27
int verbose
Verbosity level.
Definition: Core.hpp:1006
const int dim
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
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
field with continuous tangents
Definition: definitions.h:178
FieldSpace
approximation spaces
Definition: definitions.h:174
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
continuous field
Definition: definitions.h:177
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
field with C-1 continuity
Definition: definitions.h:180

◆ 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 109 of file FieldCore.cpp.

113  {
114  MOFEM_LOG_CHANNEL("WORLD");
115  MOFEM_LOG_TAG("WORLD", "FieldCore");
116  MOFEM_LOG_CHANNEL("SYNC");
117  MOFEM_LOG_TAG("SYNC", "FieldCore");
120 
121  if (verb == -1)
122  verb = verbose;
123  *buildMoFEM = 0;
124  auto fit = fIelds.get<FieldName_mi_tag>().find(name);
125  if (fit != fIelds.get<FieldName_mi_tag>().end()) {
126  if (bh == MF_EXCL)
127  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
128  "field is <%s> in database", name.c_str());
129 
130  } else {
131 
132  EntityHandle meshset;
133  CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
134 
135  // Add field mesh set to partion meshset. In case of no elements
136  // on processor part, when mesh file is read, finite element meshset is
137  // prevented from deletion by moab reader.
138  auto add_meshset_to_partition = [&](auto meshset) {
140  const void *tag_vals[] = {&rAnk};
141  ParallelComm *pcomm = ParallelComm::get_pcomm(
142  &get_moab(), get_basic_entity_data_ptr()->pcommID);
143  Tag part_tag = pcomm->part_tag();
144  Range tagged_sets;
145  CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
146  tag_vals, 1, tagged_sets,
147  moab::Interface::UNION);
148  for (auto s : tagged_sets)
149  CHKERR get_moab().add_entities(s, &meshset, 1);
151  };
152  CHKERR add_meshset_to_partition(meshset);
153 
154  // id
155  BitFieldId id = getFieldShift();
156 
157  auto create_tags = [&]() {
159  CHKERR
160  get_moab().tag_set_data(th_FieldId, &meshset, 1, &id);
161  // space
162  CHKERR get_moab().tag_set_data(th_FieldSpace, &meshset, 1, &space);
163  // base
164  CHKERR get_moab().tag_set_data(th_FieldBase, &meshset, 1, &base);
165 
166  // name
167  void const *tag_data[] = {name.c_str()};
168  int tag_sizes[1];
169  tag_sizes[0] = name.size();
170  CHKERR get_moab().tag_set_by_ptr(th_FieldName, &meshset, 1, tag_data,
171  tag_sizes);
172  // name data prefix
173  const std::string name_data_prefix("_App_Data");
174  void const *tag_prefix_data[] = {name_data_prefix.c_str()};
175  int tag_prefix_sizes[1];
176  tag_prefix_sizes[0] = name_data_prefix.size();
177  CHKERR get_moab().tag_set_by_ptr(th_FieldName_DataNamePrefix, &meshset, 1,
178  tag_prefix_data, tag_prefix_sizes);
179  Tag th_app_order, th_field_data, th_field_data_vert, th_rank;
180  // data
181  std::string tag_data_name = name_data_prefix + name;
182  const int def_len = 0;
183  CHKERR get_moab().tag_get_handle(
184  tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE, th_field_data,
185  MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
186  std::string tag_data_name_verts = name_data_prefix + name + "V";
187  VectorDouble def_vert_data(nb_of_coefficients);
188  def_vert_data.clear();
189  CHKERR get_moab().tag_get_handle(
190  tag_data_name_verts.c_str(), nb_of_coefficients, MB_TYPE_DOUBLE,
191  th_field_data_vert, MB_TAG_CREAT | tag_type, &*def_vert_data.begin());
192  // order
193  ApproximationOrder def_ApproximationOrder = -1;
194  const std::string Tag_ApproximationOrder_name = "_App_Order_" + name;
195  CHKERR get_moab().tag_get_handle(
196  Tag_ApproximationOrder_name.c_str(), 1, MB_TYPE_INTEGER, th_app_order,
197  MB_TAG_CREAT | tag_type, &def_ApproximationOrder);
198  // rank
199  int def_rank = 1;
200  const std::string tag_rank_name = "_Field_Rank_" + name;
201  CHKERR get_moab().tag_get_handle(tag_rank_name.c_str(), 1,
202  MB_TYPE_INTEGER, th_rank,
203  MB_TAG_CREAT | MB_TAG_SPARSE, &def_rank);
204  CHKERR get_moab().tag_set_data(th_rank, &meshset, 1, &nb_of_coefficients);
205 
207  };
208 
209  auto create_undefined_cs = [&](auto &undefined_cs_ptr) {
211  const int unidefined_cs_dim[] = {-1, 0, 0, 0};
212  CHKERR getInterface<CoordSystemsManager>()->addCoordinateSystem(
213  unidefined_cs_dim, "UNDEFINED", MF_ZERO);
214  CHKERR getInterface<CoordSystemsManager>()->getCoordSysPtr(
215  "UNDEFINED", undefined_cs_ptr);
217  };
218 
219  auto add_field_meshset_to_cs = [&](auto &undefined_cs_ptr) {
221  int cs_name_size[1];
222  cs_name_size[0] = undefined_cs_ptr->getName().size();
223  void const *cs_name[] = {&*undefined_cs_ptr->getNameRef().begin()};
224  CHKERR get_moab().tag_set_by_ptr(
225  getInterface<CoordSystemsManager>()->get_th_CoordSysName(), &meshset,
226  1, cs_name, cs_name_size);
227  EntityHandle coord_sys_meshset = undefined_cs_ptr->getMeshset();
228  CHKERR get_moab().add_entities(coord_sys_meshset, &meshset, 1);
230  };
231 
232  CHKERR create_tags();
233  boost::shared_ptr<CoordSys> undefined_cs_ptr;
234  CHKERR create_undefined_cs(undefined_cs_ptr);
235  CHKERR add_field_meshset_to_cs(undefined_cs_ptr);
236 
237  auto p = fIelds.insert(
238  boost::make_shared<Field>(moab, meshset, undefined_cs_ptr));
239  if (verb > QUIET) {
240  MOFEM_LOG("WORLD", Sev::inform) << "Add field " << **p.first;
241  MOFEM_LOG("WORLD", Sev::noisy)
242  << "Field " << (*p.first)->getName() << " core value < "
243  << this->getValue() << " > field value ) "
244  << (*p.first)->getBitNumber() << " )";
245  }
246 
247  if (!p.second)
248  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND,
249  "field not inserted %s (top tip, it could be already "
250  "there)",
251  Field(moab, meshset, undefined_cs_ptr).getName().c_str());
252  }
253 
255 }
BitFieldId getFieldShift()
Return unique field Id.
Definition: Core.cpp:473
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:37
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MOFEM_LOG_TAG(channel, tag)
Tag channelTag channel tag is set until MOFEM_LOG_CHANNEL is called, then new tag can be set.
Definition: LogManager.hpp:334
static Index< 'p', 3 > p
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
Tag th_FieldName_DataNamePrefix
Definition: Core.hpp:257
int verbose
Verbosity level.
Definition: Core.hpp:1006
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:318
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:969
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:279
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
#define CHKERR
Inline error check.
Definition: definitions.h:604
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()
Get pointer to basic entity data.
Definition: Core.hpp:287
const int getValue() const
Get the core.
Definition: Core.hpp:80
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:74
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
#define MOFEM_LOG_FUNCTION()
Set scopeMacro for function scope markup. The scope name is constructed with help of compiler and con...
Definition: LogManager.hpp:320

◆ 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 510 of file Core.cpp.

510  {
512  if (verb == -1)
513  verb = verbose;
514  std::pair<RefEntity_multiIndex::iterator, bool> p_ent;
515  p_ent = refinedEntities.insert(
516  boost::make_shared<RefEntity>(basicEntityDataPtr, prism));
517  if (p_ent.second) {
518  std::pair<RefElement_multiIndex::iterator, bool> p;
519  p = refinedFiniteElements.insert(
520  boost::shared_ptr<RefElement>(new RefElement_PRISM(*p_ent.first)));
521  int num_nodes;
522  const EntityHandle *conn;
523  CHKERR get_moab().get_connectivity(prism, conn, num_nodes, true);
524  Range face_side3, face_side4;
525  CHKERR get_moab().get_adjacencies(conn, 3, 2, false, face_side3);
526  CHKERR get_moab().get_adjacencies(&conn[3], 3, 2, false, face_side4);
527  if (face_side3.size() != 1)
528  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
529  "prism don't have side face 3");
530  if (face_side4.size() != 1)
531  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
532  "prims don't have side face 4");
533  p.first->get()->getSideNumberPtr(*face_side3.begin());
534  p.first->get()->getSideNumberPtr(*face_side4.begin());
535  }
537 }
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:298
moab::Interface & get_moab()
Definition: Core.hpp:319
static Index< 'p', 3 > p
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
RefEntity_multiIndex refinedEntities
refined entities
Definition: Core.hpp:297
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define CHKERR
Inline error check.
Definition: definitions.h:604
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:278
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 40 of file ProblemsCore.cpp.

41  {
43 
44  if (verb == -1)
45  verb = verbose;
46  EntityHandle meshset;
47  CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
48  CHKERR get_moab().tag_set_data(th_ProblemId, &meshset, 1, &id);
49 
50  // Add problem meshset to partion meshset. In case of no elements
51  // on processor part, when mesh file is read, finite element meshset is
52  // prevented from deletion by moab reader.
53  auto add_meshset_to_partition = [&](auto meshset) {
55  const void *tag_vals[] = {&rAnk};
56  ParallelComm *pcomm = ParallelComm::get_pcomm(
57  &get_moab(), get_basic_entity_data_ptr()->pcommID);
58  Tag part_tag = pcomm->part_tag();
59  Range tagged_sets;
60  CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
61  tag_vals, 1, tagged_sets,
62  moab::Interface::UNION);
63  for (auto s : tagged_sets)
64  CHKERR get_moab().add_entities(s, &meshset, 1);
66  };
67  CHKERR add_meshset_to_partition(meshset);
68 
69  void const *tag_data[] = {name.c_str()};
70  int tag_sizes[1];
71  tag_sizes[0] = name.size();
72  CHKERR get_moab().tag_set_by_ptr(th_ProblemName, &meshset, 1, tag_data,
73  tag_sizes);
74  // create entry
75  auto p = pRoblems.insert(Problem(moab, meshset));
76  if (!p.second)
77  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Problem not added");
78 
79  MOFEM_LOG("WORLD", Sev::inform) << "Add problem " << name;
80 
82 }
moab::Interface & get_moab()
Definition: Core.hpp:319
static Index< 'p', 3 > p
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:310
int verbose
Verbosity level.
Definition: Core.hpp:1006
std::reference_wrapper< moab::Interface > moab
moab database
Definition: Core.hpp:318
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:969
#define ProblemCoreFunctionBegin
#define CHKERR
Inline error check.
Definition: definitions.h:604
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()
Get pointer to basic entity data.
Definition: Core.hpp:287
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ build_adjacencies() [1/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 824 of file FECore.cpp.

824  {
826  if (verb == DEFAULT_VERBOSITY)
827  verb = verbose;
828 
829  if (!((*buildMoFEM) & BUILD_FIELD))
830  SETERRQ(cOmm, MOFEM_NOT_FOUND, "field not build");
831  if (!((*buildMoFEM) & BUILD_FE))
832  SETERRQ(cOmm, MOFEM_NOT_FOUND, "fe not build");
833  for (Range::const_pair_iterator peit = ents.pair_begin();
834  peit != ents.pair_end(); ++peit) {
835  EntFiniteElement_multiIndex::index<Ent_mi_tag>::type::iterator fit, hi_fit;
836  fit = entsFiniteElements.get<Ent_mi_tag>().lower_bound(peit->first);
837  hi_fit = entsFiniteElements.get<Ent_mi_tag>().upper_bound(peit->second);
838  for (; fit != hi_fit; ++fit) {
839  if ((*fit)->getBitFieldIdRow().none() &&
840  (*fit)->getBitFieldIdCol().none() &&
841  (*fit)->getBitFieldIdData().none())
842  continue;
843  int by = BYROW;
844  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol())
845  by |= BYCOL;
846  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData())
847  by |= BYDATA;
848  FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_row(by);
849  auto hint = entFEAdjacencies.end();
850  for (auto e : *(*fit)->getRowFieldEntsPtr()) {
851  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
852  bool success = entFEAdjacencies.modify(hint, modify_row);
853  if (!success)
854  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
855  "modification unsuccessful");
856  }
857  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol()) {
858  int by = BYCOL;
859  if ((*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData())
860  by |= BYDATA;
861  FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_col(by);
862  auto hint = entFEAdjacencies.end();
863  for (auto e : *(*fit)->getColFieldEntsPtr()) {
864  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
865  bool success = entFEAdjacencies.modify(hint, modify_col);
866  if (!success)
867  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
868  "modification unsuccessful");
869  }
870  }
871  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData() ||
872  (*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData()) {
873  FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_data(
874  BYDATA);
875  auto hint = entFEAdjacencies.end();
876  for (auto &e : (*fit)->getDataFieldEnts()) {
877  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
878  bool success = entFEAdjacencies.modify(hint, modify_data);
879  if (!success)
880  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
881  "modification unsuccessful");
882  }
883  }
884  }
885  }
886 
887  if (verb >= VERBOSE) {
888  MOFEM_LOG("WORLD", Sev::inform)
889  << "Number of adjacencies " << entFEAdjacencies.size();
891  }
892 
893  *buildMoFEM |= 1 << 2;
895 }
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:305
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define FECoreFunctionBegin
Definition: FECore.cpp:21
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:308
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:340

◆ 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 909 of file FECore.cpp.

909  {
911  if (verb == -1)
912  verb = verbose;
913  CHKERR build_adjacencies(bit, BitRefLevel().set(), verb);
914 
916 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)
build adjacencies
Definition: FECore.cpp:824
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define CHKERR
Inline error check.
Definition: definitions.h:604
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ build_adjacencies() [3/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 897 of file FECore.cpp.

898  {
900  if (verb == -1)
901  verb = verbose;
902  Range ents;
903  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents);
904 
905  CHKERR build_adjacencies(ents, verb);
906 
908 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)
build adjacencies
Definition: FECore.cpp:824
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 1257 of file FieldCore.cpp.

1257  {
1259  auto field_it = fIelds.get<FieldName_mi_tag>().find(field_name);
1260  if (field_it == fIelds.get<FieldName_mi_tag>().end())
1261  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "Field < %s > not found",
1262  field_name.c_str());
1263 
1264  CHKERR this->buildField(*field_it, verb);
1265  if (verb > QUIET)
1268 }
#define FieldCoreFunctionBegin
Definition: FieldCore.cpp:21
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
MoFEMErrorCode buildField(const boost::shared_ptr< Field > &field, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1171
#define CHKERR
Inline error check.
Definition: definitions.h:604
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:340

◆ build_fields()

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

build fields

Implements MoFEM::CoreInterface.

Definition at line 1270 of file FieldCore.cpp.

1270  {
1272  if (verb == -1)
1273  verb = verbose;
1274 
1275  for (auto field : fIelds.get<BitFieldId_mi_tag>())
1276  CHKERR this->buildField(field, verb);
1277 
1278  *buildMoFEM = 1 << 0;
1279  if (verb > QUIET) {
1280  MOFEM_LOG("SYNC", Sev::inform) << "Number of dofs " << dofsField.size();
1282  }
1283 
1285 }
#define FieldCoreFunctionBegin
Definition: FieldCore.cpp:21
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
int verbose
Verbosity level.
Definition: Core.hpp:1006
MoFEMErrorCode buildField(const boost::shared_ptr< Field > &field, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1171
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:302
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:340

◆ build_finite_elements() [1/3]

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

Build finite elementsBuild 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 743 of file FECore.cpp.

743  {
745 
746  if (verb == DEFAULT_VERBOSITY)
747  verb = verbose;
748 
749  // loop Finite Elements
750  for (auto &fe : finiteElements)
751  CHKERR buildFiniteElements(fe, NULL, verb);
752 
753  if (verb > QUIET) {
754 
755  auto &fe_ents = entsFiniteElements.get<FiniteElement_name_mi_tag>();
756  for (auto &fe : finiteElements) {
757  auto miit = fe_ents.lower_bound(fe->getName());
758  auto hi_miit = fe_ents.upper_bound(fe->getName());
759  const auto count = std::distance(miit, hi_miit);
760  MOFEM_LOG("SYNC", Sev::inform)
761  << "Finite element " << fe->getName()
762  << " added. Nb. of elements added " << count;
763  MOFEM_LOG("SYNC", Sev::noisy) << *fe;
764 
765  auto slg = MoFEM::LogManager::getLog("SYNC");
766  for (auto &field : fIelds) {
767  auto rec = slg.open_record(keywords::severity = Sev::verbose);
768  if (rec) {
769  logging::record_ostream strm(rec);
770  strm << "Field " << field->getName() << " on finite element: ";
771  if ((field->getId() & fe->getBitFieldIdRow()).any())
772  strm << "row ";
773  if ((field->getId() & fe->getBitFieldIdCol()).any())
774  strm << "columns ";
775  if ((field->getId() & fe->getBitFieldIdData()).any())
776  strm << "data";
777  strm.flush();
778  slg.push_record(boost::move(rec));
779  }
780  }
781  }
782 
784  }
785 
786  *buildMoFEM |= 1 << 1;
788 }
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:304
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:305
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define FECoreFunctionBegin
Definition: FECore.cpp:21
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
static LoggerType & getLog(const std::string channel)
Get logger by channel.
Definition: LogManager.cpp:369
#define CHKERR
Inline error check.
Definition: definitions.h:604
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
MoFEMErrorCode buildFiniteElements(const boost::shared_ptr< FiniteElement > &fe, const Range *ents_ptr=NULL, int verb=DEFAULT_VERBOSITY)
Definition: FECore.cpp:505
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:340

◆ build_finite_elements() [2/3]

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

Definition at line 790 of file FECore.cpp.

790  {
792  SETERRQ(cOmm, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
794 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965

◆ build_finite_elements() [3/3]

MoFEMErrorCode MoFEM::CoreTmp< 0 >::build_finite_elements ( const string  fe_name,
const Range *const  ents_ptr = nullptr,
int  verb = DEFAULT_VERBOSITY 
)
protectedvirtual

Build finite elementsBuild 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.

◆ build_problem_on_distributed_mesh()

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

build problem data structures, assuming that mesh is distributed (collective)

Deprecated:
Use ProblemsManager to build and partition problems

Mesh is distributed, that means that each processor keeps only own part of the mesh and shared entities.

Collective - need to be run on all processors in communicator, i.e. each function has to call this function.

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 249 of file ProblemsCore.cpp.

249  {
251  if (verb == -1)
252  verb = verbose;
253  Problem_multiIndex::iterator p_miit = pRoblems.begin();
254  for (; p_miit != pRoblems.end(); p_miit++) {
255  CHKERR getInterface<ProblemsManager>()->buildProblemOnDistributedMesh(
256  const_cast<Problem *>(&*p_miit), verb);
257  }
259 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:310
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ build_problems()

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

build problem data structures

Deprecated:
Use MoFEM::Interface::build_problem(const std::string &name,const bool square_matrix,int verb = -1) instead. This function not allows to Control if problem is structurally symmetric.

Implements MoFEM::DeprecatedCoreInterface.

Definition at line 309 of file ProblemsCore.cpp.

309  {
311  if (verb == -1)
312  verb = verbose;
313  if (!((*buildMoFEM) & BUILD_FIELD))
314  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "fields not build");
315  if (!((*buildMoFEM) & BUILD_FE))
316  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "FEs not build");
317  if (!((*buildMoFEM) & BUILD_ADJ))
318  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "adjacencies not build");
319  // iterate problems
320  Problem_multiIndex::iterator p_miit = pRoblems.begin();
321  for (; p_miit != pRoblems.end(); p_miit++) {
322  Problem *problem_ptr = const_cast<Problem *>(&*p_miit);
323  CHKERR getInterface<ProblemsManager>()->buildProblem(problem_ptr, false,
324  verb);
325  }
328 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:310
int verbose
Verbosity level.
Definition: Core.hpp:1006
int * buildMoFEM
keeps flags/semaphores for different stages
Definition: Core.hpp:1017
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ buildField()

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

Definition at line 1171 of file FieldCore.cpp.

1172  {
1174  if (verb == -1)
1175  verb = verbose;
1176  if (verb > QUIET)
1177  MOFEM_LOG("SYNC", Sev::verbose) << "Build field " << field->getName();
1178 
1179  std::map<EntityType, int> dof_counter;
1180  std::map<EntityType, int> inactive_dof_counter;
1181 
1182  // Need to rebuild order table since number of dofs on each order when
1183  // field was created.
1184  if (field->getApproxBase() == USER_BASE)
1185  CHKERR field->rebuildDofsOrderMap();
1186 
1187  switch (field->getSpace()) {
1188  case NOFIELD:
1189  CHKERR this->buildFieldForNoField(field->getId(), dof_counter, verb);
1190  break;
1191  case L2:
1192  case H1:
1193  case HCURL:
1194  case HDIV:
1195  CHKERR this->buildFieldForL2H1HcurlHdiv(field->getId(), dof_counter,
1196  inactive_dof_counter, verb);
1197  break;
1198  default:
1199  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
1200  }
1201 
1202  if (verb > QUIET) {
1203  int nb_added_dofs = 0;
1204  int nb_inactive_added_dofs = 0;
1205  for (auto const &it : dof_counter) {
1206  switch (it.first) {
1207  case MBVERTEX:
1208  MOFEM_LOG("SYNC", Sev::verbose)
1209  << "Nb. of dofs (vertices) " << it.second << " (inactive "
1210  << inactive_dof_counter[it.first] << ")";
1211  break;
1212  case MBEDGE:
1213  MOFEM_LOG("SYNC", Sev::verbose)
1214  << "Nb. of dofs (edge) " << it.second << " (inactive "
1215  << inactive_dof_counter[it.first] << ")";
1216  break;
1217  case MBTRI:
1218  MOFEM_LOG("SYNC", Sev::verbose)
1219  << "Nb. of dofs (triangles) " << it.second << " (inactive "
1220  << inactive_dof_counter[it.first] << ")";
1221  break;
1222  case MBQUAD:
1223  MOFEM_LOG("SYNC", Sev::verbose)
1224  << "Nb. of dofs (quads) " << it.second << " (inactive "
1225  << inactive_dof_counter[it.first] << ")";
1226  break;
1227  case MBTET:
1228  MOFEM_LOG("SYNC", Sev::verbose)
1229  << "Nb. of dofs (tetrahedra) " << it.second << " (inactive "
1230  << inactive_dof_counter[it.first] << ")";
1231  break;
1232  case MBPRISM:
1233  MOFEM_LOG("SYNC", Sev::verbose)
1234  << "Nb. of dofs (prisms) " << it.second << " (inactive "
1235  << inactive_dof_counter[it.first] << ")";
1236  break;
1237  case MBENTITYSET:
1238  MOFEM_LOG("SYNC", Sev::verbose)
1239  << "Nb. of dofs (meshsets) " << it.second << " (inactive "
1240  << inactive_dof_counter[it.first] << ")";
1241  break;
1242  default:
1243  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
1244  }
1245  nb_added_dofs += it.second;
1246  nb_inactive_added_dofs += inactive_dof_counter[it.first];
1247  }
1248  if (verb > QUIET) {
1249  MOFEM_LOG("SYNC", Sev::verbose)
1250  << "Nb. added dofs " << nb_added_dofs << " (number of inactive dofs "
1251  << nb_inactive_added_dofs << " )";
1252  }
1253  }
1255 }
field with continuous normal traction
Definition: definitions.h:179
user implemented approximation base
Definition: definitions.h:160
scalar or vector of scalars describe (no true field)
Definition: definitions.h:176
#define FieldCoreFunctionBegin
Definition: FieldCore.cpp:21
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
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:1057
int verbose
Verbosity level.
Definition: Core.hpp:1006
field with continuous tangents
Definition: definitions.h:178
#define CHKERR
Inline error check.
Definition: definitions.h:604
continuous field
Definition: definitions.h:177
MoFEMErrorCode buildFieldForNoField(const BitFieldId id, std::map< EntityType, int > &dof_counter, int verb=DEFAULT_VERBOSITY)
Definition: FieldCore.cpp:1034
field with C-1 continuity
Definition: definitions.h:180

◆ 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 1057 of file FieldCore.cpp.

1059  {
1061  if (verb == -1)
1062  verb = verbose;
1063 
1064  // Find field
1065  auto &set_id = fIelds.get<BitFieldId_mi_tag>();
1066  auto field_it = set_id.find(id);
1067  if (field_it == set_id.end()) {
1068  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "Field not found");
1069  }
1070  const int bit_number = field_it->get()->getBitNumber();
1071  const int rank = field_it->get()->getNbOfCoeffs();
1072  const boost::string_ref &field_name = field_it->get()->getNameRef();
1073 
1074  // Ents in the field meshset
1075  Range ents_of_id_meshset;
1076  CHKERR get_moab().get_entities_by_handle((*field_it)->meshSet,
1077  ents_of_id_meshset, false);
1078  if (verb > VERY_NOISY) {
1079  PetscSynchronizedPrintf(PETSC_COMM_SELF, "Ents in field %s meshset %d\n",
1080  (*field_it)->getName().c_str(),
1081  ents_of_id_meshset.size());
1082  }
1083 
1084  for (auto p_eit = ents_of_id_meshset.pair_begin();
1085  p_eit != ents_of_id_meshset.pair_end(); ++p_eit) {
1086 
1087  const EntityHandle first = p_eit->first;
1088  const EntityHandle second = p_eit->second;
1089  const auto lo_uid =
1090  FieldEntity::getLoLocalEntityBitNumber(bit_number, first);
1091  const auto hi_uid =
1092  FieldEntity::getHiLocalEntityBitNumber(bit_number, second);
1093 
1094  auto feit = entsFields.get<Unique_mi_tag>().lower_bound(lo_uid);
1095  if (feit == entsFields.get<Unique_mi_tag>().end())
1096  continue;
1097  auto hi_feit = entsFields.get<Unique_mi_tag>().upper_bound(hi_uid);
1098 
1099  // If there are DOFs in that range is more pragmatic to remove them
1100  // rather than to find sub-ranges or make them inactive
1101  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(lo_uid);
1102  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(hi_uid);
1103  dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1104 
1105  // Add vertices DOFs by bulk
1106  boost::shared_ptr<std::vector<DofEntity>> dofs_array =
1107  boost::make_shared<std::vector<DofEntity>>(std::vector<DofEntity>());
1108  // Add Sequence of DOFs to sequence container as weak_ptr
1109  int nb_dofs_on_ents = 0;
1110  for (auto tmp_feit = feit; tmp_feit != hi_feit; ++tmp_feit) {
1111  nb_dofs_on_ents += rank * tmp_feit->get()->getOrderNbDofs(
1112  tmp_feit->get()->getMaxOrder());
1113  }
1114 
1115  // Reserve memory
1116  dofs_array->reserve(nb_dofs_on_ents);
1117 
1118  // Create DOFs
1119  for (; feit != hi_feit; ++feit) {
1120  // Create dofs instances and shared pointers
1121  int DD = 0;
1122  // Loop orders (loop until max entity order is set)
1123  for (int oo = 0; oo <= feit->get()->getMaxOrder(); ++oo) {
1124  // Loop nb. dofs at order oo
1125  for (int dd = 0; dd < feit->get()->getOrderNbDofsDiff(oo); ++dd) {
1126  // Loop rank
1127  for (int rr = 0; rr < rank; ++rr, ++DD) {
1128  dofs_array->emplace_back(*feit, oo, rr, DD);
1129  ++dof_counter[feit->get()->getEntType()];
1130  }
1131  }
1132  }
1133  if (DD > feit->get()->getNbDofsOnEnt()) {
1134  std::ostringstream ss;
1135  ss << "rank " << rAnk << " ";
1136  ss << **feit << std::endl;
1137  SETERRQ3(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1138  "Expected number of DOFs on entity not equal to number added "
1139  "to database (DD = %d != %d = "
1140  "feit->get()->getNbDofsOnEnt())\n"
1141  "%s",
1142  DD, feit->get()->getNbDofsOnEnt(), ss.str().c_str());
1143  }
1144  }
1145 
1146  // Insert into Multi-Index container
1147  int dofs_field_size0 = dofsField.size();
1148  auto hint = dofsField.end();
1149  for (auto &v : *dofs_array)
1150  hint = dofsField.emplace_hint(hint, dofs_array, &v);
1151 
1152  // Add Sequence of DOFs to sequence container as weak_ptr
1153  field_it->get()->getDofSequenceContainer().push_back(dofs_array);
1154 
1155  // Check data consistency
1156  if (PetscUnlikely(static_cast<int>(dofs_array.use_count()) !=
1157  static_cast<int>(dofs_array->size() + 1))) {
1158  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1159  "Wrong use count %d != %d", dofs_array.use_count(),
1160  dofs_array->size() + 1);
1161  }
1162  if (dofs_field_size0 + dofs_array->size() != dofsField.size()) {
1163  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1164  "Wrong number of inserted DOFs %d != %d", dofs_array->size(),
1165  dofsField.size() - dofs_field_size0);
1166  }
1167  }
1169 }
static UId getHiLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
moab::Interface & get_moab()
Definition: Core.hpp:319
static UId getLoLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
int verbose
Verbosity level.
Definition: Core.hpp:1006
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
int rAnk
MOFEM communicator rank.
Definition: Core.hpp:969
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:301
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:302

◆ buildFieldForNoField()

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

Definition at line 1034 of file FieldCore.cpp.

1035  {
1037 
1038  if (verb == -1)
1039  verb = verbose;
1040 
1041  // find fields
1042  auto field_it = fIelds.get<BitFieldId_mi_tag>().find(id);
1043  if (field_it == fIelds.get<BitFieldId_mi_tag>().end())
1044  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "Field not found");
1045 
1046  if (verb > QUIET)
1047  MOFEM_LOG("WORLD", Sev::noisy)
1048  << "Field " << (*field_it)->getName() << " core value < "
1049  << this->getValue() << " > field value () "
1050  << (*field_it)->getBitNumber() << " )";
1051 
1052  CHKERR this->buildFieldForNoFieldImpl(*field_it, dof_counter, verb);
1053 
1055 }
MoFEMErrorCode buildFieldForNoFieldImpl(boost::shared_ptr< Field > field_ptr, std::map< EntityType, int > &dof_counter, int verb)
Definition: FieldCore.cpp:929
#define FieldCoreFunctionBegin
Definition: FieldCore.cpp:21
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define CHKERR
Inline error check.
Definition: definitions.h:604
const int getValue() const
Get the core.
Definition: Core.hpp:80
Field_multiIndex fIelds
fields
Definition: Core.hpp:300

◆ buildFieldForNoFieldImpl()

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

Definition at line 929 of file FieldCore.cpp.

931  {
933 
934  const auto bit_number = field_ptr->getBitNumber();
935 
936  // ents in the field meshset
937  Range ents;
938  CHKERR get_moab().get_entities_by_handle(field_ptr->getMeshset(), ents,
939  false);
940  if (verb > VERBOSE)
941  MOFEM_LOG_C("SYNC", Sev::noisy, "Ents in field %s meshset %d\n",
942  field_ptr->getName().c_str(), ents.size());
943 
944  // ent view by field id (in set all MoabEnts has the same FieldId)
945  auto eiit = entsFields.get<Unique_mi_tag>().lower_bound(
946  FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
947  FieldEntity_multiIndex_ent_view ents_id_view;
948  if (eiit != entsFields.get<Unique_mi_tag>().end()) {
949  auto hi_eiit = entsFields.get<Unique_mi_tag>().upper_bound(
950  FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
951  std::copy(eiit, hi_eiit, std::back_inserter(ents_id_view));
952  }
953 
954  boost::shared_ptr<const int> zero_order(new const int(0));
955 
956  for (auto ent : ents) {
957  // search if field meshset is in database
958  auto ref_ent_it = refinedEntities.get<Ent_mi_tag>().find(ent);
959  if (ref_ent_it == refinedEntities.get<Ent_mi_tag>().end())
960  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
961  "Entity is not in MoFEM database, entities in field meshset need "
962  "to be seeded (i.e. bit ref level add to them)");
963 
964  auto add_dofs = [&](auto field_eit) {
966  // create dofs on this entity (nb. of dofs is equal to rank)
967  for (FieldCoefficientsNumber rank = 0; rank < field_ptr->getNbOfCoeffs();
968  rank++) {
969  // insert dof
970  auto p = dofsField.insert(
971  boost::make_shared<DofEntity>(field_eit, 0, rank, rank));
972  if (p.second) {
973  dof_counter[MBENTITYSET]++; // Count entities in the meshset
974  } else
975  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
976  "Dof expected to be created");
977  }
979  };
980 
981  // create database entity
982  auto field_ent_it = ents_id_view.get<1>().find(ent);
983  if (field_ent_it == ents_id_view.get<1>().end()) {
984 
985  auto p = entsFields.insert(
986 
987  boost::make_shared<FieldEntity>(
988  field_ptr, *ref_ent_it,
990  *ref_ent_it),
991  boost::shared_ptr<const int>(zero_order, zero_order.get()))
992 
993  );
994 
995  if ((*p.first)->getFieldRawPtr() != field_ptr.get())
996  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
997  "Get field ent poiter and field pointer do not match for "
998  "field %s",
999  field_ptr->getName().c_str());
1000 
1001  if (!p.second)
1002  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1003  "Entity should be created");
1004 
1005  CHKERR add_dofs(*(p.first));
1006 
1007  } else {
1008 
1009  // If there are DOFs in that range is more pragmatic to remove them
1010  // rather than to find sub-ranges or make them inactive
1011  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(
1012  FieldEntity::getLoLocalEntityBitNumber(bit_number, ent));
1013  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(
1014  FieldEntity::getHiLocalEntityBitNumber(bit_number, ent));
1015  dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1016  CHKERR add_dofs(*field_ent_it);
1017  }
1018  }
1019 
1020  if (verb > VERBOSE) {
1021  auto lo_dof = dofsField.get<Unique_mi_tag>().lower_bound(
1022  FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
1023  auto hi_dof = dofsField.get<Unique_mi_tag>().upper_bound(
1024  FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
1025  for (; lo_dof != hi_dof; lo_dof++)
1026  MOFEM_LOG("SYNC", Sev::noisy) << **lo_dof;
1028  }
1029 
1031 }
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
static UId getHiLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
moab::Interface & get_moab()
Definition: Core.hpp:319
#define FieldCoreFunctionBegin
Definition: FieldCore.cpp:21
static Index< 'p', 3 > p
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
static UId getLoLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:306
RefEntity_multiIndex refinedEntities
refined entities
Definition: Core.hpp:297
#define CHKERR
Inline error check.
Definition: definitions.h:604
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.
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
int FieldCoefficientsNumber
Number of field coefficients.
Definition: Types.hpp:38
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:301
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:302
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:340

◆ buildFiniteElements()

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

Definition at line 505 of file FECore.cpp.

506  {
508  if (verb == DEFAULT_VERBOSITY)
509  verb = verbose;
510 
511  if (verb > QUIET)
512  MOFEM_LOG("SYNC", Sev::verbose)
513  << "Build Finite Elements " << fe->getName();
514 
515  auto &fields_by_id = fIelds.get<BitFieldId_mi_tag>();
516 
517  // Get id of mofem fields for row, col and data
518  enum IntLoop { ROW = 0, COL, DATA, LAST };
519  std::array<BitFieldId, LAST> fe_fields = {fe.get()->getBitFieldIdRow(),
520  fe.get()->getBitFieldIdCol(),
521  fe.get()->getBitFieldIdData()};
522 
523  // Get finite element meshset
524  EntityHandle meshset = get_finite_element_meshset(fe.get()->getId());
525 
526  // Get entities from finite element meshset // if meshset
527  Range fe_ents;
528  CHKERR get_moab().get_entities_by_handle(meshset, fe_ents, false);
529 
530  if (ents_ptr)
531  fe_ents = intersect(fe_ents, *ents_ptr);
532 
533  // Map entity uid to pointers
534  typedef std::vector<boost::weak_ptr<EntFiniteElement>> VecOfWeakFEPtrs;
535  typedef std::map<const UId *, VecOfWeakFEPtrs> MapEntUIdAndVecOfWeakFEPtrs;
536  MapEntUIdAndVecOfWeakFEPtrs ent_uid_and_fe_vec;
537  VecOfWeakFEPtrs processed_fes;
538  processed_fes.reserve(fe_ents.size());
539 
540  int last_data_field_ents_view_size = 0;
541  int last_row_field_ents_view_size = 0;
542  int last_col_field_ents_view_size = 0;
543 
544  // Loop meshset finite element ents and add finite elements
545  for (Range::const_pair_iterator peit = fe_ents.const_pair_begin();
546  peit != fe_ents.const_pair_end(); peit++) {
547 
548  const auto first = peit->first;
549  const auto second = peit->second;
550 
551  // Find range of ref entities that is sequence
552  // note: iterator is a wrapper
553  // check if is in refinedFiniteElements database
554  auto ref_fe_miit =
555  refinedFiniteElements.get<Ent_mi_tag>().lower_bound(first);
556  if (ref_fe_miit == refinedFiniteElements.get<Ent_mi_tag>().end()) {
557  std::ostringstream ss;
558  ss << "refinedFiniteElements not in database ent = " << first;
559  ss << " type " << get_moab().type_from_handle(first);
560  ss << " " << *fe;
561  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, ss.str().c_str());
562  }
563  auto hi_ref_fe_miit =
564  refinedFiniteElements.get<Ent_mi_tag>().upper_bound(second);
565 
566  EntFiniteElement_multiIndex::iterator hint_p = entsFiniteElements.end();
567  for (; ref_fe_miit != hi_ref_fe_miit; ref_fe_miit++) {
568 
569  // Add finite element to database
570  hint_p = entsFiniteElements.emplace_hint(
571  hint_p, boost::make_shared<EntFiniteElement>(*ref_fe_miit, fe));
572  processed_fes.emplace_back(*hint_p);
573  auto fe_raw_ptr = hint_p->get();
574 
575  // Allocate space for etities view
576  bool row_as_data = false, col_as_row = false;
577  if (fe_fields[DATA] == fe_fields[ROW])
578  row_as_data = true;
579  if (fe_fields[ROW] == fe_fields[COL])
580  col_as_row = true;
581 
582  fe_raw_ptr->getDataFieldEntsPtr()->reserve(
583  last_data_field_ents_view_size);
584 
585  if (row_as_data) {
586  fe_raw_ptr->getRowFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
587  } else {
588  // row and col are diffent
589  if (fe_raw_ptr->getRowFieldEntsPtr() ==
590  fe_raw_ptr->getDataFieldEntsPtr())
591  fe_raw_ptr->getRowFieldEntsPtr() =
592  boost::make_shared<FieldEntity_vector_view>();
593  fe_raw_ptr->getRowFieldEntsPtr()->reserve(
594  last_row_field_ents_view_size);
595  }
596 
597  if (row_as_data && col_as_row) {
598  fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
599  } else if (col_as_row) {
600  fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getRowFieldEntsPtr();
601  } else {
602  if (
603 
604  fe_raw_ptr->getColFieldEntsPtr() ==
605  fe_raw_ptr->getRowFieldEntsPtr() ||
606  fe_raw_ptr->getColFieldEntsPtr() ==
607  fe_raw_ptr->getDataFieldEntsPtr()
608 
609  )
610  fe_raw_ptr->getColFieldEntsPtr() =
611  boost::make_shared<FieldEntity_vector_view>();
612  fe_raw_ptr->getColFieldEntsPtr()->reserve(
613  last_col_field_ents_view_size);
614  }
615 
616  // Iterate over all field and check which one is on the element
617  for (unsigned int ii = 0; ii != BitFieldId().size(); ++ii) {
618 
619  // Common field id for ROW, COL and DATA
620  BitFieldId id_common = 0;
621  // Check if the field (ii) is added to finite element
622  for (int ss = 0; ss < LAST; ss++) {
623  id_common |= fe_fields[ss] & BitFieldId().set(ii);
624  }
625  if (id_common.none())
626  continue;
627 
628  // Find in database data associated with the field (ii)
629  const BitFieldId field_id = BitFieldId().set(ii);
630  auto miit = fields_by_id.find(field_id);
631  if (miit == fields_by_id.end())
632  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Field not found");
633  auto field_bit_number = (*miit)->getBitNumber();
634 
635  // Loop over adjacencies of element and find field entities on those
636  // adjacencies, that create hash map map_uid_fe which is used later
637  const std::string field_name = miit->get()->getName();
638  const bool add_to_data = (field_id & fe_fields[DATA]).any();
639  const bool add_to_row = (field_id & fe_fields[ROW]).any();
640  const bool add_to_col = (field_id & fe_fields[COL]).any();
641 
642  // Entities adjacent to entities
643  Range adj_ents;
644 
645  // Resolve entities on element, those entities are used to build tag
646  // with dof uids on finite element tag
647  CHKERR fe_raw_ptr->getElementAdjacency(*miit, adj_ents);
648 
649  for (Range::pair_iterator p_eit = adj_ents.pair_begin();
650  p_eit != adj_ents.pair_end(); ++p_eit) {
651 
652  const EntityHandle first = p_eit->first;
653  const EntityHandle second = p_eit->second;
654 
656  FieldEntityByComposite;
657  auto &field_ents_by_name_and_ent = entsFields.get<Unique_mi_tag>();
658  FieldEntityByComposite::iterator meit;
659 
660  const auto lo_uid =
661  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, first);
662 
663  // If one entity in the pair search for one, otherwise search for
664  // range
665  if (first == second)
666  meit = field_ents_by_name_and_ent.find(lo_uid);
667  else
668  meit = field_ents_by_name_and_ent.lower_bound(lo_uid);
669 
670  if (meit != field_ents_by_name_and_ent.end()) {
671 
672  decltype(meit) hi_meit;
673 
674  if (first == second) {
675  hi_meit = meit;
676  ++hi_meit;
677  } else
678  hi_meit = field_ents_by_name_and_ent.upper_bound(
680  second));
681 
682  // Add to view and create list of finite elements with this dof UId
683  for (; meit != hi_meit; ++meit) {
684  // Add entity to map with key entity uids pointers and data
685  // finite elements weak ptrs. I using pointers to uids instead
686  // uids because this is faster.
687  const UId *uid_ptr = &(meit->get()->getLocalUniqueId());
688  auto &fe_vec = ent_uid_and_fe_vec[uid_ptr];
689  if (add_to_data) {
690  fe_raw_ptr->getDataFieldEntsPtr()->emplace_back(*meit);
691  }
692  if (add_to_row && !row_as_data) {
693  fe_raw_ptr->getRowFieldEntsPtr()->emplace_back(*meit);
694  }
695  if (add_to_col && !col_as_row) {
696  fe_raw_ptr->getColFieldEntsPtr()->emplace_back(*meit);
697  }
698 
699  // add finite element to processed list
700  fe_vec.emplace_back(*hint_p);
701  }
702  }
703  }
704  }
705 
706  // Sort field ents by uid
707  auto uid_comp = [](const auto &a, const auto &b) {
708  return a.lock()->getLocalUniqueId() < b.lock()->getLocalUniqueId();
709  };
710 
711  // Sort all views
712 
713  // Data
714  sort(fe_raw_ptr->getDataFieldEntsPtr()->begin(),
715  fe_raw_ptr->getDataFieldEntsPtr()->end(), uid_comp);
716  last_data_field_ents_view_size =
717  fe_raw_ptr->getDataFieldEntsPtr()->size();
718 
719  // Row
720  if (!row_as_data) {
721  sort(fe_raw_ptr->getRowFieldEntsPtr()->begin(),
722  fe_raw_ptr->getRowFieldEntsPtr()->end(), uid_comp);
723  last_row_field_ents_view_size =
724  fe_raw_ptr->getRowFieldEntsPtr()->size();
725  }
726 
727  // Column
728  if (!col_as_row) {
729  sort(fe_raw_ptr->getColFieldEntsPtr()->begin(),
730  fe_raw_ptr->getColFieldEntsPtr()->end(), uid_comp);
731  last_col_field_ents_view_size =
732  fe_raw_ptr->getColFieldEntsPtr()->size();
733  }
734 
735  }
736  }
737 
738  auto &dofs_by_ent_uid = dofsField.get<Unique_mi_tag>();
739 
741 }
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:298
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:305
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define FECoreFunctionBegin
Definition: FECore.cpp:21
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
#define CHKERR
Inline error check.
Definition: definitions.h:604
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:259
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:301
uint128_t UId
Unique Id.
Definition: Types.hpp:42
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:302

◆ 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 759 of file ProblemsCore.cpp.

760  {
762 
763  if (auto cache_ptr = cache_weak_ptr.lock()) {
764  auto p_miit = pRoblems.get<Problem_mi_tag>().find(prb_name);
765  if (p_miit == pRoblems.get<Problem_mi_tag>().end())
766  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND, "problem not in database %s",
767  prb_name.c_str());
768 
769  const BitRefLevel prb_bit = p_miit->getBitRefLevel();
770  const BitRefLevel prb_mask = p_miit->getMaskBitRefLevel();
771  const BitFEId prb_fe_id = p_miit->getBitFEId();
772 
773  auto &row_dofs = p_miit->numeredRowDofsPtr;
774  auto &col_dofs = p_miit->numeredColDofsPtr;
775 
776  auto &cache_data = std::get<0>(*cache_ptr);
777  auto &cache_row = std::get<1>(*cache_ptr);
778  auto &cache_col = std::get<2>(*cache_ptr);
779 
780  cache_row.resize(entsFields.size());
781  if (row_dofs != col_dofs)
782  cache_col.resize(entsFields.size());
783  cache_data.resize(entsFields.size());
784 
785  size_t idx = 0;
786  for (auto it = entsFields.begin(); it != entsFields.end(); ++it, ++idx) {
787 
788  const auto uid = (*it)->getLocalUniqueId();
789  auto r = entFEAdjacencies.get<Unique_mi_tag>().equal_range(uid);
790  for (auto lo = r.first; lo != r.second; ++lo) {
791 
792  if ((lo->getBitFEId() & prb_fe_id).any()) {
793 
794  const BitRefLevel fe_bit = lo->entFePtr->getBitRefLevel();
795 
796  // if entity is not problem refinement level
797  if (((fe_bit & prb_mask) != fe_bit) ||
798  ((fe_bit & prb_bit) != prb_bit))
799  continue;
800 
801  auto cache_numered_dofs = [&](auto &numered_dofs, auto &cache_vec,
802  auto &ent_cache) {
803  auto dit = numered_dofs->lower_bound(uid);
804  decltype(dit) hi_dit;
805  if (dit != numered_dofs->end())
806  hi_dit = numered_dofs->upper_bound(
807  uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
808  else
809  hi_dit = dit;
810 
811  ent_cache = boost::shared_ptr<EntityCacheNumeredDofs>(
812  cache_ptr, &(cache_vec[idx]));
813  cache_vec[idx].loHi = {dit, hi_dit};
814  };
815 
816  auto cache_dofs = [&](auto &dofs, auto &cache_vec, auto &ent_cache) {
817  auto dit = dofs.lower_bound(uid);
818  decltype(dit) hi_dit;
819  if (dit != dofs.end())
820  hi_dit = dofs.upper_bound(
821  uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
822  else
823  hi_dit = dit;
824 
825  ent_cache = boost::shared_ptr<EntityCacheDofs>(cache_ptr,
826  &(cache_vec[idx]));
827  cache_vec[idx].loHi = {dit, hi_dit};
828  };
829 
830  cache_numered_dofs(row_dofs, cache_row, (*it)->entityCacheRowDofs);
831  if (row_dofs != col_dofs) {
832  if (cache_col.size() != entsFields.size())
833  cache_col.resize(entsFields.size());
834  cache_numered_dofs(col_dofs, cache_col, (*it)->entityCacheColDofs);
835  } else {
836  (*it)->entityCacheColDofs = (*it)->entityCacheRowDofs;
837  }
838 
839  cache_dofs(dofsField, cache_data, (*it)->entityCacheDataDofs);
840 
841  break;
842  }
843  }
844  }
845  } else {
846  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Cache not allocated");
847  }
848 
850 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:310
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
#define ProblemCoreFunctionBegin
const double r
rate factor
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:305
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:308
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:301
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:302

◆ 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 61 of file FieldCore.cpp.

61  {
62  auto &set = fIelds.get<FieldName_mi_tag>();
63  auto miit = set.find(name);
64  if (miit == set.end())
65  return false;
66  return true;
67 }
Field_multiIndex fIelds
fields
Definition: Core.hpp:300

◆ 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 31 of file FECore.cpp.

31  {
33  FeSetByName;
34  const FeSetByName &set = finiteElements.get<FiniteElement_name_mi_tag>();
35  FeSetByName::iterator miit = set.find(name);
36  if (miit == set.end())
37  return false;
38  return true;
39 }
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:304

◆ check_number_of_ents_in_ents_field() [1/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 1384 of file FieldCore.cpp.

1384  {
1386  auto it = fIelds.get<FieldName_mi_tag>().find(name);
1387  if (it == fIelds.get<FieldName_mi_tag>().end()) {
1388  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1389  "field not found < %s >", name.c_str());
1390  }
1391  EntityHandle meshset = (*it)->getMeshset();
1392  int num_entities;
1393  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1394 
1395  auto count_field_ents = [&]() {
1396  auto bit_number = (*it)->getBitNumber();
1397  auto low_eit = entsFields.get<Unique_mi_tag>().lower_bound(
1398  FieldEntity::getLoBitNumberUId(bit_number));
1399  auto hi_eit = entsFields.get<Unique_mi_tag>().upper_bound(
1400  FieldEntity::getHiBitNumberUId(bit_number));
1401  return std::distance(low_eit, hi_eit);
1402  };
1403 
1404  if (count_field_ents() > (unsigned int)num_entities) {
1405  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1406  "not equal number of entities in meshset and field multiindex "
1407  "< %s >",
1408  name.c_str());
1409  }
1411 }
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
#define CHKERR
Inline error check.
Definition: definitions.h:604
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:301
static UId getHiBitNumberUId(const FieldBitNumber bit_number)

◆ check_number_of_ents_in_ents_field() [2/2]

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

check data consistency in entitiesPtr

Implements MoFEM::CoreInterface.

Definition at line 1412 of file FieldCore.cpp.

1412  {
1414  for (auto &it : fIelds.get<FieldName_mi_tag>()) {
1415  if (it->getSpace() == NOFIELD)
1416  continue; // FIXME: should be treated properly, not test is just
1417  // skipped for this NOFIELD space
1418  EntityHandle meshset = it->getMeshset();
1419  int num_entities;
1420  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1421 
1422  auto count_field_ents = [&]() {
1423  auto bit_number = it->getBitNumber();
1424  auto low_eit = entsFields.get<Unique_mi_tag>().lower_bound(
1425  FieldEntity::getLoBitNumberUId(bit_number));
1426  auto hi_eit = entsFields.get<Unique_mi_tag>().upper_bound(
1427  FieldEntity::getHiBitNumberUId(bit_number));
1428  return std::distance(low_eit, hi_eit);
1429  };
1430 
1431  if (count_field_ents() > (unsigned int)num_entities) {
1432  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1433  "not equal number of entities in meshset and field "
1434  "multiindex < %s >",
1435  it->getName().c_str());
1436  }
1437  }
1439 }
moab::Interface & get_moab()
Definition: Core.hpp:319
scalar or vector of scalars describe (no true field)
Definition: definitions.h:176
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
Field_multiIndex fIelds
fields
Definition: Core.hpp:300
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:301
static UId getHiBitNumberUId(const FieldBitNumber bit_number)

◆ check_number_of_ents_in_ents_finite_element() [1/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 929 of file FECore.cpp.

930  {
932  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
933  it = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
934  if (it == finiteElements.get<FiniteElement_name_mi_tag>().end()) {
935  SETERRQ1(cOmm, 1, "finite element not found < %s >", name.c_str());
936  }
937  EntityHandle meshset = (*it)->getMeshset();
938 
939  int num_entities;
940  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
941 
942  if (entsFiniteElements.get<FiniteElement_name_mi_tag>().count(
943  (*it)->getName().c_str()) != (unsigned int)num_entities) {
944  SETERRQ1(cOmm, 1,
945  "not equal number of entities in meshset and finite elements "
946  "multiindex < %s >",
947  (*it)->getName().c_str());
948  }
950 }
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:304
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:305
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965

◆ check_number_of_ents_in_ents_finite_element() [2/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 952 of file FECore.cpp.

952  {
954  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
955  it = finiteElements.get<FiniteElement_name_mi_tag>().begin();
956  for (; it != finiteElements.get<FiniteElement_name_mi_tag>().end(); it++) {
957  EntityHandle meshset = (*it)->getMeshset();
958 
959  int num_entities;
960  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
961 
962  if (entsFiniteElements.get<FiniteElement_name_mi_tag>().count(
963  (*it)->getName().c_str()) != (unsigned int)num_entities) {
964  SETERRQ1(cOmm, 1,
965  "not equal number of entities in meshset and finite elements "
966  "multiindex < %s >",
967  (*it)->getName().c_str());
968  }
969  }
971 }
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:304
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:305
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
MPI_Comm cOmm
MoFEM communicator.
Definition: Core.hpp:965

◆ check_problem()

bool MoFEM::Core::check_problem ( const std::string  name)
protectedvirtual

check if problem exist

Parameters
nameproblem name
Returns
true if problem is in database

Implements MoFEM::CoreInterface.

Definition at line 31 of file ProblemsCore.cpp.

31  {
32  Problem_multiIndex::index<Problem_mi_tag>::type::iterator pit;
33  pit = pRoblems.get<Problem_mi_tag>().find(name);
34  if (pit == pRoblems.get<Problem_mi_tag>().end()) {
35  return false;
36  }
37  return true;
38 }
Problem_multiIndex pRoblems
problems multi-index
Definition: Core.hpp:310

◆ 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 214 of file DeleteCore.cpp.

216  {
218  if (verb == -1)
219  verb = verbose;
220  Range ents;
221  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
224 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
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:214
int verbose
Verbosity level.
Definition: Core.hpp:1006
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

◆ 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 226 of file DeleteCore.cpp.

226  {
228  if (verb == -1)
229  verb = verbose;
230  for (Range::const_pair_iterator p_eit = ents.pair_begin();
231  p_eit != ents.pair_end(); ++p_eit) {
232  const EntityHandle first = p_eit->first;
233  const EntityHandle second = p_eit->second;
234  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
235  Ent_mi_tag>::type::iterator ait,
236  hi_ait;
237  ait = entFEAdjacencies.get<Ent_mi_tag>().lower_bound(first);
238  hi_ait = entFEAdjacencies.get<Ent_mi_tag>().upper_bound(second);
239  entFEAdjacencies.get<Ent_mi_tag>().erase(ait, hi_ait);
240  }
242 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
int verbose
Verbosity level.
Definition: Core.hpp:1006
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:308

◆ 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 244 of file DeleteCore.cpp.

245  {
247  if (verb == -1)
248  verb = verbose;
249 
250  const Field *field_ptr = get_field_structure(name);
251  int field_bit_number = field_ptr->getBitNumber();
252  ParallelComm *pcomm =
253  ParallelComm::get_pcomm(&get_moab(), basicEntityDataPtr->pcommID);
254 
255  for (Range::const_pair_iterator p_eit = ents.pair_begin();
256  p_eit != ents.pair_end(); p_eit++) {
257 
258  // First and last handle
259  const EntityHandle first = p_eit->first;
260  const EntityHandle second = p_eit->second;
261 
262  // Get UId
263  UId first_uid =
264  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, first);
265  UId second_uid =
266  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, second);
267 
268  // Find adjacencies
269  auto ait = entFEAdjacencies.get<Unique_mi_tag>().lower_bound(first_uid);
270  auto hi_ait = entFEAdjacencies.get<Unique_mi_tag>().upper_bound(second_uid);
271  entFEAdjacencies.get<Unique_mi_tag>().erase(ait, hi_ait);
272  }
274 }
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
moab::Interface & get_moab()
Definition: Core.hpp:319
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
int verbose
Verbosity level.
Definition: Core.hpp:1006
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:278
const Field * get_field_structure(const std::string &name)
get field structure
Definition: FieldCore.cpp:69
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:308
uint128_t UId
Unique Id.
Definition: Types.hpp:42

◆ 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