|
| v0.14.0
|
Core (interface) class.
More...
#include <src/interfaces/Core.hpp>
|
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 () |
|
virtual DEPRECATED MoFEMErrorCode | seed_ref_level_2D (const EntityHandle meshset, const BitRefLevel &bit, int verb=-1) |
| seed 2D entities (Triangles entities only) in the meshset and their adjacencies (only TRIs adjacencies) in a particular BitRefLevel More...
|
|
DEPRECATED MoFEMErrorCode | seed_ref_level_3D (const EntityHandle meshset, const BitRefLevel &bit, int verb=-1) |
| seed 2D entities in the meshset and their adjacencies (only TETs adjacencies) in a particular BitRefLevel More...
|
|
DEPRECATED MoFEMErrorCode | seed_ref_level (const Range &ents, const BitRefLevel &bit, const bool only_tets=true, int verb=-1) |
| seed entities in the range and their adjacencies in a particular BitRefLevel More...
|
|
DEPRECATED MoFEMErrorCode | partition_mesh (const Range &ents, const int dim, const int adj_dim, const int n_parts, int verb=-1) |
| Set partition tag to each finite element in the problem. More...
|
|
DEPRECATED MoFEMErrorCode | synchronise_entities (Range &ent, int verb=DEFAULT_VERBOSITY) |
|
DEPRECATED MoFEMErrorCode | synchronise_field_entities (const std::string &name, int verb=DEFAULT_VERBOSITY) |
|
virtual | ~CoreInterface ()=default |
|
virtual MoFEMErrorCode | add_broken_field (const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const std::vector< std::pair< EntityType, std::function< MoFEMErrorCode(BaseFunction::DofsSideMap &)>> > list_dof_side_map, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0 |
| Add field. More...
|
|
template<class IFACE > |
MoFEMErrorCode | registerInterface (bool error_if_registration_failed=true) |
| Register interface. More...
|
|
template<class IFACE > |
MoFEMErrorCode | getInterface (IFACE *&iface) const |
| Get interface reference to pointer of interface. More...
|
|
template<class IFACE > |
MoFEMErrorCode | getInterface (IFACE **const iface) const |
| Get interface pointer to pointer of interface. More...
|
|
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0> |
IFACE | getInterface () const |
| Get interface pointer to pointer of interface. More...
|
|
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0> |
IFACE | getInterface () const |
| Get reference to interface. More...
|
|
template<class IFACE > |
IFACE * | getInterface () const |
| Function returning pointer to interface. More...
|
|
virtual | ~UnknownInterface ()=default |
|
|
static constexpr int | value = 0 |
|
|
MoFEMErrorCode | remove_parents_by_ents (const Range &ents, int verb=DEFAULT_VERBOSITY) |
| Remove parents from entities. More...
|
|
MoFEMErrorCode | remove_parents_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY) |
| Remove parent from entities on bit level. More...
|
|
MoFEMErrorCode | remove_parents_by_parents (const Range &ents, int verb=DEFAULT_VERBOSITY) |
| Remove paremts from entities having parents in passed range. More...
|
|
MoFEMErrorCode | remove_ents (const Range ents, int verb=DEFAULT_VERBOSITY) |
| remove entities form mofem database More...
|
|
MoFEMErrorCode | remove_ents_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY) |
| remove entities form mofem database More...
|
|
MoFEMErrorCode | delete_ents_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, const bool remove_parent=false, int verb=DEFAULT_VERBOSITY, MoFEMTypes mf=MF_ZERO) |
| delete entities form mofem and moab database More...
|
|
|
virtual MoFEMErrorCode | add_broken_field (const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_coefficients, std::vector< std::pair< EntityType, std::function< MoFEMErrorCode(BaseFunction::DofsSideMap &)> >> list_dof_side_map, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY) |
| Add field. More...
|
|
virtual MoFEMErrorCode | add_field (const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY) |
| Add field. More...
|
|
MoFEMErrorCode | delete_field (const std::string name, int verb=DEFAULT_VERBOSITY) |
| Delete field. More...
|
|
MoFEMErrorCode | addField (const std::string &name, const FieldSpace space, const FieldContinuity continuity, const FieldApproximationBase base, const FieldCoefficientsNumber nb_coefficients, const TagType tag_type, const enum MoFEMTypes bh, int verb) |
| Template for add_field. More...
|
|
MoFEMErrorCode | addEntsToFieldByDim (const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY) |
|
MoFEMErrorCode | add_ents_to_field_by_dim (const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY) |
| Add entities to field meshset. More...
|
|
MoFEMErrorCode | add_ents_to_field_by_type (const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY) |
| Add entities to field meshset. More...
|
|
MoFEMErrorCode | add_ents_to_field_by_dim (const EntityHandle meshset, const int dim, const std::string &name, const bool recursive=true, int verb=DEFAULT_VERBOSITY) |
| Add entities to field meshset. More...
|
|
MoFEMErrorCode | add_ents_to_field_by_type (const EntityHandle meshset, const EntityType type, const std::string &name, const bool recursive=true, int verb=DEFAULT_VERBOSITY) |
| Add entities to field meshset. More...
|
|
MoFEMErrorCode | create_vertices_and_add_to_field (const std::string name, const double coords[], int size, int verb=DEFAULT_VERBOSITY) |
| Create a vertices and add to field object. More...
|
|
|
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...
|
|
|
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...
|
|
|
const FiniteElement * | get_finite_element_structure (const std::string &name, enum MoFEMTypes bh=MF_EXCL) const |
| get finite element struture More...
|
|
bool | check_finite_element (const std::string &name) const |
| Check if finite element is in database. More...
|
|
MoFEMErrorCode | add_finite_element (const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY) |
| add finite element More...
|
|
MoFEMErrorCode | modify_finite_element_adjacency_table (const std::string &fe_name, const EntityType type, ElementAdjacencyFunct function) |
| modify finite element table, only for advanced user More...
|
|
MoFEMErrorCode | modify_finite_element_add_field_data (const std::string &fe_name, const std::string name_filed) |
| set finite element field data More...
|
|
MoFEMErrorCode | modify_finite_element_add_field_row (const std::string &fe_name, const std::string name_row) |
| set field row which finite element use More...
|
|
MoFEMErrorCode | modify_finite_element_add_field_col (const std::string &fe_name, const std::string name_col) |
| set field col which finite element use More...
|
|
MoFEMErrorCode | modify_finite_element_off_field_data (const std::string &fe_name, const std::string name_filed) |
| unset finite element field data More...
|
|
MoFEMErrorCode | modify_finite_element_off_field_row (const std::string &fe_name, const std::string name_row) |
| unset field row which finite element use More...
|
|
MoFEMErrorCode | modify_finite_element_off_field_col (const std::string &fe_name, const std::string name_col) |
| unset field col which finite element use More...
|
|
MoFEMErrorCode | add_ents_to_finite_element_by_type (const EntityHandle meshset, const EntityType type, const std::string &name, const bool recursive=true) |
| add entities to finite element More...
|
|
MoFEMErrorCode | add_ents_to_finite_element_by_dim (const EntityHandle meshset, const int dim, const std::string &name, const bool recursive=true) |
| add entities to finite element More...
|
|
MoFEMErrorCode | add_ents_to_finite_element_by_type (const Range &ents, const EntityType type, const std::string &name) |
| add entities to finite elements More...
|
|
MoFEMErrorCode | add_ents_to_finite_element_by_dim (const Range &ents, const int dim, const std::string &name) |
| add entities to finite elements More...
|
|
MoFEMErrorCode | add_ents_to_finite_element_by_bit_ref (const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY) |
| add TET entities from given refinement level to finite element database given by name More...
|
|
MoFEMErrorCode | add_ents_to_finite_element_by_MESHSET (const EntityHandle meshset, const std::string &name, const bool recursive=false) |
| add MESHSET element to finite element database given by name More...
|
|
DEPRECATED MoFEMErrorCode | add_ents_to_finite_element_EntType_by_bit_ref (const BitRefLevel &bit, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY) |
|
DEPRECATED MoFEMErrorCode | add_ents_to_finite_element_EntType_by_bit_ref (const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY) |
|
MoFEMErrorCode | remove_ents_from_finite_element_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY) |
| remove elements from given refinement level to finite element database More...
|
|
MoFEMErrorCode | remove_ents_from_finite_element (const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY) |
| remove entities from given refinement level to finite element database More...
|
|
MoFEMErrorCode | remove_ents_from_finite_element (const std::string name, const Range ents, int verb=DEFAULT_VERBOSITY) |
| remove entities from finite element database More...
|
|
MoFEMErrorCode | remove_ents_from_finite_element (const Range ents, int verb=DEFAULT_VERBOSITY) |
| remove entities from finite elements in database More...
|
|
MoFEMErrorCode | delete_finite_element (const std::string name, int verb=DEFAULT_VERBOSITY) |
| delete finite element from mofem database More...
|
|
BitFEId | getBitFEId (const std::string &fe_name) const |
| Get field Id. More...
|
|
std::string | getBitFEIdName (const BitFEId id) const |
| Get field name. More...
|
|
EntityHandle | get_finite_element_meshset (const BitFEId id) const |
|
EntityHandle | get_finite_element_meshset (const std::string name) const |
|
MoFEMErrorCode | get_finite_element_entities_by_dimension (const std::string name, int dim, Range &ents) const |
| get entities in the finite element by dimension More...
|
|
MoFEMErrorCode | get_finite_element_entities_by_type (const std::string name, EntityType type, Range &ents) const |
| get entities in the finite element by type More...
|
|
MoFEMErrorCode | get_finite_element_entities_by_handle (const std::string name, Range &ents) const |
| get entities in the finite element by handle More...
|
|
MoFEMErrorCode | list_finite_elements () const |
| list finite elements in database More...
|
|
|
MoFEMErrorCode | add_problem (const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY) |
| Add problem. More...
|
|
bool | check_problem (const std::string name) |
| check if problem exist More...
|
|
MoFEMErrorCode | delete_problem (const std::string name) |
| Delete problem. More...
|
|
MoFEMErrorCode | modify_problem_add_finite_element (const std::string name_problem, const std::string &fe_name) |
| add finite element to problem, this add entities assigned to finite element to a particular problem More...
|
|
MoFEMErrorCode | modify_problem_unset_finite_element (const std::string name_problem, const std::string &fe_name) |
| unset finite element from problem, this remove entities assigned to finite element to a particular problem More...
|
|
MoFEMErrorCode | modify_problem_ref_level_add_bit (const std::string &name_problem, const BitRefLevel &bit) |
| add ref level to problem More...
|
|
MoFEMErrorCode | modify_problem_ref_level_set_bit (const std::string &name_problem, const BitRefLevel &bit) |
| set ref level for problem More...
|
|
MoFEMErrorCode | modify_problem_mask_ref_level_add_bit (const std::string &name_problem, const BitRefLevel &bit) |
| set dof mask ref level for problem More...
|
|
MoFEMErrorCode | modify_problem_mask_ref_level_set_bit (const std::string &name_problem, const BitRefLevel &bit) |
| set dof mask ref level for problem More...
|
|
BitProblemId | getBitProblemId (const std::string &name) const |
|
MoFEMErrorCode | list_problem () const |
| list problems More...
|
|
MoFEMErrorCode | clear_problem (const std::string name, int verb=DEFAULT_VERBOSITY) |
| clear problem More...
|
|
MoFEMErrorCode | clear_problems (int verb=DEFAULT_VERBOSITY) |
| clear problems More...
|
|
MoFEMErrorCode | build_finite_elements (int verb=DEFAULT_VERBOSITY) |
| Build finite elements. More...
|
|
MoFEMErrorCode | build_finite_elements (const BitRefLevel &bit, int verb=DEFAULT_VERBOSITY) |
|
MoFEMErrorCode | build_finite_elements (const string fe_name, const Range *const ents_ptr=nullptr, int verb=DEFAULT_VERBOSITY) |
| Build finite elements. More...
|
|
MoFEMErrorCode | buildFiniteElements (const boost::shared_ptr< FiniteElement > &fe, const Range *ents_ptr=NULL, int verb=DEFAULT_VERBOSITY) |
|
MoFEMErrorCode | clear_finite_elements_by_bit_ref (const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY) |
|
MoFEMErrorCode | clear_finite_elements (const Range &ents, int verb=DEFAULT_VERBOSITY) |
|
MoFEMErrorCode | clear_finite_elements (const std::string &fe_name, const Range &ents, int verb=DEFAULT_VERBOSITY) |
|
MoFEMErrorCode | get_problem_finite_elements_entities (const std::string name, const std::string &fe_name, const EntityHandle meshset) |
| add finite elements to the meshset More...
|
|
DEPRECATED MoFEMErrorCode | build_problem_on_distributed_mesh (int verb=DEFAULT_VERBOSITY) |
|
DEPRECATED MoFEMErrorCode | build_problems (int verb=DEFAULT_VERBOSITY) |
|
|
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) |
|
|
MoFEMErrorCode | problem_basic_method_preProcess (const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY) |
| Set data for BasicMethod. More...
|
|
MoFEMErrorCode | problem_basic_method_preProcess (const std::string &problem_name, BasicMethod &method, int verb=DEFAULT_VERBOSITY) |
| Set data for BasicMethod. More...
|
|
MoFEMErrorCode | problem_basic_method_postProcess (const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY) |
| Set data for BasicMethod. More...
|
|
MoFEMErrorCode | problem_basic_method_postProcess (const std::string &problem_name, BasicMethod &method, int verb=DEFAULT_VERBOSITY) |
| Set data for BasicMethod. More...
|
|
MoFEMErrorCode | cache_problem_entities (const std::string prb_name, CacheTupleWeakPtr cache_ptr) |
| Cache variables. More...
|
|
MoFEMErrorCode | loop_finite_elements (const Problem *problem_ptr, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY) |
| Make a loop over finite elements on partitions from upper to lower rank. More...
|
|
MoFEMErrorCode | loop_finite_elements (const std::string problem_name, const std::string &fe_name, FEMethod &method, int lower_rank, int upper_rank, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY) |
| Make a loop over finite elements on partitions from upper to lower rank. More...
|
|
MoFEMErrorCode | loop_finite_elements (const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY) |
| Make a loop over finite elements. More...
|
|
MoFEMErrorCode | loop_dofs (const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY) |
| Make a loop over dofs. More...
|
|
MoFEMErrorCode | loop_dofs (const std::string &problem_name, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY) |
| Make a loop over dofs. More...
|
|
MoFEMErrorCode | loop_dofs (const std::string &problem_name, const std::string &field_name, RowColData rc, DofMethod &method, int verb=DEFAULT_VERBOSITY) |
| Make a loop over dofs. More...
|
|
MoFEMErrorCode | loop_dofs (const std::string &field_name, DofMethod &method, int verb=DEFAULT_VERBOSITY) |
| Make a loop over dofs. More...
|
|
MoFEMErrorCode | loop_entities (const Problem *problem_ptr, const std::string field_name, RowColData rc, EntityMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY) |
| Loop over field entities in the problem. More...
|
|
MoFEMErrorCode | loop_entities (const std::string problem_name, const std::string field_name, RowColData rc, EntityMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY) |
| Loop over field entities in the problem. More...
|
|
MoFEMErrorCode | loop_entities (const std::string problem_name, const std::string field_name, RowColData rc, EntityMethod &method, int verb=DEFAULT_VERBOSITY) |
| Loop over field entities in the problem. More...
|
|
MoFEMErrorCode | loop_entities (const std::string field_name, EntityMethod &method, Range const *const ents=nullptr, int verb=DEFAULT_VERBOSITY) |
| Loop over field entities. More...
|
|
|
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_multiIndex * | get_fields () const |
| Get the fields object. More...
|
|
const RefEntity_multiIndex * | get_ref_ents () const |
| Get the ref ents object. More...
|
|
const RefElement_multiIndex * | get_ref_finite_elements () const |
| Get the ref finite elements object. More...
|
|
const FiniteElement_multiIndex * | get_finite_elements () const |
| Get the finite elements object. More...
|
|
const EntFiniteElement_multiIndex * | get_ents_finite_elements () const |
| Get the ents finite elements object. More...
|
|
const FieldEntity_multiIndex * | get_field_ents () const |
| Get the field ents object. More...
|
|
const DofEntity_multiIndex * | get_dofs () const |
| Get the dofs object. More...
|
|
const Problem * | get_problem (const std::string problem_name) const |
| Get the problem object. More...
|
|
const Problem_multiIndex * | get_problems () const |
| Get the problems object. More...
|
|
const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * | get_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 field 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 field dofs of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
|
|
DofEntityByUId::iterator | get_dofs_by_name_begin (const std::string &field_name) const |
| get begin iterator of field dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
|
|
DofEntityByUId::iterator | get_dofs_by_name_end (const std::string &field_name) const |
| get begin iterator of field dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
|
|
DofEntityByUId::iterator | get_dofs_by_name_and_ent_begin (const std::string &field_name, const EntityHandle ent) const |
| get begin iterator of field 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 field dofs of given name and ent (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,ENT,IT) More...
|
|
DofEntityByUId::iterator | get_dofs_by_name_and_type_begin (const std::string &field_name, const EntityType type) const |
| get begin iterator of field 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 field dofs of given name end ent type(instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,TYPE,IT) More...
|
|
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator | get_fe_by_name_begin (const std::string &fe_name) const |
| get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
|
|
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator | get_fe_by_name_end (const std::string &fe_name) const |
| get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT) More...
|
|
Core (interface) class.
This is the implementation of abstract MoFEM::Interface class. Similarly to the convention used in MoAB, we use small letters to name function of purely abstract classes. This is an exception used only here. For more details about naming functions see Coding practice
This class is not used directly by the user. For internal use only. It is database with basic functions to access data. Abstraction of this is MoFEM Interface structure.
Such deign to hide complexities for users and allow low development without interfering with users modules programmer work.
- Todo:
- Implement static functions for Initialization and Finalization of MoFEM. Those functions should keep all static variables and initialize/finalize other libs like PETSc. Moreover initialization functions should set error handlers, etc.
- Examples
- add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_check_approx_in_3d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_broken_space.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, wave_equation.cpp, and wavy_surface.cpp.
Definition at line 82 of file Core.hpp.
◆ SemaphoresBuildMofem
Is used to check consistency. I n future properly this will be removed and replaced by other solution. It is only for internal use.
Enumerator |
---|
BUILD_FIELD | |
BUILD_FE | |
BUILD_ADJ | |
BUILD_PROBLEM | |
PARTITION_PROBLEM | |
PARTITION_FE | |
PARTITION_GHOST_DOFS | |
PARTITION_MESH | |
Definition at line 211 of file Core.hpp.
◆ CoreTmp() [1/2]
MoFEM::Core::CoreTmp |
( |
moab::Interface & |
moab, |
|
|
MPI_Comm |
comm = PETSC_COMM_WORLD , |
|
|
const int |
verbose = VERBOSE |
|
) |
| |
Construct core database
- Parameters
-
moab | MoAB interface |
comm | MPI communicator |
verbose | Verbosity level |
Definition at line 235 of file Core.cpp.
244 CHKERRABORT(comm,
ierr);
246 CHKERRABORT(comm,
ierr);
248 CHKERRABORT(comm,
ierr);
250 CHKERRABORT(comm,
ierr);
256 CHKERRABORT(comm,
ierr);
◆ ~CoreTmp()
MoFEM::Core::~CoreTmp |
( |
| ) |
|
Definition at line 283 of file Core.cpp.
284 PetscBool is_finalized;
285 PetscFinalized(&is_finalized);
◆ CoreTmp() [2/2]
Construct core database
- Parameters
-
moab | MoAB interface |
comm | MPI communicator |
Definition at line 32 of file CoreTemplates.hpp.
39 CHKERRABORT(comm,
ierr);
43 MOFEM_LOG_C(
"WORLD", Sev::verbose,
"Core number < %d >", V);
◆ add_broken_field()
Add field.
- Parameters
-
name | Field name |
space | Space L2,H1,Hdiv,Hcurl |
continuity | Field continuity (you can set broken space) |
base | Approximation base AINSWORTH_LEGENDRE_BASE, AINSWORTH_BERNSTEIN_BEZIER_BASE ... |
nb_coefficients | Number of field coefficients @param type_dof_side_map Map of entity type to function returning DofsSideMap |
tag_type | Tag type, MB_TAG_DENSE or MB_TAG_SPARSE (default) |
bh | Control behavior, if MF_EXCL throws error if exist |
verb | Verbosity 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
Definition at line 284 of file FieldCore.cpp.
302 auto fit =
fIelds.get<FieldName_mi_tag>().find(name);
303 if (fit ==
fIelds.get<FieldName_mi_tag>().end())
305 "field <%s> not in database", name.c_str());
307 for(
auto &p : list_dof_side_map) {
308 auto &data_side_map = (*fit)->getDofSideMap()[p.first];
309 CHKERR p.second(data_side_map);
◆ add_ents_to_field_by_dim() [1/2]
Add entities to field meshset.
\not collective
The lower dimension entities are added depending on the space type
- Parameters
-
meshset | |
dim | dimension |
name | name of field |
recursive | take entities recursively from embedded entities |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 440 of file FieldCore.cpp.
446 CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
◆ add_ents_to_field_by_dim() [2/2]
Add entities to field meshset.
- Note
- not collective
The lower dimension entities are added depending on the space type
- Parameters
-
ents | range of entities |
dim | dimension of entities |
name | name of field |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 416 of file FieldCore.cpp.
420 Range ents_dim = ents.subset_by_dimension(dim);
◆ add_ents_to_field_by_type() [1/2]
Add entities to field meshset.
- Note
- not collective
The lower dimension entities are added depending on the space type
- Parameters
-
meshset | |
type | of entities |
name | name of field |
recursive | take entities recursively from embedded entities |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 452 of file FieldCore.cpp.
460 const int dim =
get_moab().dimension_from_handle(ents[0]);
◆ add_ents_to_field_by_type() [2/2]
Add entities to field meshset.
- Note
- not collective
The lower dimension entities are added depending on the space type
- Parameters
-
ents | range of entities |
type | type of entities |
name | name of field |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 426 of file FieldCore.cpp.
431 Range ents_type = ents.subset_by_type(
type);
432 if (!ents_type.empty()) {
433 const int dim =
get_moab().dimension_from_handle(ents_type[0]);
◆ add_ents_to_finite_element_by_bit_ref()
add TET entities from given refinement level to finite element database given by name
- Note
- not collective
- Parameters
-
BitRefLevel | bit |
BitRefLevel | mask |
finite | element name |
finite | element type |
verbose | level |
Implements MoFEM::CoreInterface.
Definition at line 405 of file FECore.cpp.
421 for (; miit != hi_miit; miit++) {
422 const auto &bit2 = miit->get()->getBitRefLevel();
423 if ((bit2 & mask) != bit2)
425 if ((bit2 &
bit).any()) {
433 <<
"Finite element " << name <<
" added. Nb. of elements added "
434 << nb_add_fes <<
" out of " << std::distance(miit, hi_miit);
◆ 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
-
entities | meshset or range form were entities taken |
dim | dimension |
name | finite element name |
recursive | take entities from meshsets in meshset |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 346 of file FECore.cpp.
354 CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
355 CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
◆ 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
-
ents | range of entities |
dim | dimension of entities |
name | name of finite element |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 373 of file FECore.cpp.
379 CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
380 ents.subset_by_dimension(dim));
381 CHKERR get_moab().add_entities(idm, ents.subset_by_dimension(dim));
◆ 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
-
meshset | contains all entities that could be used for finite element |
name | Finite Element name |
Implements MoFEM::CoreInterface.
Definition at line 441 of file FECore.cpp.
447 if (recursive ==
false) {
451 CHKERR get_moab().get_entities_by_type(meshset, MBENTITYSET, meshsets,
◆ 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
-
entities | meshset or range form were entities taken |
type | type of entity |
name | finite element name |
recursive | take entities from meshsets in meshset |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 329 of file FECore.cpp.
339 CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
◆ 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
-
ents | range of entities |
type | type of entity (MBVERTEX, MBEDGE, MBTRI, ...) |
name | name of finite element |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 360 of file FECore.cpp.
366 CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
367 ents.subset_by_type(
type));
◆ add_ents_to_finite_element_EntType_by_bit_ref() [1/2]
◆ add_ents_to_finite_element_EntType_by_bit_ref() [2/2]
◆ add_field()
Add field.
- Parameters
-
name | Field name |
space | Space L2,H1,Hdiv,Hcurl |
continuity | Field continuity (you can set broken space) |
base | Approximation base AINSWORTH_LEGENDRE_BASE, AINSWORTH_BERNSTEIN_BEZIER_BASE ... |
nb_coefficients | Number of field coefficients |
tag_type | Tag type, MB_TAG_DENSE or MB_TAG_SPARSE (default) |
bh | Control behavior, if MF_EXCL throws error if exist |
verb | Verbosity 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 315 of file FieldCore.cpp.
◆ add_finite_element()
add finite element
- Parameters
-
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Example
CHKERR mField.add_finite_element(
"ELASTIC");
CHKERR mField.add_finite_element(
"PLASTIC");
Implements MoFEM::CoreInterface.
Definition at line 43 of file FECore.cpp.
54 auto add_meshset_to_partition = [&](
auto meshset) {
56 const void *tag_vals[] = {&
rAnk};
57 ParallelComm *pcomm = ParallelComm::get_pcomm(
59 Tag part_tag = pcomm->part_tag();
61 CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
62 tag_vals, 1, tagged_sets,
63 moab::Interface::UNION);
64 for (
auto s : tagged_sets)
69 auto &finite_element_name_set =
71 auto it_fe = finite_element_name_set.find(fe_name);
74 if (it_fe != finite_element_name_set.end()) {
80 if (it_fe != finite_element_name_set.end())
85 CHKERR add_meshset_to_partition(meshset);
94 auto id =
BitFEId().set(fe_shift);
98 void const *tag_data[] = {fe_name.c_str()};
100 tag_sizes[0] = fe_name.size();
105 boost::shared_ptr<FiniteElement>(
new FiniteElement(
moab, meshset)));
108 "FiniteElement not inserted");
111 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Add finite element " << fe_name;
◆ add_problem()
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.
89 auto miit =
pRoblems.get<Problem_mi_tag>().find(name);
90 if (miit ==
pRoblems.get<Problem_mi_tag>().end()) {
94 p_shift)) !=
pRoblems.get<BitProblemId_mi_tag>().end();
102 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"problem is in database %s",
◆ addEntsToFieldByDim()
Definition at line 324 of file FieldCore.cpp.
343 switch (continuity) {
349 "sorry, unknown continuity added to entity");
352 std::vector<int> nb_ents_on_dim(3, 0);
361 for (
int dd = 0;
dd != dim; ++
dd) {
364 moab::Interface::UNION);
370 mid_nodes = subtract(mid_nodes, topo_nodes);
371 adj_ents = subtract(adj_ents, mid_nodes);
374 nb_ents_on_dim[
dd] = adj_ents.size();
381 for (
int dd = 1;
dd != dim; ++
dd) {
384 moab::Interface::UNION);
386 nb_ents_on_dim[
dd] = adj_ents.size();
396 moab::Interface::UNION);
398 nb_ents_on_dim[2] = adj_ents.size();
403 "sorry, unknown space added to entity");
407 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"add entities to field " << name;
408 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add ents " << ents.size();
409 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add faces " << nb_ents_on_dim[2];
410 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add edges " << nb_ents_on_dim[1];
411 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add nodes " << nb_ents_on_dim[0];
◆ addField()
Template for add_field.
- Template Parameters
-
- Parameters
-
name | |
space | |
continuity | |
base | |
nb_coefficients | |
tag_type | |
bh | |
verb | |
- Returns
- MoFEMErrorCode
Definition at line 108 of file FieldCore.cpp.
124 auto add_meshset_to_partition = [&](
auto meshset) {
126 const void *tag_vals[] = {&
rAnk};
127 ParallelComm *pcomm = ParallelComm::get_pcomm(
129 Tag part_tag = pcomm->part_tag();
131 CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
132 tag_vals, 1, tagged_sets,
133 moab::Interface::UNION);
134 for (
auto s : tagged_sets)
139 auto create_tags = [&](
auto meshset,
auto id) {
151 void const *tag_data[] = {name.c_str()};
153 tag_sizes[0] = name.size();
159 const std::string tag_rank_name =
"_Field_Rank_" + name;
160 CHKERR get_moab().tag_get_handle(tag_rank_name.c_str(), 1, MB_TYPE_INTEGER,
161 th_rank, MB_TAG_CREAT | MB_TAG_SPARSE,
163 CHKERR get_moab().tag_set_data(th_rank, &meshset, 1, &nb_of_coefficients);
168 if (file_ver.majorVersion >= 0 && file_ver.minorVersion >= 12 &&
169 file_ver.buildVersion >= 1) {
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();
178 tag_prefix_data, tag_prefix_sizes);
179 Tag th_app_order, th_field_data, th_field_data_vert;
183 const std::string tag_approx_order_name =
"_App_Order_" + name;
185 tag_approx_order_name.c_str(), 1, MB_TYPE_INTEGER, th_app_order,
186 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
189 std::string tag_data_name = name_data_prefix + name;
190 const int def_len = 0;
192 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE, th_field_data,
193 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
194 std::string tag_data_name_verts = name_data_prefix + name +
"_V";
196 def_vert_data.clear();
198 tag_data_name_verts.c_str(), nb_of_coefficients, MB_TYPE_DOUBLE,
199 th_field_data_vert, MB_TAG_CREAT | tag_type, &*def_vert_data.begin());
202 const std::string name_data_prefix(
"_App_Data");
203 void const *tag_prefix_data[] = {name_data_prefix.c_str()};
204 int tag_prefix_sizes[1];
205 tag_prefix_sizes[0] = name_data_prefix.size();
207 tag_prefix_data, tag_prefix_sizes);
208 Tag th_app_order, th_field_data, th_field_data_vert;
212 const std::string tag_approx_order_name =
"_App_Order_" + name;
214 tag_approx_order_name.c_str(), 1, MB_TYPE_INTEGER, th_app_order,
215 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
218 std::string tag_data_name = name_data_prefix + name;
219 const int def_len = 0;
221 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE, th_field_data,
222 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
223 std::string tag_data_name_verts = name_data_prefix + name +
"V";
225 def_vert_data.clear();
227 tag_data_name_verts.c_str(), nb_of_coefficients, MB_TYPE_DOUBLE,
228 th_field_data_vert, MB_TAG_CREAT | tag_type, &*def_vert_data.begin());
237 auto fit =
fIelds.get<FieldName_mi_tag>().find(name);
238 if (fit !=
fIelds.get<FieldName_mi_tag>().end()) {
241 "field is <%s> in database", name.c_str());
247 CHKERR add_meshset_to_partition(meshset);
253 fIelds.get<BitFieldId_mi_tag>().end();
257 "Maximal number of fields exceeded");
261 CHKERR create_tags(meshset,
id);
263 auto p =
fIelds.insert(boost::make_shared<Field>(
moab, meshset));
265 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Add field " << **p.first;
267 <<
"Field " << (*p.first)->getName() <<
" core value < "
268 << this->
getValue() <<
" > field value ( "
269 <<
static_cast<int>((*p.first)->getBitNumber()) <<
" )";
274 "field not inserted %s (top tip, it could be already "
276 Field(
moab, meshset).getName().c_str());
◆ addPrismToDatabase()
add prim element
FIXME: This is dirt solution, need to be fixed
- Parameters
-
prism | prim handle |
verb | verbosity level |
- Returns
- error code
Definition at line 522 of file Core.cpp.
526 std::pair<RefEntity_multiIndex::iterator, bool> p_ent;
530 std::pair<RefElement_multiIndex::iterator, bool> p;
532 boost::shared_ptr<RefElement>(
new RefElement_PRISM(*p_ent.first)));
536 Range face_side3, face_side4;
538 CHKERR get_moab().get_adjacencies(&conn[3], 3, 2,
false, face_side4);
539 if (face_side3.size() != 1)
541 "prism don't have side face 3");
542 if (face_side4.size() != 1)
544 "prims don't have side face 4");
545 p.first->get()->getSideNumberPtr(*face_side3.begin());
546 p.first->get()->getSideNumberPtr(*face_side4.begin());
◆ addProblem()
add problem
- Parameters
-
id | problem id |
name | problem name |
verb | verbosity level |
- Returns
- MoFEMErrorCode
Definition at line 27 of file ProblemsCore.cpp.
40 auto add_meshset_to_partition = [&](
auto meshset) {
42 const void *tag_vals[] = {&
rAnk};
43 ParallelComm *pcomm = ParallelComm::get_pcomm(
45 Tag part_tag = pcomm->part_tag();
47 CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
48 tag_vals, 1, tagged_sets,
49 moab::Interface::UNION);
50 for (
auto s : tagged_sets)
54 CHKERR add_meshset_to_partition(meshset);
56 void const *tag_data[] = {name.c_str()};
58 tag_sizes[0] = name.size();
66 MOFEM_LOG(
"SELF", Sev::error) <<
"Following problem can not be added:";
68 <<
"Problem " << name <<
" id(" <<
id.to_ulong() <<
") " <<
id
69 <<
" added meshset " << meshset;
70 MOFEM_LOG(
"SELF", Sev::error) <<
"List of problems already in databse:";
73 << p.getName() <<
" id(" << p.getId().to_ulong() <<
") " <<
id
74 <<
" on meshset " << p.meshset;
79 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Add problem " << name;
◆ build_adjacencies() [1/3]
build adjacencies
- Parameters
-
bit | adjacencies for refine level |
mask | mask 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 814 of file FECore.cpp.
820 CHKERR BitRefManager(*this).getEntitiesByRefLevel(
bit, mask, ents);
◆ build_adjacencies() [2/3]
build adjacencies
- Parameters
-
bit | adjacencies 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 826 of file FECore.cpp.
◆ build_adjacencies() [3/3]
build adjacencies
- Parameters
-
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 742 of file FECore.cpp.
751 for (
auto peit = ents.pair_begin(); peit != ents.pair_end(); ++peit) {
755 for (; fit != hi_fit; ++fit) {
756 if ((*fit)->getBitFieldIdRow().none() &&
757 (*fit)->getBitFieldIdCol().none() &&
758 (*fit)->getBitFieldIdData().none())
761 if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol())
763 if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData())
765 FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_row(by);
767 for (
auto e : *(*fit)->getRowFieldEntsPtr()) {
772 "modification unsuccessful");
774 if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol()) {
776 if ((*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData())
778 FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_col(by);
780 for (
auto e : *(*fit)->getColFieldEntsPtr()) {
785 "modification unsuccessful");
788 if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData() ||
789 (*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData()) {
790 FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat modify_data(
793 for (
auto &e : (*fit)->getDataFieldEnts()) {
798 "modification unsuccessful");
◆ build_field()
◆ build_fields()
◆ build_finite_elements() [1/3]
◆ build_finite_elements() [2/3]
Build finite elements.
Build finite element data structures. Have to be run before problem and adjacencies are constructed.
- Parameters
-
fe_name | Name of finite element |
ents_ptr | Pointer to range of finite elements |
verb | Verbosity level |
- Returns
- Error code
Implements MoFEM::CoreInterface.
Definition at line 711 of file FECore.cpp.
718 auto fe_miit =
finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
719 if (fe_miit ==
finiteElements.get<FiniteElement_name_mi_tag>().end())
727 auto miit = fe_ents.lower_bound(
731 get_id_for_max_type<MBENTITYSET>(), (*fe_miit)->getFEUId()));
732 const auto count = std::distance(miit, hi_miit);
733 MOFEM_LOG(
"SYNC", Sev::inform) <<
"Finite element " << fe_name
734 <<
" added. Nb. of elements added " << count;
◆ build_finite_elements() [3/3]
Build finite elements.
Build finite element data structures. Have to be run before problem and adjacencies are constructed.
- Parameters
-
- Returns
- Error code
Implements MoFEM::CoreInterface.
Definition at line 655 of file FECore.cpp.
669 auto miit = fe_ents.lower_bound(
673 get_id_for_max_type<MBENTITYSET>(), fe->getFEUId()));
674 const auto count = std::distance(miit, hi_miit);
676 <<
"Finite element " << fe->getName()
677 <<
" added. Nb. of elements added " << count;
681 for (
auto &field :
fIelds) {
682 auto rec = slg.open_record(keywords::severity = Sev::verbose);
684 logging::record_ostream strm(rec);
685 strm <<
"Field " << field->getName() <<
" on finite element: ";
686 if ((field->getId() & fe->getBitFieldIdRow()).any())
688 if ((field->getId() & fe->getBitFieldIdCol()).any())
690 if ((field->getId() & fe->getBitFieldIdData()).any())
693 slg.push_record(boost::move(rec));
◆ build_problem_on_distributed_mesh()
Definition at line 257 of file ProblemsCore.cpp.
261 Problem_multiIndex::iterator p_miit =
pRoblems.begin();
262 for (; p_miit !=
pRoblems.end(); p_miit++) {
263 CHKERR getInterface<ProblemsManager>()->buildProblemOnDistributedMesh(
264 const_cast<Problem *
>(&*p_miit), verb);
◆ build_problems()
Definition at line 317 of file ProblemsCore.cpp.
328 Problem_multiIndex::iterator p_miit =
pRoblems.begin();
329 for (; p_miit !=
pRoblems.end(); p_miit++) {
330 Problem *problem_ptr =
const_cast<Problem *
>(&*p_miit);
331 CHKERR getInterface<ProblemsManager>()->buildProblem(problem_ptr,
false,
◆ buildField()
Definition at line 1256 of file FieldCore.cpp.
1262 MOFEM_LOG(
"SYNC", Sev::verbose) <<
"Build field " << field->getName();
1264 std::map<EntityType, int> dof_counter;
1265 std::map<EntityType, int> inactive_dof_counter;
1269 if (field->getApproxBase() ==
USER_BASE)
1270 CHKERR field->rebuildDofsOrderMap();
1272 switch (field->getSpace()) {
1281 inactive_dof_counter, verb);
1288 int nb_added_dofs = 0;
1289 int nb_inactive_added_dofs = 0;
1290 for (
auto const &it : dof_counter) {
1292 <<
"Nb. of dofs (" << moab::CN::EntityTypeName(it.first) <<
") "
1293 << it.second <<
" (inactive " << inactive_dof_counter[it.first]
1295 nb_added_dofs += it.second;
1296 nb_inactive_added_dofs += inactive_dof_counter[it.first];
1299 <<
"Nb. added dofs " << nb_added_dofs <<
" (number of inactive dofs "
1300 << nb_inactive_added_dofs <<
" )";
◆ buildFieldForL2H1HcurlHdiv()
Definition at line 1144 of file FieldCore.cpp.
1152 auto &set_id =
fIelds.get<BitFieldId_mi_tag>();
1157 const int bit_number =
field_it->get()->getBitNumber();
1158 const int rank =
field_it->get()->getNbOfCoeffs();
1161 Range ents_of_id_meshset;
1163 ents_of_id_meshset,
false);
1165 MOFEM_LOG_C(
"SYNC", Sev::noisy,
"Ents in field %s meshset %d",
1166 (*field_it)->getName().c_str(), ents_of_id_meshset.size());
1169 for (
auto p_eit = ents_of_id_meshset.pair_begin();
1170 p_eit != ents_of_id_meshset.pair_end(); ++p_eit) {
1179 auto feit =
entsFields.get<Unique_mi_tag>().lower_bound(lo_uid);
1180 if (feit ==
entsFields.get<Unique_mi_tag>().end())
1182 auto hi_feit =
entsFields.get<Unique_mi_tag>().upper_bound(hi_uid);
1186 auto dit =
dofsField.get<Unique_mi_tag>().lower_bound(lo_uid);
1187 auto hi_dit =
dofsField.get<Unique_mi_tag>().upper_bound(hi_uid);
1188 dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1191 boost::shared_ptr<std::vector<DofEntity>> dofs_array =
1192 boost::make_shared<std::vector<DofEntity>>(std::vector<DofEntity>());
1194 int nb_dofs_on_ents = 0;
1195 for (
auto tmp_feit = feit; tmp_feit != hi_feit; ++tmp_feit) {
1196 nb_dofs_on_ents += rank * tmp_feit->get()->getOrderNbDofs(
1197 tmp_feit->get()->getMaxOrder());
1201 dofs_array->reserve(nb_dofs_on_ents);
1204 for (; feit != hi_feit; ++feit) {
1208 for (
int oo = 0; oo <= feit->get()->getMaxOrder(); ++oo) {
1210 for (
int dd = 0;
dd < feit->get()->getOrderNbDofsDiff(oo); ++
dd) {
1212 for (
int rr = 0; rr < rank; ++rr, ++DD) {
1213 dofs_array->emplace_back(*feit, oo, rr, DD);
1214 ++dof_counter[feit->get()->getEntType()];
1218 if (DD > feit->get()->getNbDofsOnEnt()) {
1219 std::ostringstream ss;
1220 ss <<
"rank " <<
rAnk <<
" ";
1221 ss << **feit << std::endl;
1223 "Expected number of DOFs on entity not equal to number added "
1224 "to database (DD = %d != %d = "
1225 "feit->get()->getNbDofsOnEnt())\n"
1227 DD, feit->get()->getNbDofsOnEnt(), ss.str().c_str());
1232 int dofs_field_size0 =
dofsField.size();
1234 for (
auto &
v : *dofs_array)
1235 hint =
dofsField.emplace_hint(hint, dofs_array, &
v);
1238 field_it->get()->getDofSequenceContainer().push_back(dofs_array);
1241 if (PetscUnlikely(
static_cast<int>(dofs_array.use_count()) !=
1242 static_cast<int>(dofs_array->size() + 1))) {
1244 "Wrong use count %d != %d", dofs_array.use_count(),
1245 dofs_array->size() + 1);
1247 if (dofs_field_size0 + dofs_array->size() !=
dofsField.size()) {
1249 "Wrong number of inserted DOFs %d != %d", dofs_array->size(),
◆ buildFieldForNoField()
Definition at line 1121 of file FieldCore.cpp.
1135 <<
"Field " << (*field_it)->getName() <<
" core value < "
1136 << this->
getValue() <<
" > field value () "
1137 << (*field_it)->getBitNumber() <<
" )";
◆ buildFieldForNoFieldImpl()
MoFEMErrorCode MoFEM::Core::buildFieldForNoFieldImpl |
( |
boost::shared_ptr< Field > |
field_ptr, |
|
|
std::map< EntityType, int > & |
dof_counter, |
|
|
int |
verb |
|
) |
| |
|
protected |
Definition at line 1016 of file FieldCore.cpp.
1021 const auto bit_number = field_ptr->getBitNumber();
1025 CHKERR get_moab().get_entities_by_handle(field_ptr->getMeshset(), ents,
1028 MOFEM_LOG_C(
"SYNC", Sev::noisy,
"Ents in field %s meshset %d\n",
1029 field_ptr->getName().c_str(), ents.size());
1032 auto eiit =
entsFields.get<Unique_mi_tag>().lower_bound(
1035 if (eiit !=
entsFields.get<Unique_mi_tag>().end()) {
1036 auto hi_eiit =
entsFields.get<Unique_mi_tag>().upper_bound(
1038 std::copy(eiit, hi_eiit, std::back_inserter(ents_id_view));
1041 boost::shared_ptr<const int> zero_order(
new const int(0));
1043 for (
auto ent : ents) {
1048 "Entity is not in MoFEM database, entities in field meshset need "
1049 "to be seeded (i.e. bit ref level add to them)");
1051 auto add_dofs = [&](
auto field_eit) {
1058 boost::make_shared<DofEntity>(field_eit, 0, rank, rank));
1060 dof_counter[MBENTITYSET]++;
1063 "Dof expected to be created");
1069 auto field_ent_it = ents_id_view.get<1>().find(ent);
1070 if (field_ent_it == ents_id_view.get<1>().end()) {
1074 boost::make_shared<FieldEntity>(
1075 field_ptr, *ref_ent_it,
1078 boost::shared_ptr<const int>(zero_order, zero_order.get()))
1082 if ((*p.first)->getFieldRawPtr() != field_ptr.get())
1084 "Get field ent poiter and field pointer do not match for "
1086 field_ptr->getName().c_str());
1090 "Entity should be created");
1092 CHKERR add_dofs(*(p.first));
1098 auto dit =
dofsField.get<Unique_mi_tag>().lower_bound(
1100 auto hi_dit =
dofsField.get<Unique_mi_tag>().upper_bound(
1102 dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1103 CHKERR add_dofs(*field_ent_it);
1108 auto lo_dof =
dofsField.get<Unique_mi_tag>().lower_bound(
1110 auto hi_dof =
dofsField.get<Unique_mi_tag>().upper_bound(
1112 for (; lo_dof != hi_dof; lo_dof++)
1113 MOFEM_LOG(
"SYNC", Sev::noisy) << **lo_dof;
◆ buildFiniteElements()
Definition at line 459 of file FECore.cpp.
467 <<
"Build Finite Elements " << fe->getName();
469 auto &fields_by_id =
fIelds.get<BitFieldId_mi_tag>();
473 std::array<BitFieldId, LAST> fe_fields = {fe.get()->getBitFieldIdRow(),
474 fe.get()->getBitFieldIdCol(),
475 fe.get()->getBitFieldIdData()};
482 CHKERR get_moab().get_entities_by_handle(meshset, fe_ents,
false);
485 fe_ents = intersect(fe_ents, *ents_ptr);
488 typedef std::vector<boost::weak_ptr<EntFiniteElement>> VecOfWeakFEPtrs;
489 VecOfWeakFEPtrs processed_fes;
490 processed_fes.reserve(fe_ents.size());
492 int last_data_field_ents_view_size = 0;
493 int last_row_field_ents_view_size = 0;
494 int last_col_field_ents_view_size = 0;
497 std::vector<EntityHandle> adj_ents;
500 for (Range::const_pair_iterator peit = fe_ents.const_pair_begin();
501 peit != fe_ents.const_pair_end(); peit++) {
503 const auto first = peit->first;
504 const auto second = peit->second;
512 std::ostringstream ss;
513 ss <<
"refinedFiniteElements not in database ent = " << first <<
" type "
517 auto hi_ref_fe_miit =
521 for (; ref_fe_miit != hi_ref_fe_miit; ref_fe_miit++) {
525 hint_p, boost::make_shared<EntFiniteElement>(*ref_fe_miit, fe));
526 processed_fes.emplace_back(*hint_p);
527 auto fe_raw_ptr = hint_p->get();
530 bool row_as_data =
false, col_as_row =
false;
531 if (fe_fields[
DATA] == fe_fields[
ROW])
533 if (fe_fields[
ROW] == fe_fields[
COL])
536 fe_raw_ptr->getDataFieldEntsPtr()->reserve(
537 last_data_field_ents_view_size);
540 fe_raw_ptr->getRowFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
543 if (fe_raw_ptr->getRowFieldEntsPtr() ==
544 fe_raw_ptr->getDataFieldEntsPtr())
545 fe_raw_ptr->getRowFieldEntsPtr() =
546 boost::make_shared<FieldEntity_vector_view>();
547 fe_raw_ptr->getRowFieldEntsPtr()->reserve(
548 last_row_field_ents_view_size);
551 if (row_as_data && col_as_row) {
552 fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
553 }
else if (col_as_row) {
554 fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getRowFieldEntsPtr();
558 fe_raw_ptr->getColFieldEntsPtr() ==
559 fe_raw_ptr->getRowFieldEntsPtr() ||
560 fe_raw_ptr->getColFieldEntsPtr() ==
561 fe_raw_ptr->getDataFieldEntsPtr()
564 fe_raw_ptr->getColFieldEntsPtr() =
565 boost::make_shared<FieldEntity_vector_view>();
566 fe_raw_ptr->getColFieldEntsPtr()->reserve(
567 last_col_field_ents_view_size);
571 for (
unsigned int ii = 0; ii !=
BitFieldId().size(); ++ii) {
576 for (
int ss = 0; ss <
LAST; ss++) {
577 id_common |= fe_fields[ss] &
BitFieldId().set(ii);
579 if (id_common.none())
584 auto miit = fields_by_id.find(field_id);
585 if (miit == fields_by_id.end())
587 auto field_bit_number = (*miit)->getBitNumber();
591 const std::string
field_name = miit->get()->getName();
592 const bool add_to_data = (field_id & fe_fields[
DATA]).any();
593 const bool add_to_row = (field_id & fe_fields[
ROW]).any();
594 const bool add_to_col = (field_id & fe_fields[
COL]).any();
599 CHKERR fe_raw_ptr->getElementAdjacency(*miit, adj_ents);
601 for (
auto ent : adj_ents) {
603 auto dof_it =
entsFields.get<Unique_mi_tag>().find(
605 if (dof_it !=
entsFields.get<Unique_mi_tag>().end()) {
608 fe_raw_ptr->getDataFieldEntsPtr()->emplace_back(*dof_it);
610 if (add_to_row && !row_as_data) {
611 fe_raw_ptr->getRowFieldEntsPtr()->emplace_back(*dof_it);
613 if (add_to_col && !col_as_row) {
614 fe_raw_ptr->getColFieldEntsPtr()->emplace_back(*dof_it);
622 auto uid_comp = [](
const auto &
a,
const auto &b) {
623 return a.lock()->getLocalUniqueId() < b.lock()->getLocalUniqueId();
629 sort(fe_raw_ptr->getDataFieldEntsPtr()->begin(),
630 fe_raw_ptr->getDataFieldEntsPtr()->end(), uid_comp);
631 last_data_field_ents_view_size =
632 fe_raw_ptr->getDataFieldEntsPtr()->size();
636 sort(fe_raw_ptr->getRowFieldEntsPtr()->begin(),
637 fe_raw_ptr->getRowFieldEntsPtr()->end(), uid_comp);
638 last_row_field_ents_view_size =
639 fe_raw_ptr->getRowFieldEntsPtr()->size();
644 sort(fe_raw_ptr->getColFieldEntsPtr()->begin(),
645 fe_raw_ptr->getColFieldEntsPtr()->end(), uid_comp);
646 last_col_field_ents_view_size =
647 fe_raw_ptr->getColFieldEntsPtr()->size();
◆ cache_problem_entities()
Cache variables.
- Parameters
-
- Returns
- MoFEMErrorCode
Implements MoFEM::CoreInterface.
Definition at line 798 of file ProblemsCore.cpp.
802 if (
auto cache_ptr = cache_weak_ptr.lock()) {
803 auto p_miit =
pRoblems.get<Problem_mi_tag>().find(prb_name);
804 if (p_miit ==
pRoblems.get<Problem_mi_tag>().end())
805 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"problem not in database %s",
808 const BitRefLevel &prb_bit = p_miit->getBitRefLevel();
809 const BitRefLevel &prb_mask = p_miit->getBitRefLevelMask();
810 const BitFEId &prb_fe_id = p_miit->getBitFEId();
812 auto &row_dofs = p_miit->numeredRowDofsPtr;
813 auto &col_dofs = p_miit->numeredColDofsPtr;
815 auto &cache_data = std::get<0>(*cache_ptr);
816 auto &cache_row = std::get<1>(*cache_ptr);
817 auto &cache_col = std::get<2>(*cache_ptr);
820 if (row_dofs != col_dofs)
827 const auto uid = (*it)->getLocalUniqueId();
829 for (
auto lo =
r.first; lo !=
r.second; ++lo) {
831 if ((lo->getBitFEId() & prb_fe_id).any()) {
833 const BitRefLevel &fe_bit = lo->entFePtr->getBitRefLevel();
836 if (((fe_bit & prb_mask) != fe_bit) || ((fe_bit & prb_bit).none()))
839 auto cache_numered_dofs = [&](
auto &numered_dofs,
auto &cache_vec,
841 auto dit = numered_dofs->lower_bound(uid);
842 decltype(dit) hi_dit;
843 if (dit != numered_dofs->end())
844 hi_dit = numered_dofs->upper_bound(
849 ent_cache = boost::shared_ptr<EntityCacheNumeredDofs>(
850 cache_ptr, &(cache_vec[idx]));
851 cache_vec[idx].loHi = {dit, hi_dit};
854 auto cache_dofs = [&](
auto &dofs,
auto &cache_vec,
auto &ent_cache) {
855 auto dit = dofs.lower_bound(uid);
856 decltype(dit) hi_dit;
857 if (dit != dofs.end())
858 hi_dit = dofs.upper_bound(
863 ent_cache = boost::shared_ptr<EntityCacheDofs>(cache_ptr,
865 cache_vec[idx].loHi = {dit, hi_dit};
868 cache_numered_dofs(row_dofs, cache_row, (*it)->entityCacheRowDofs);
869 if (row_dofs != col_dofs) {
872 cache_numered_dofs(col_dofs, cache_col, (*it)->entityCacheColDofs);
874 (*it)->entityCacheColDofs = (*it)->entityCacheRowDofs;
877 cache_dofs(
dofsField, cache_data, (*it)->entityCacheDataDofs);
◆ check_field()
bool MoFEM::Core::check_field |
( |
const std::string & |
name | ) |
const |
|
protectedvirtual |
check if field is in database
- Parameters
-
- Returns
- true if field exist
Implements MoFEM::CoreInterface.
Definition at line 57 of file FieldCore.cpp.
58 auto miit =
fIelds.get<FieldName_mi_tag>().find(name);
59 if (miit ==
fIelds.get<FieldName_mi_tag>().end())
◆ check_finite_element()
bool MoFEM::Core::check_finite_element |
( |
const std::string & |
name | ) |
const |
|
protectedvirtual |
Check if finite element is in database.
- Parameters
-
name | Name of finite element |
- Returns
- true if element is declared
Implements MoFEM::CoreInterface.
Definition at line 35 of file FECore.cpp.
36 auto miit =
finiteElements.get<FiniteElement_name_mi_tag>().find(name);
◆ check_number_of_ents_in_ents_field() [1/2]
MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_field |
( |
| ) |
const |
|
protectedvirtual |
check data consistency in entitiesPtr
Implements MoFEM::CoreInterface.
Definition at line 1437 of file FieldCore.cpp.
1439 for (
auto &it :
fIelds.get<FieldName_mi_tag>()) {
1440 if (it->getSpace() ==
NOFIELD)
1445 CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1447 auto count_field_ents = [&]() {
1448 auto bit_number = it->getBitNumber();
1449 auto low_eit =
entsFields.get<Unique_mi_tag>().lower_bound(
1451 auto hi_eit =
entsFields.get<Unique_mi_tag>().upper_bound(
1453 return std::distance(low_eit, hi_eit);
1456 if (count_field_ents() > (
unsigned int)num_entities) {
1458 "not equal number of entities in meshset and field "
1459 "multiindex < %s >",
1460 it->getName().c_str());
◆ check_number_of_ents_in_ents_field() [2/2]
MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_field |
( |
const std::string & |
name | ) |
const |
|
protectedvirtual |
check data consistency in entitiesPtr
Implements MoFEM::CoreInterface.
Definition at line 1409 of file FieldCore.cpp.
1411 auto it =
fIelds.get<FieldName_mi_tag>().find(name);
1412 if (it ==
fIelds.get<FieldName_mi_tag>().end()) {
1414 "field not found < %s >", name.c_str());
1418 CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1420 auto count_field_ents = [&]() {
1421 auto bit_number = (*it)->getBitNumber();
1422 auto low_eit =
entsFields.get<Unique_mi_tag>().lower_bound(
1424 auto hi_eit =
entsFields.get<Unique_mi_tag>().upper_bound(
1426 return std::distance(low_eit, hi_eit);
1429 if (count_field_ents() > (
unsigned int)num_entities) {
1431 "not equal number of entities in meshset and field multiindex "
◆ check_number_of_ents_in_ents_finite_element() [1/2]
MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_finite_element |
( |
| ) |
const |
|
protectedvirtual |
check data consistency in entsFiniteElements
Implements MoFEM::CoreInterface.
Definition at line 885 of file FECore.cpp.
887 FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
889 for (; it !=
finiteElements.get<FiniteElement_name_mi_tag>().end(); it++) {
893 CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
895 auto counts_fes = [&]() {
900 if (counts_fes() !=
static_cast<size_t>(num_entities)) {
902 "not equal number of entities in meshset and finite elements "
904 (*it)->getName().c_str());
◆ check_number_of_ents_in_ents_finite_element() [2/2]
MoFEMErrorCode MoFEM::Core::check_number_of_ents_in_ents_finite_element |
( |
const std::string & |
name | ) |
const |
|
protectedvirtual |
check data consistency in entsFiniteElements
Implements MoFEM::CoreInterface.
Definition at line 858 of file FECore.cpp.
861 FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
863 if (it ==
finiteElements.get<FiniteElement_name_mi_tag>().end()) {
864 SETERRQ1(
mofemComm, 1,
"finite element not found < %s >", name.c_str());
869 CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
871 auto counts_fes = [&]() {
876 if (counts_fes() !=
static_cast<size_t>(num_entities)) {
878 "not equal number of entities in meshset and finite elements "
880 (*it)->getName().c_str());
◆ check_problem()
check if problem exist
- Parameters
-
- Returns
- true if problem is in database
Implements MoFEM::CoreInterface.
◆ clear_adjacencies_entities() [1/3]
◆ clear_adjacencies_entities() [2/3]
clear adjacencies for field entities by entities
Implements MoFEM::CoreInterface.
Definition at line 213 of file DeleteCore.cpp.
217 for (Range::const_pair_iterator p_eit = ents.pair_begin();
218 p_eit != ents.pair_end(); ++p_eit) {
221 FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
222 Ent_mi_tag>::type::iterator ait,
◆ clear_adjacencies_entities() [3/3]
clear adjacencies for field entities by entities and field namd
Implements MoFEM::CoreInterface.
Definition at line 231 of file DeleteCore.cpp.
238 int field_bit_number = field_ptr->getBitNumber();
240 for (Range::const_pair_iterator p_eit = ents.pair_begin();
241 p_eit != ents.pair_end(); p_eit++) {
255 auto hi_ait =
entFEAdjacencies.get<Unique_mi_tag>().upper_bound(second_uid);
◆ clear_adjacencies_finite_elements() [1/3]
◆ clear_adjacencies_finite_elements() [2/3]
Definition at line 322 of file DeleteCore.cpp.
327 for (Range::const_pair_iterator p_eit = ents.pair_begin();
328 p_eit != ents.pair_end(); p_eit++) {
331 FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
332 FEEnt_mi_tag>::type::iterator ait,
◆ clear_adjacencies_finite_elements() [3/3]
Definition at line 341 of file DeleteCore.cpp.
348 FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator
349 it_fe =
finiteElements.get<FiniteElement_name_mi_tag>().find(name);
350 if (it_fe !=
finiteElements.get<FiniteElement_name_mi_tag>().end()) {
352 const auto fe_uid = (*it_fe)->getFEUId();
354 for (Range::const_pair_iterator p_eit = ents.pair_begin();
355 p_eit != ents.pair_end(); p_eit++) {
368 FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
369 FE_Unique_mi_tag>::type::iterator ait,
◆ clear_database()
◆ clear_dofs_fields() [1/2]
Clear dofs by ents
Implements MoFEM::CoreInterface.
Definition at line 57 of file DeleteCore.cpp.
62 for (Range::const_pair_iterator p_eit = ents.pair_begin();
63 p_eit != ents.pair_end(); p_eit++) {
67 DofEntityByEnt::iterator dit, hi_dit;
68 dit =
dofsField.get<Ent_mi_tag>().lower_bound(first);
69 if (dit ==
dofsField.get<Ent_mi_tag>().end())
71 hi_dit =
dofsField.get<Ent_mi_tag>().upper_bound(second);
73 dofsField.get<Ent_mi_tag>().erase(dit, hi_dit);
◆ clear_dofs_fields() [2/2]
Clear dofs by field name and ents
Implements MoFEM::CoreInterface.
Definition at line 78 of file DeleteCore.cpp.
86 for (Range::const_pair_iterator p_eit = ents.pair_begin();
87 p_eit != ents.pair_end(); p_eit++) {
88 const auto first = p_eit->first;
89 const auto second = p_eit->second;
92 auto dit =
dofsField.get<Unique_mi_tag>().lower_bound(lo_uid);
93 auto hi_dit =
dofsField.get<Unique_mi_tag>().upper_bound(hi_uid);
94 dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
◆ clear_dofs_fields_by_bit_ref()
◆ clear_ents_fields() [1/2]
Clear entities by field name
Implements MoFEM::CoreInterface.
Definition at line 113 of file DeleteCore.cpp.
119 for (Range::const_pair_iterator p_eit = ents.pair_begin();
120 p_eit != ents.pair_end(); p_eit++) {
123 FieldEntity_multiIndex::index<Ent_mi_tag>::type::iterator dit, hi_dit;
124 dit =
entsFields.get<Ent_mi_tag>().lower_bound(first);
125 hi_dit =
entsFields.get<Ent_mi_tag>().upper_bound(second);
126 entsFields.get<Ent_mi_tag>().erase(dit, hi_dit);
◆ clear_ents_fields() [2/2]
Clear entities by field name
Implements MoFEM::CoreInterface.
Definition at line 131 of file DeleteCore.cpp.
139 for (Range::const_pair_iterator p_eit = ents.pair_begin();
140 p_eit != ents.pair_end(); p_eit++) {
141 const auto first = p_eit->first;
142 const auto second = p_eit->second;
143 auto dit =
entsFields.get<Unique_mi_tag>().lower_bound(
145 auto hi_dit =
entsFields.get<Unique_mi_tag>().upper_bound(
147 entsFields.get<Unique_mi_tag>().erase(dit, hi_dit);
◆ clear_ents_fields_by_bit_ref()
◆ clear_finite_elements() [1/2]
clear finite elements
Implements MoFEM::CoreInterface.
Definition at line 273 of file DeleteCore.cpp.
278 for (Range::const_pair_iterator p_eit = ents.pair_begin();
279 p_eit != ents.pair_end(); p_eit++) {
282 EntFiniteElement_multiIndex::index<Ent_mi_tag>::type::iterator fit, hi_fit;
◆ clear_finite_elements() [2/2]
clear finite elements
Implements MoFEM::CoreInterface.
Definition at line 290 of file DeleteCore.cpp.
296 auto fe_miit =
finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
297 if (fe_miit ==
finiteElements.get<FiniteElement_name_mi_tag>().end()) {
298 for (Range::const_pair_iterator p_eit = ents.pair_begin();
299 p_eit != ents.pair_end(); p_eit++) {
302 (*fe_miit)->getFEUId()));
305 (*fe_miit)->getFEUId()));
◆ clear_finite_elements_by_bit_ref()
◆ clear_inactive_dofs()
◆ clear_problem()
clear problem
Implements MoFEM::CoreInterface.
Definition at line 269 of file ProblemsCore.cpp.
274 ProblemsByName &prob_by_name =
pRoblems.get<Problem_mi_tag>();
275 ProblemsByName::iterator p_miit = prob_by_name.find(problem_name);
276 if (p_miit == prob_by_name.end()) {
278 "problem < %s > not found, (top tip: check spelling)",
279 problem_name.c_str());
282 bool success = prob_by_name.modify(p_miit, ProblemZeroNbRowsChange());
285 "modification unsuccessful");
287 success = prob_by_name.modify(p_miit, ProblemZeroNbColsChange());
290 "modification unsuccessful");
293 prob_by_name.modify(p_miit, ProblemClearNumeredFiniteElementsChange());
296 "modification unsuccessful");
298 success = prob_by_name.modify(p_miit, ProblemClearSubProblemData());
301 "modification unsuccessful");
302 success = prob_by_name.modify(p_miit, ProblemClearComposedProblemData());
305 "modification unsuccessful");
306 if (p_miit->getRowDofsSequence())
307 p_miit->getRowDofsSequence()->clear();
308 if (p_miit->getColDofsSequence())
309 p_miit->getColDofsSequence()->clear();
310 if (p_miit->getSubData())
311 p_miit->getSubData().reset();
312 if (p_miit->getComposedProblemsData())
313 p_miit->getComposedProblemsData().reset();
◆ clear_problems()
◆ clearMap()
Cleaning database.
Definition at line 503 of file Core.cpp.
506 CHKERR getInterface<SeriesRecorder>()->clearMap();
507 CHKERR getInterface<MeshsetsManager>()->clearMap();
508 CHKERR getInterface<CutMeshInterface>()->clearMap();
◆ coreGenericConstructor()
MoFEMErrorCode MoFEM::Core::coreGenericConstructor |
( |
moab::Interface & |
moab, |
|
|
MPI_Comm |
comm, |
|
|
const int |
verbose |
|
) |
| |
|
protected |
Definition at line 197 of file Core.cpp.
204 "MoFEM globally is not initialised, call MoFEM::Core::Initialize");
218 CHKERR registerInterface<UnknownInterface>();
219 CHKERR registerInterface<CoreInterface>();
220 CHKERR registerInterface<DeprecatedCoreInterface>();
◆ create_vertices_and_add_to_field()
Create a vertices and add to field object.
Create vertices and add them to field. Those vertices would be carring DOFs of the field.
- Note
- This function is typically used when NOFIELD is created, for example load factor in arc-length control.
- Parameters
-
name | name of the field |
bit | bit ref level of the created vertices |
coords | of the vertices |
size | number of vertices |
verb | verbosity level |
- Returns
- MoFEMErrorCode
Implements MoFEM::CoreInterface.
Definition at line 467 of file FieldCore.cpp.
477 auto create_vertices = [&]() {
480 vector<double *> arrays_coord;
482 ReadUtilIface *iface;
484 CHKERR iface->get_node_coords(3, size, 0, startv, arrays_coord);
485 verts.insert(startv, startv + size - 1);
486 for (
int n = 0;
n != size; ++
n)
487 for (
auto d : {0, 1, 2})
488 arrays_coord[
d][
n] = coords[3 *
n +
d];
493 auto add_verts_to_field = [&]() {
501 CHKERR add_verts_to_field();
◆ delete_ents_by_bit_ref()
delete entities form mofem and moab database
Implements MoFEM::CoreInterface.
Definition at line 535 of file DeleteCore.cpp.
544 CHKERR BitRefManager(*this).getEntitiesByRefLevel(
bit, mask, ents, verb);
545 Range ents_meshsets = ents.subset_by_type(MBENTITYSET);
546 ents = subtract(ents, ents_meshsets);
549 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Nb. of deleted entities 0";
554 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"Deleted ents:\n" << ents;
564 CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets,
true);
565 for (
auto m : meshsets) {
571 if (
rval != MB_SUCCESS) {
574 MOFEM_LOG(
"SELF", Sev::noisy) <<
"Problem deleting:\n" << ents;
576 MOFEM_LOG(
"SELF", Sev::warning) <<
"Problem deleting:\n" << ents;
587 MOFEM_LOG_C(
"SELF", Sev::noisy,
"Nb. of deleted entities %d", ents.size());
◆ delete_field()
Delete field.
- Parameters
-
name | field name |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 609 of file DeleteCore.cpp.
611 auto &
f =
fIelds.get<FieldName_mi_tag>();
612 auto mit =
f.find(name);
613 if (mit ==
f.end()) {
615 "Finite element <%s> not found", name.c_str());
◆ delete_finite_element()
delete finite element from mofem database
Implements MoFEM::CoreInterface.
Definition at line 592 of file DeleteCore.cpp.
595 auto mit = fe.find(name);
596 if (mit == fe.end()) {
598 "Finite element <%s> not found", name.c_str());
◆ delete_problem()
Delete problem.
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Implements MoFEM::CoreInterface.
Definition at line 108 of file ProblemsCore.cpp.
110 auto p_miit =
pRoblems.get<Problem_mi_tag>().find(name);
111 if (p_miit ==
pRoblems.get<Problem_mi_tag>().end()) {
112 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"no such problem like < %s >",
116 pRoblems.get<Problem_mi_tag>().erase(p_miit);
◆ Finalize()
Checks for options to be called at the conclusion of the program.
MPI_Finalize() is called only if the user had not called MPI_Init() before calling Initialize.
- Note
- This function calls PetscInitialize, for more details see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscFinalize.html
- Returns
- MoFEMErrorCode
- Examples
- add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_blas.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_check_approx_in_3d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, matrix_function.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, petsc_smart_ptr_objects.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_broken_space.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, wave_equation.cpp, and wavy_surface.cpp.
Definition at line 112 of file Core.cpp.
114 PetscPopErrorHandler();
118 PetscBool is_finalized;
119 PetscFinalized(&is_finalized);
126 MPI_Finalized(&mpi_finalized);
◆ get_basic_entity_data_ptr()
Get pointer to basic entity data.
This structure keeps data like tags handlers and other data used to construct mofem entities, dofs and finite elements.
Implements MoFEM::CoreInterface.
Definition at line 290 of file Core.hpp.
◆ get_comm()
◆ get_comm_rank()
◆ get_comm_size()
◆ get_dofs() [1/2]
◆ get_dofs() [2/2]
◆ get_dofs_by_name_and_ent_begin()
DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_ent_begin |
( |
const std::string & |
field_name, |
|
|
const EntityHandle |
ent |
|
) |
| const |
|
protectedvirtual |
get begin iterator of field dofs of given name and ent(instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,ENT,IT)
for(IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP(MFIELD,NAME,ENT,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1381 of file FieldCore.cpp.
1383 return dofsField.get<Unique_mi_tag>().lower_bound(
◆ get_dofs_by_name_and_ent_end()
DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_ent_end |
( |
const std::string & |
field_name, |
|
|
const EntityHandle |
ent |
|
) |
| const |
|
protectedvirtual |
get begin iterator of field dofs of given name and ent (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,ENT,IT)
for(IT_GET_DOFS_FIELD_BY_NAME_AND_ENT_FOR_LOOP(MFIELD,NAME,ENT,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1388 of file FieldCore.cpp.
1390 return dofsField.get<Unique_mi_tag>().upper_bound(
◆ get_dofs_by_name_and_type_begin()
DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_type_begin |
( |
const std::string & |
field_name, |
|
|
const EntityType |
type |
|
) |
| const |
|
protectedvirtual |
get begin iterator of field dofs of given name and ent type (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,TYPE,IT)
for(IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP(MFIELD,NAME,TYPE,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1395 of file FieldCore.cpp.
1397 return dofsField.get<Unique_mi_tag>().lower_bound(
◆ get_dofs_by_name_and_type_end()
DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_and_type_end |
( |
const std::string & |
field_name, |
|
|
const EntityType |
type |
|
) |
| const |
|
protectedvirtual |
get begin iterator of field dofs of given name end ent type(instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,TYPE,IT)
for(IT_GET_DOFS_FIELD_BY_NAME_AND_TYPE_FOR_LOOP(MFIELD,NAME,TYPE,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1402 of file FieldCore.cpp.
1404 return dofsField.get<Unique_mi_tag>().upper_bound(
◆ get_dofs_by_name_begin()
DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_begin |
( |
const std::string & |
field_name | ) |
const |
|
protectedvirtual |
get begin iterator of field dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)
for(IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1371 of file FieldCore.cpp.
1372 return dofsField.get<Unique_mi_tag>().lower_bound(
◆ get_dofs_by_name_end()
DofEntityByUId::iterator MoFEM::Core::get_dofs_by_name_end |
( |
const std::string & |
field_name | ) |
const |
|
protectedvirtual |
get begin iterator of field dofs of given name (instead you can use IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)
for(IT_GET_DOFS_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1376 of file FieldCore.cpp.
1377 return dofsField.get<Unique_mi_tag>().upper_bound(
◆ get_ent_field_by_name_begin()
FieldEntityByUId::iterator MoFEM::Core::get_ent_field_by_name_begin |
( |
const std::string & |
field_name | ) |
const |
|
protectedvirtual |
get begin iterator of field ents of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)
for(IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1361 of file FieldCore.cpp.
1362 return entsFields.get<Unique_mi_tag>().lower_bound(
◆ get_ent_field_by_name_end()
FieldEntityByUId::iterator MoFEM::Core::get_ent_field_by_name_end |
( |
const std::string & |
field_name | ) |
const |
|
protectedvirtual |
get begin iterator of field dofs of given name (instead you can use IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)
for(IT_GET_ENT_FIELD_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 1366 of file FieldCore.cpp.
1367 return entsFields.get<Unique_mi_tag>().upper_bound(
◆ get_ents_elements_adjacency() [1/2]
Get the dofs elements adjacency object.
- Returns
- const FieldEntityEntFiniteElementAdjacencyMap_multiIndex*
Implements MoFEM::CoreInterface.
Definition at line 870 of file Core.cpp.
◆ get_ents_elements_adjacency() [2/2]
◆ get_ents_finite_elements() [1/2]
◆ get_ents_finite_elements() [2/2]
◆ get_fe_by_name_begin()
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator MoFEM::Core::get_fe_by_name_begin |
( |
const std::string & |
fe_name | ) |
const |
|
protectedvirtual |
get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)
for(IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 836 of file FECore.cpp.
837 auto miit =
finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
838 if (miit !=
finiteElements.get<FiniteElement_name_mi_tag>().end()) {
◆ get_fe_by_name_end()
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator MoFEM::Core::get_fe_by_name_end |
( |
const std::string & |
fe_name | ) |
const |
|
protectedvirtual |
get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)
for(IT_GET_FES_BY_NAME_FOR_LOOP(MFIELD,NAME,IT)) { ... }
- Parameters
-
Implements MoFEM::CoreInterface.
Definition at line 847 of file FECore.cpp.
848 auto miit =
finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
849 if (miit !=
finiteElements.get<FiniteElement_name_mi_tag>().end()) {
852 get_id_for_max_type<MBENTITYSET>(), (*miit)->getFEUId()));
◆ get_field_bit_number()
FieldBitNumber MoFEM::Core::get_field_bit_number |
( |
const std::string |
name | ) |
const |
|
protectedvirtual |
get field bit number
- Parameters
-
name | of field Example:auto field_number = mField.get_field_bit_number("DISPLACEMENT");
|
Implements MoFEM::CoreInterface.
Definition at line 28 of file FieldCore.cpp.
29 auto &set =
fIelds.get<FieldName_mi_tag>();
30 auto miit = set.find(name);
31 if (miit == set.end())
33 " > not in database (top tip: check spelling)");
34 return (*miit)->getBitNumber();
◆ get_field_entities_by_dimension()
MoFEMErrorCode MoFEM::Core::get_field_entities_by_dimension |
( |
const std::string |
name, |
|
|
int |
dim, |
|
|
Range & |
ents |
|
) |
| const |
|
protectedvirtual |
get entities in the field by dimension
- Parameters
-
name | field name |
dim | dim |
ents | ents |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 81 of file FieldCore.cpp.
87 CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents,
true);
◆ get_field_entities_by_handle()
MoFEMErrorCode MoFEM::Core::get_field_entities_by_handle |
( |
const std::string |
name, |
|
|
Range & |
ents |
|
) |
| const |
|
protectedvirtual |
◆ get_field_entities_by_type()
MoFEMErrorCode MoFEM::Core::get_field_entities_by_type |
( |
const std::string |
name, |
|
|
EntityType |
type, |
|
|
Range & |
ents |
|
) |
| const |
|
protectedvirtual |
get entities in the field by type
- Parameters
-
name | field name |
type | entity type |
ents | ents |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 91 of file FieldCore.cpp.
◆ get_field_ents() [1/2]
◆ get_field_ents() [2/2]
◆ get_field_id()
BitFieldId MoFEM::Core::get_field_id |
( |
const std::string & |
name | ) |
const |
|
protectedvirtual |
Get field Id.
- Parameters
-
- Returns
- BitFieldId
Implements MoFEM::CoreInterface.
Definition at line 18 of file FieldCore.cpp.
19 auto &set =
fIelds.get<FieldName_mi_tag>();
20 auto miit = set.find(name);
21 if (miit == set.end()) {
23 " > not in database (top tip: check spelling)");
25 return (*miit)->getId();
◆ get_field_meshset() [1/2]
Definition at line 45 of file FieldCore.cpp.
46 auto &set =
fIelds.get<BitFieldId_mi_tag>();
47 auto miit = set.find(
id);
48 if (miit == set.end())
49 THROW_MESSAGE(
"field not in database (top tip: check spelling)");
50 return (*miit)->meshSet;
◆ get_field_meshset() [2/2]
EntityHandle MoFEM::Core::get_field_meshset |
( |
const std::string |
name | ) |
const |
|
protectedvirtual |
◆ get_field_name()
std::string MoFEM::Core::get_field_name |
( |
const BitFieldId |
id | ) |
const |
|
protectedvirtual |
get field name from id
- Parameters
-
- Returns
- std::string
Implements MoFEM::CoreInterface.
Definition at line 37 of file FieldCore.cpp.
38 auto &set =
fIelds.get<BitFieldId_mi_tag>();
39 auto miit = set.find(
id);
40 if (miit == set.end())
41 THROW_MESSAGE(
"field not in database (top tip: check spelling)");
42 return (*miit)->getName();
◆ get_field_structure()
get field structure
If field is not found throw error if bh == MF_EXIST, or return nullptr if bh == MF_ZERO, i.e. otherwise
- Parameters
-
name | field name |
bh | controls behaviour |
- Returns
- const Field*
Implements MoFEM::CoreInterface.
Definition at line 65 of file FieldCore.cpp.
67 auto miit =
fIelds.get<FieldName_mi_tag>().find(name);
68 if (miit ==
fIelds.get<FieldName_mi_tag>().end()) {
72 std::string(
"field < " + name +
73 " > not in database (top tip: check spelling)")
◆ get_fields() [1/2]
◆ get_fields() [2/2]
◆ get_finite_element_entities_by_dimension()
MoFEMErrorCode MoFEM::Core::get_finite_element_entities_by_dimension |
( |
const std::string |
name, |
|
|
int |
dim, |
|
|
Range & |
ents |
|
) |
| const |
|
protectedvirtual |
get entities in the finite element by dimension
- Parameters
-
name | finite element name |
dim | dim |
ents | ents |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 286 of file FECore.cpp.
292 CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents,
true);
◆ get_finite_element_entities_by_handle()
MoFEMErrorCode MoFEM::Core::get_finite_element_entities_by_handle |
( |
const std::string |
name, |
|
|
Range & |
ents |
|
) |
| const |
|
protectedvirtual |
get entities in the finite element by handle
- Parameters
-
name | finite element name |
ents | ents |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 309 of file FECore.cpp.
◆ get_finite_element_entities_by_type()
MoFEMErrorCode MoFEM::Core::get_finite_element_entities_by_type |
( |
const std::string |
name, |
|
|
EntityType |
type, |
|
|
Range & |
ents |
|
) |
| const |
|
protectedvirtual |
get entities in the finite element by type
- Parameters
-
name | finite element name |
type | entity type |
ents | ents |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 296 of file FECore.cpp.
◆ get_finite_element_meshset() [1/2]
Definition at line 273 of file FECore.cpp.
275 auto miit = fe_by_id.find(
id);
276 if (miit == fe_by_id.end())
278 return (*miit)->meshset;
◆ get_finite_element_meshset() [2/2]
EntityHandle MoFEM::Core::get_finite_element_meshset |
( |
const std::string |
name | ) |
const |
|
protectedvirtual |
◆ get_finite_element_structure()
get finite element struture
If finite element is not found throw error if bh == MF_EXIST, or return nullptr if bh == MF_ZERO, i.e. otherwise
- Parameters
-
- Returns
- FiniteElement*
Implements MoFEM::CoreInterface.
Definition at line 18 of file FECore.cpp.
20 auto miit =
finiteElements.get<FiniteElement_name_mi_tag>().find(name);
21 if (miit ==
finiteElements.get<FiniteElement_name_mi_tag>().end()) {
25 std::string(
"finite element < " + name +
26 " > not in database (top tip: check spelling)")
◆ get_finite_elements() [1/2]
◆ get_finite_elements() [2/2]
◆ get_meshsets_manager() [1/2]
◆ get_meshsets_manager() [2/2]
◆ get_meshsets_manager_ptr() [1/2]
◆ get_meshsets_manager_ptr() [2/2]
◆ get_moab() [1/2]
◆ get_moab() [2/2]
◆ get_problem() [1/2]
MoFEMErrorCode MoFEM::Core::get_problem |
( |
const std::string & |
problem_name, |
|
|
const Problem ** |
problem_ptr |
|
) |
| const |
|
protectedvirtual |
Get problem database (data structure)
Implements MoFEM::CoreInterface.
Definition at line 801 of file Core.cpp.
805 const ProblemsByName &problems =
pRoblems.get<Problem_mi_tag>();
806 ProblemsByName::iterator p_miit = problems.find(problem_name);
807 if (p_miit == problems.end()) {
809 "problem < %s > not found, (top tip: check spelling)",
810 problem_name.c_str());
812 *problem_ptr = &*p_miit;
◆ get_problem() [2/2]
const Problem * MoFEM::Core::get_problem |
( |
const std::string |
problem_name | ) |
const |
|
protectedvirtual |
Get the problem object.
- Parameters
-
- Returns
- const Problem*
Implements MoFEM::CoreInterface.
Definition at line 891 of file Core.cpp.
894 "Problem of given name not found");
◆ get_problem_finite_elements_entities()
MoFEMErrorCode MoFEM::Core::get_problem_finite_elements_entities |
( |
const std::string |
name, |
|
|
const std::string & |
fe_name, |
|
|
const EntityHandle |
meshset |
|
) |
| |
|
protectedvirtual |
add finite elements to the meshset
- Parameters
-
name | is problem name |
fe_name | |
meshset | |
Implements MoFEM::CoreInterface.
Definition at line 911 of file FECore.cpp.
915 auto &prb =
pRoblems.get<Problem_mi_tag>();
916 auto p_miit = prb.find(problem_name);
917 if (p_miit == prb.end())
919 "No such problem like < %s >", problem_name.c_str());
921 auto fe_miit =
finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
922 if (fe_miit !=
finiteElements.get<FiniteElement_name_mi_tag>().end()) {
924 p_miit->numeredFiniteElementsPtr->get<Unique_mi_tag>().lower_bound(
926 0, (*fe_miit)->getFEUId()));
928 p_miit->numeredFiniteElementsPtr->get<Unique_mi_tag>().upper_bound(
930 get_id_for_max_type<MBENTITYSET>(), (*fe_miit)->getFEUId()));
932 if (miit != hi_miit) {
933 std::vector<EntityHandle> ents;
934 ents.reserve(std::distance(miit, hi_miit));
935 for (; miit != hi_miit; ++miit)
936 ents.push_back((*miit)->getEnt());
937 int part = (*miit)->getPart();
940 CHKERR get_moab().add_entities(meshset, &*ents.begin(), ents.size());
◆ get_problems() [1/2]
◆ get_problems() [2/2]
◆ get_ref_ents() [1/2]
◆ get_ref_ents() [2/2]
◆ get_ref_finite_elements() [1/2]
◆ get_ref_finite_elements() [2/2]
◆ get_th_RefBitEdge()
◆ get_th_RefBitLevel()
◆ get_th_RefParentHandle()
◆ getBitFEId()
BitFEId MoFEM::Core::getBitFEId |
( |
const std::string & |
fe_name | ) |
const |
|
protected |
Get field Id.
- Parameters
-
- Returns
- field id
Definition at line 255 of file FECore.cpp.
257 auto miit = fe_by_id.find(fe_name);
258 if (miit == fe_by_id.end())
260 (
"finite element < " + fe_name +
" > not found (top tip: check spelling)")
262 return (*miit)->getId();
◆ getBitFEIdName()
std::string MoFEM::Core::getBitFEIdName |
( |
const BitFEId |
id | ) |
const |
|
protected |
Get field name.
- Parameters
-
- Returns
- field name
Definition at line 265 of file FECore.cpp.
267 auto miit = fe_by_id.find(
id);
268 if (miit == fe_by_id.end())
270 return (*miit)->getName();
◆ getBitProblemId()
BitProblemId MoFEM::Core::getBitProblemId |
( |
const std::string & |
name | ) |
const |
|
protected |
Definition at line 121 of file ProblemsCore.cpp.
122 auto p_miit =
pRoblems.get<Problem_mi_tag>().find(name);
123 if (p_miit ==
pRoblems.get<Problem_mi_tag>().end()) {
126 return p_miit->getId();
◆ getBuildMoFEM()
Get flags/semaphores for different stages.
Definition at line 225 of file Core.hpp.
◆ getOptions()
Get core options from command line.
- Returns
- MoFEMErrorCode
Definition at line 755 of file Core.cpp.
761 "See MoFEM documentation");
764 "-mofem_init_fields",
"Initialise fields on construction",
"",
768 "-mofem_init_fields",
"Initialise fields on construction",
"",
774 ierr = PetscOptionsEnd();
◆ getProblemShift()
Return unique problem Id.
Each time this function is called, it gives new unit problem Id for bit.
◆ getRefEntity()
◆ getTags()
Get tag handles.
- Parameters
-
- Returns
- error code
Definition at line 551 of file Core.cpp.
557 "Root meshset should be 0");
569 auto check_tag_allocated = [](
auto &
rval) {
571 if (
rval == MB_ALREADY_ALLOCATED)
580 rval =
get_moab().tag_get_handle(
"_MoFEMBuild", 1, MB_TYPE_INTEGER,
591 const int def_part = -1;
593 MB_TAG_CREAT | MB_TAG_SPARSE, &def_part);
602 const int def_part = -1;
603 CHKERR get_moab().tag_get_handle(
"_MeshsetPartition", 1, MB_TYPE_INTEGER,
604 th_Part, MB_TAG_CREAT | MB_TAG_SPARSE,
607 CHKERR get_moab().tag_get_handle(
"_RefParentHandle", 1, MB_TYPE_HANDLE,
609 MB_TAG_CREAT | MB_TAG_SPARSE, &def_handle);
613 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_bit_level);
616 "_RefBitLevelMask",
sizeof(
BitRefLevel), MB_TYPE_OPAQUE,
618 &def_bit_level_mask);
622 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_bit_edge);
627 const unsigned long int def_id = 0;
630 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
634 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_space);
643 th_FieldBase, MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_base);
644 const int def_val_len = 0;
646 "_FieldName", def_val_len, MB_TYPE_OPAQUE,
th_FieldName,
647 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
649 "_FieldName_DataNamePrefix", def_val_len, MB_TYPE_OPAQUE,
651 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
656 const unsigned long int def_id = 0;
657 const int def_val_len = 0;
660 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
662 "_FEName", def_val_len, MB_TYPE_OPAQUE,
th_FEName,
663 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
666 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
669 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
672 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
677 const unsigned long int def_id = 0;
678 const int def_val_len = 0;
681 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
684 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_SPARSE, &def_id);
687 MB_TAG_CREAT | MB_TAG_BYTES | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
690 "_ProblemNbDofsRow",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
694 "_ProblemNbDofsCol",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
698 "_ProblemLocalNbDofsRow",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
702 "_ProblemGhostNbDofsRow",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
706 "_ProblemLocalNbDofsCol",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
710 "_ProblemGhostNbDofsCol",
sizeof(
DofIdx), MB_TYPE_OPAQUE,
716 MeshsetsManager *meshsets_manager_ptr;
718 CHKERR meshsets_manager_ptr->getTags(verb);
721 SeriesRecorder *series_recorder_ptr;
723 CHKERR series_recorder_ptr->getTags(verb);
◆ getValue()
◆ initialiseDatabaseFromMesh()
Initialize database getting information on mesh.
Definition at line 294 of file Core.cpp.
300 Range ref_elems_to_add;
304 CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets,
false);
305 Range special_meshsets;
306 for (
auto mit : meshsets) {
313 const void *tag_name;
316 th_FieldName, &mit, 1, (
const void **)&tag_name, &tag_name_size);
321 << boost::string_ref((
char *)tag_name, tag_name_size);
323 auto p =
fIelds.insert(boost::make_shared<Field>(
moab, mit));
333 special_meshsets.insert(mit);
342 std::pair<FiniteElement_multiIndex::iterator, bool> p =
344 boost::shared_ptr<FiniteElement>(
new FiniteElement(
moab, mit)));
346 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Read finite element " << **p.first;
349 CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents,
false);
351 ref_elems_to_add.merge(ents);
358 special_meshsets.insert(mit);
365 if (problem_id != 0) {
366 std::pair<Problem_multiIndex::iterator, bool> p =
369 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Read problem " << *p.first;
371 <<
"\tBitRef " << p.first->getBitRefLevel() <<
" BitMask "
372 << p.first->getBitRefLevelMask();
380 CHKERR get_moab().get_entities_by_type(mit, MBENTITYSET, ents,
true);
384 special_meshsets.insert(mit);
392 bit_ref_ents = subtract(bit_ref_ents, special_meshsets);
393 CHKERR getInterface<BitRefManager>()->filterEntitiesByRefLevel(
395 CHKERR getInterface<BitRefManager>()->setEntitiesBitRefLevel(bit_ref_ents);
396 CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
400 for (
auto field :
fIelds) {
401 if (field->getSpace() !=
NOSPACE) {
402 Range ents_of_id_meshset;
404 ents_of_id_meshset,
false);
423 MeshsetsManager *m_manger_ptr;
425 CHKERR m_manger_ptr->initialiseDatabaseFromMesh(verb);
426 SeriesRecorder *series_recorder_ptr;
428 CHKERR series_recorder_ptr->initialiseDatabaseFromMesh(verb);
◆ Initialize()
MoFEMErrorCode MoFEM::Core::Initialize |
( |
int * |
argc, |
|
|
char *** |
args, |
|
|
const char |
file[], |
|
|
const char |
help[] |
|
) |
| |
|
static |
Initializes the MoFEM database PETSc, MOAB and MPI.
- Note
- This function calls PetscInitialize, for more details see http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInitialize.html
Example:
int main(
int argc,
char *argv[]) {
try {
}
}
- Parameters
-
argc | count of number of command line arguments |
args | the command line arguments |
file | [optional] PETSc database file, also checks ~username/.petscrc
- and .petscrc use NULL to not check for code specific file. Use * -skip_petscrc in the code specific file to skip the .petscrc files
|
help | [optional] Help message to print, use NULL for no message |
- Returns
- MoFEMErrorCode
- Examples
- add_blockset.cpp, add_cubit_meshsets.cpp, adolc_plasticity.cpp, analytical_nonlinear_poisson.cpp, analytical_poisson.cpp, analytical_poisson_field_split.cpp, approx_sphere.cpp, bernstein_bezier_generate_base.cpp, bone_adaptation.cpp, boundary_marker.cpp, build_large_problem.cpp, build_problems.cpp, cell_forces.cpp, child_and_parent.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, cubit_bc_test.cpp, delete_ho_nodes.cpp, dg_projection.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, dynamic_first_order_con_law.cpp, edge_and_bubble_shape_functions_on_quad.cpp, eigen_elastic.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_blas.cpp, field_evaluator.cpp, field_to_vertices.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, free_surface.cpp, gauss_points_on_outer_product.cpp, hanging_node_approx.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_check_approx_in_3d.cpp, hdiv_divergence_operator.cpp, heat_equation.cpp, heat_method.cpp, hello_world.cpp, helmholtz.cpp, hertz_surface.cpp, higher_derivatives.cpp, level_set.cpp, log.cpp, loop_entities.cpp, lorentz_force.cpp, magnetostatic.cpp, matrix_function.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, meshset_to_vtk.cpp, minimal_surface_area.cpp, mixed_poisson.cpp, mortar_contact.cpp, mortar_contact_thermal.cpp, navier_stokes.cpp, node_merge.cpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, operators_tests.cpp, partition_mesh.cpp, petsc_smart_ptr_objects.cpp, phase.cpp, photon_diffusion.cpp, plastic.cpp, plate.cpp, plot_base.cpp, poisson_2d_dis_galerkin.cpp, poisson_2d_homogeneous.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, remove_entities_from_problem.cpp, remove_entities_from_problem_not_partitioned.cpp, scalar_check_approximation.cpp, schur_test_diag_mat.cpp, seepage.cpp, shallow_wave.cpp, simple_contact.cpp, simple_contact_thermal.cpp, simple_elasticity.cpp, simple_interface.cpp, simple_l2_only.cpp, split_sideset.cpp, tensor_divergence_operator.cpp, test_broken_space.cpp, test_cache_on_entities.cpp, test_jacobian_of_simple_contact_element.cpp, testing_jacobian_of_hook_element.cpp, testing_jacobian_of_hook_scaled_with_density_element.cpp, thermo_elastic.cpp, unsaturated_transport.cpp, wave_equation.cpp, and wavy_surface.cpp.
Definition at line 72 of file Core.cpp.
81 PetscInitialize(argc,
args, file,
help);
91 char petsc_version[255];
92 CHKERR PetscGetVersion(petsc_version, 255);
93 MOFEM_LOG_C(
"WORLD", Sev::inform,
"MoFEM version %d.%d.%d (%s %s)",
94 MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD,
95 MOAB_VERSION_STRING, petsc_version);
96 MOFEM_LOG_C(
"WORLD", Sev::inform,
"git commit id %s", GIT_SHA1_NAME);
98 auto log_time = [&](
const auto perefix,
auto time) {
100 << perefix << time.date().year() <<
"-" << time.date().month() <<
"-"
101 << time.date().day() <<
" " << time.time_of_day().hours() <<
":"
102 << time.time_of_day().minutes() <<
":" << time.time_of_day().seconds();
106 log_time(
"Local time: ", boost::posix_time::second_clock::local_time());
107 log_time(
"UTC time: ", boost::posix_time::second_clock::universal_time());
◆ list_dofs_by_field_name()
MoFEMErrorCode MoFEM::Core::list_dofs_by_field_name |
( |
const std::string & |
name | ) |
const |
|
protectedvirtual |
◆ list_fields()
◆ list_finite_elements()
◆ list_problem()
list problems
Implements MoFEM::CoreInterface.
Definition at line 129 of file ProblemsCore.cpp.
132 const ProblemById &set_id =
pRoblems.get<BitProblemId_mi_tag>();
133 ProblemById::iterator miit = set_id.begin();
134 for (; miit != set_id.end(); miit++) {
135 std::ostringstream ss;
136 ss << *miit << std::endl;
137 PetscPrintf(
mofemComm, ss.str().c_str());
◆ loop_dofs() [1/4]
Make a loop over dofs.
Implements MoFEM::CoreInterface.
Definition at line 531 of file ProblemsCore.cpp.
539 NumeredDofsByUId *dofs;
542 dofs = &problem_ptr->numeredRowDofsPtr->get<Unique_mi_tag>();
545 dofs = &problem_ptr->numeredColDofsPtr->get<Unique_mi_tag>();
559 auto miit = dofs->lower_bound(
561 auto hi_miit = dofs->upper_bound(
564 method.loopSize = std::distance(miit, hi_miit);
565 method.loHiFERank = std::make_pair(lower_rank, upper_rank);
567 CHKERR method.preProcess();
570 for (; miit != hi_miit; miit++, nn++) {
571 if ((*miit)->getPart() >= lower_rank && (*miit)->getPart() <= upper_rank) {
572 method.nInTheLoop = nn;
573 method.dofPtr = miit->get()->getDofEntityPtr();
574 method.dofNumeredPtr = *miit;
579 CHKERR method.postProcess();
◆ loop_dofs() [2/4]
Make a loop over dofs.
Implements MoFEM::CoreInterface.
Definition at line 617 of file ProblemsCore.cpp.
632 auto miit =
dofsField.get<Unique_mi_tag>().lower_bound(
634 auto hi_miit =
dofsField.get<Unique_mi_tag>().upper_bound(
637 method.loopSize = std::distance(miit, hi_miit);
640 CHKERR method.preProcess();
641 for (
int nn = 0; miit != hi_miit; miit++, nn++) {
642 method.nInTheLoop = nn;
643 method.dofPtr = *miit;
646 CHKERR method.postProcess();
◆ loop_dofs() [3/4]
Make a loop over dofs.
Implements MoFEM::CoreInterface.
Definition at line 583 of file ProblemsCore.cpp.
597 ProblemsByName &pRoblems_set =
pRoblems.get<Problem_mi_tag>();
598 ProblemsByName::iterator p_miit = pRoblems_set.find(problem_name);
599 if (p_miit == pRoblems_set.end())
600 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"problem not in database %s",
601 problem_name.c_str());
◆ loop_dofs() [4/4]
◆ loop_entities() [1/4]
Loop over field entities in the problem.
- Parameters
-
problem_ptr | |
field_name | |
rc | |
method | |
lower_rank | |
upper_rank | |
verb | |
- Returns
- MoFEMErrorCode
Implements MoFEM::CoreInterface.
Definition at line 650 of file ProblemsCore.cpp.
657 decltype(problem_ptr->numeredRowDofsPtr) dofs;
660 dofs = problem_ptr->numeredRowDofsPtr;
663 dofs = problem_ptr->numeredColDofsPtr;
667 "It works only with rows or columns");
678 auto miit = dofs->lower_bound(
680 auto hi_miit = dofs->upper_bound(
683 using FieldEntity_view_multiIndex = multi_index_container<
685 boost::shared_ptr<FieldEntity>,
696 FieldEntity_view_multiIndex ents_view;
697 auto hint = ents_view.begin();
698 for (; miit != hi_miit; ++miit)
699 if ((*miit)->getPart() >= lower_rank && (*miit)->getPart() <= upper_rank)
700 ents_view.emplace_hint(hint, (*miit)->getFieldEntityPtr());
704 method.loopSize = ents_view.size();
705 method.loHiFERank = std::make_pair(lower_rank, upper_rank);
707 CHKERR method.preProcess();
708 method.nInTheLoop = 0;
709 for (
auto &field_ent : ents_view) {
710 method.entPtr = field_ent;
714 CHKERR method.postProcess();
◆ loop_entities() [2/4]
Loop over field entities.
- Parameters
-
field_name | field entities |
method | user method |
ents | if given loop only on subset of entities in the field |
verb | |
- Returns
- MoFEMErrorCode
Implements MoFEM::CoreInterface.
Definition at line 742 of file ProblemsCore.cpp.
758 auto lo_eit =
entsFields.get<Unique_mi_tag>().lower_bound(
760 auto hi_eit =
entsFields.get<Unique_mi_tag>().upper_bound(
763 typedef multi_index_container<
764 boost::shared_ptr<FieldEntity>,
765 indexed_by<ordered_unique<
768 FieldEntity_view_multiIndex;
770 FieldEntity_view_multiIndex ents_view;
771 ents_view.insert(lo_eit, hi_eit);
773 method.loopSize = ents_view.size();
776 CHKERR method.preProcess();
777 method.nInTheLoop = 0;
780 for (
auto p = ents->const_pair_begin(); p != ents->const_pair_end(); ++p)
781 for (
auto feit = ents_view.lower_bound(p->first);
782 feit != ents_view.upper_bound(p->second); ++feit) {
783 method.entPtr = *feit;
788 for (
auto &field_ent : ents_view) {
789 method.entPtr = field_ent;
794 CHKERR method.postProcess();
◆ loop_entities() [3/4]
Loop over field entities in the problem.
- Parameters
-
problem_name | |
field_name | |
rc | |
method | |
lower_rank | |
upper_rank | |
verb | |
- Returns
- MoFEMErrorCode
Implements MoFEM::CoreInterface.
Definition at line 718 of file ProblemsCore.cpp.
726 auto &prb =
pRoblems.get<Problem_mi_tag>();
727 auto p_miit = prb.find(problem_name);
728 if (p_miit == prb.end())
729 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"problem not in database %s",
730 problem_name.c_str());
◆ loop_entities() [4/4]
◆ loop_finite_elements() [1/3]
Make a loop over finite elements on partitions from upper to lower rank.
This function is like swiss knife, is can be used to post-processing or matrix and vectors assembly. It makes loop over given finite element for given problem. The particular methods executed on each element are given by class derived form Interface::FEMethod. At beginning of each loop user defined function (method) preProcess() is called, for each element operator() is executed, at the end loop finalizes with user defined function (method) postProcess().
- Note
- If fe_ptr is given it is expected that multi-index is supbes of problem multi-index. If this is not the case behavior of the code is undetermined.
For more details please look to examples.
Interface::FEMethod
- Parameters
-
problem_ptr | pointer to problem consisting set of elements |
fe_name | name of element in problem |
method | class derived form Interface::FEMethod |
lower_rank | lower rank of process owned by finite element |
upper_rank | lower rank of process owned by finite element |
fe_ptr | pointer to finite elements multi-index |
bh | if bH = MF_EXIST, throws error if fe_name does not exist |
cache_data | cache data vector |
cache_row | cache row vector |
cache_col | cache row vector |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 427 of file ProblemsCore.cpp.
437 if (!cache_ptr.use_count()) {
438 tmp_cache_ptr = boost::make_shared<CacheTuple>();
440 method.cacheWeakPtr = tmp_cache_ptr;
442 method.cacheWeakPtr = cache_ptr;
446 fe_ptr = problem_ptr->numeredFiniteElementsPtr;
448 auto miit = fe_ptr->get<Composite_Name_And_Part_mi_tag>().lower_bound(
449 boost::make_tuple(fe_name, lower_rank));
450 auto hi_miit = fe_ptr->get<Composite_Name_And_Part_mi_tag>().upper_bound(
451 boost::make_tuple(fe_name, upper_rank));
453 if (miit == hi_miit && (bh &
MF_EXIST)) {
460 method.feName = fe_name;
462 std::distance(miit, hi_miit);
463 method.loHiFERank = std::make_pair(lower_rank, upper_rank);
468 CHKERR method.preProcess();
472 for (
int nn = 0; miit != hi_miit; miit++, nn++) {
474 method.nInTheLoop = nn;
475 method.numeredEntFiniteElementPtr = *miit;
477 if (method.exeTestHook) {
478 if (method.exeTestHook(&method)) {
489 CHKERR method.postProcess();
◆ loop_finite_elements() [2/3]
Make a loop over finite elements.
This function is like swiss knife, is can be used to post-processing or matrix and vectors assembly. It makes loop over given finite element for given problem. The particular methods executed on each element are given by class derived form Interface::FEMethod. At beginning of each loop user defined function (method) preProcess() is called, for each element operator() is executed, at the end loop finalizes with user defined function (method) postProcess().
Methods are executed only for local elements at given processor.
For more details pleas look to examples.
- Note
- If fe_ptr is given it is expected that multi-index is supbes of problem multi-index. If this is not the case behavior of the code is undetermined.
- Parameters
-
problem_name | problem consisting set of elements |
fe_name | name of element in problem |
method | class derived form Interface::FEMethod |
fe_ptr | pointer to finite elements multi-index |
bh | if bH = MF_EXIST, throws error if fe_name does not exist |
cache_tuple_ptr | cache |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 495 of file ProblemsCore.cpp.
505 bh, cache_ptr, verb);
◆ loop_finite_elements() [3/3]
Make a loop over finite elements on partitions from upper to lower rank.
This function is like swiss knife, is can be used to post-processing or matrix and vectors assembly. It makes loop over given finite element for given problem. The particular methods executed on each element are given by class derived form Interface::FEMethod. At beginning of each loop user defined function (method) preProcess() is called, for each element operator() is executed, at the end loop finalizes with user defined function (method) postProcess().
- Note
- If fe_ptr is given it is expected that multi-index is supbes of problem multi-index. If this is not the case behavior of the code is undetermined.
For more details please look to examples.
- Parameters
-
problem_name | pointer to problem consisting set of elements |
fe_name | name of element in problem |
method | class derived form Interface::FEMethod |
lower_rank | lower rank of process owned by finite element |
upper_rank | lower rank of process owned by finite element |
fe_ptr | pointer to finite elements multi-index |
bh | if bH = MF_EXIST, throws error if fe_name does not exist |
cache_data | cache data vector |
cache_row | cache row vector |
cache_col | cache row vector |
verb | verbosity level |
- Returns
- error code
Implements MoFEM::CoreInterface.
Definition at line 510 of file ProblemsCore.cpp.
519 auto &prb_by_name =
pRoblems.get<Problem_mi_tag>();
520 auto p_miit = prb_by_name.find(problem_name);
521 if (p_miit == prb_by_name.end())
523 problem_name.c_str());
526 fe_ptr, bh, cache_ptr, verb);
◆ make_shared_ref_entity()
◆ makeSharedRefEntity()
Definition at line 928 of file Core.cpp.
930 boost::shared_ptr<RefEntityTmp<0>> ref_ent_ptr;
934 ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
941 ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
948 ref_ent_ptr = boost::shared_ptr<RefEntityTmp<0>>(
955 THROW_MESSAGE(
"Core index can vary from -1 to MAX_CORE_TMP");
◆ modify_finite_element_add_field_col()
MoFEMErrorCode MoFEM::Core::modify_finite_element_add_field_col |
( |
const std::string & |
fe_name, |
|
|
const std::string |
name_row |
|
) |
| |
|
protectedvirtual |
set field col which finite element use
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | finite element name |
name | field name |
Implements MoFEM::CoreInterface.
Definition at line 182 of file FECore.cpp.
186 auto &finite_element_name_set =
188 auto it_fe = finite_element_name_set.find(fe_name);
189 if (it_fe == finite_element_name_set.end())
191 "this FiniteElement is there");
192 bool success = finite_element_name_set.modify(
193 it_fe, FiniteElement_col_change_bit_add(
get_field_id(name_col)));
196 "modification unsuccessful");
◆ modify_finite_element_add_field_data()
MoFEMErrorCode MoFEM::Core::modify_finite_element_add_field_data |
( |
const std::string & |
fe_name, |
|
|
const std::string |
name_field |
|
) |
| |
|
protectedvirtual |
set finite element field data
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | finite element name |
name | field name |
This function will set memory in the form of a vector
Implements MoFEM::CoreInterface.
Definition at line 138 of file FECore.cpp.
143 FiniteElements_by_name;
144 FiniteElements_by_name &finite_element_name_set =
146 FiniteElements_by_name::iterator it_fe =
147 finite_element_name_set.find(fe_name);
148 if (it_fe == finite_element_name_set.end())
150 "This finite element is not defined (advise: check spelling)");
151 bool success = finite_element_name_set.modify(
152 it_fe, FiniteElement_change_bit_add(
get_field_id(name_data)));
155 "modification unsuccessful");
◆ modify_finite_element_add_field_row()
MoFEMErrorCode MoFEM::Core::modify_finite_element_add_field_row |
( |
const std::string & |
fe_name, |
|
|
const std::string |
name_row |
|
) |
| |
|
protectedvirtual |
set field row which finite element use
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | finite element name |
name | field name |
Implements MoFEM::CoreInterface.
Definition at line 160 of file FECore.cpp.
165 FiniteElements_by_name;
166 FiniteElements_by_name &finite_element_name_set =
168 FiniteElements_by_name::iterator it_fe =
169 finite_element_name_set.find(fe_name);
170 if (it_fe == finite_element_name_set.end())
173 bool success = finite_element_name_set.modify(
174 it_fe, FiniteElement_row_change_bit_add(
get_field_id(name_row)));
177 "modification unsuccessful");
◆ modify_finite_element_adjacency_table()
modify finite element table, only for advanced user
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Using that functions means that you like to do something not usual.
Implements MoFEM::CoreInterface.
Definition at line 117 of file FECore.cpp.
123 FiniteElements_by_name;
124 FiniteElements_by_name &finite_element_name_set =
126 FiniteElements_by_name::iterator it_fe =
127 finite_element_name_set.find(fe_name);
128 if (it_fe == finite_element_name_set.end())
130 "This finite element is not defined (advise: check spelling)");
131 boost::shared_ptr<FiniteElement> fe;
133 fe->elementAdjacencyTable[
type] =
function;
◆ modify_finite_element_off_field_col()
MoFEMErrorCode MoFEM::Core::modify_finite_element_off_field_col |
( |
const std::string & |
fe_name, |
|
|
const std::string |
name_row |
|
) |
| |
|
protectedvirtual |
unset field col which finite element use
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | finite element name |
name | field name |
Implements MoFEM::CoreInterface.
Definition at line 238 of file FECore.cpp.
242 auto &finite_element_name_set =
244 auto it_fe = finite_element_name_set.find(fe_name);
245 if (it_fe == finite_element_name_set.end())
247 bool success = finite_element_name_set.modify(
248 it_fe, FiniteElement_col_change_bit_off(
get_field_id(name_col)));
251 "modification unsuccessful");
◆ modify_finite_element_off_field_data()
MoFEMErrorCode MoFEM::Core::modify_finite_element_off_field_data |
( |
const std::string & |
fe_name, |
|
|
const std::string |
name_field |
|
) |
| |
|
protectedvirtual |
unset finite element field data
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | finite element name |
name | field name |
This function will set memory in the form of a vector
Implements MoFEM::CoreInterface.
Definition at line 201 of file FECore.cpp.
205 auto &finite_element_name_set =
207 auto it_fe = finite_element_name_set.find(fe_name);
208 if (it_fe == finite_element_name_set.end())
210 bool success = finite_element_name_set.modify(
211 it_fe, FiniteElement_change_bit_off(
get_field_id(name_data)));
214 "modification unsuccessful");
◆ modify_finite_element_off_field_row()
MoFEMErrorCode MoFEM::Core::modify_finite_element_off_field_row |
( |
const std::string & |
fe_name, |
|
|
const std::string |
name_row |
|
) |
| |
|
protectedvirtual |
unset field row which finite element use
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | finite element name |
name | field name |
Implements MoFEM::CoreInterface.
Definition at line 219 of file FECore.cpp.
223 auto &finite_element_name_set =
225 auto it_fe = finite_element_name_set.find(fe_name);
226 if (it_fe == finite_element_name_set.end())
229 bool success = finite_element_name_set.modify(
230 it_fe, FiniteElement_row_change_bit_off(
get_field_id(name_row)));
233 "modification unsuccessful");
◆ modify_problem_add_finite_element()
MoFEMErrorCode MoFEM::Core::modify_problem_add_finite_element |
( |
const std::string |
name_problem, |
|
|
const std::string & |
fe_name |
|
) |
| |
|
protectedvirtual |
add finite element to problem, this add entities assigned to finite element to a particular problem
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | Problem name |
name | Finite Element name |
Implements MoFEM::CoreInterface.
Definition at line 143 of file ProblemsCore.cpp.
147 ProblemsByName &set =
pRoblems.get<Problem_mi_tag>();
148 ProblemsByName::iterator miit = set.find(name_problem);
149 if (miit == set.end()) {
150 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"this problem <%s> is not there",
151 name_problem.c_str());
154 bool success = set.modify(miit, ProblemFiniteElementChangeBitAdd(f_id));
157 "modification unsuccessful");
◆ modify_problem_mask_ref_level_add_bit()
MoFEMErrorCode MoFEM::Core::modify_problem_mask_ref_level_add_bit |
( |
const std::string & |
name_problem, |
|
|
const BitRefLevel & |
bit |
|
) |
| |
|
protectedvirtual |
set dof mask ref level for problem
Implements MoFEM::CoreInterface.
Definition at line 218 of file ProblemsCore.cpp.
222 ProblemsByName &set =
pRoblems.get<Problem_mi_tag>();
223 ProblemsByName::iterator miit = set.find(name_problem);
224 if (miit == set.end()) {
225 std::ostringstream ss;
227 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"this problem <%s> is there",
230 bool success = set.modify(miit, ProblemChangeRefLevelBitDofMaskAdd(
bit));
233 "modification unsuccessful");
◆ modify_problem_mask_ref_level_set_bit()
MoFEMErrorCode MoFEM::Core::modify_problem_mask_ref_level_set_bit |
( |
const std::string & |
name_problem, |
|
|
const BitRefLevel & |
bit |
|
) |
| |
|
protectedvirtual |
set dof mask ref level for problem
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
Implements MoFEM::CoreInterface.
Definition at line 238 of file ProblemsCore.cpp.
242 ProblemsByName &set =
pRoblems.get<Problem_mi_tag>();
243 ProblemsByName::iterator miit = set.find(name_problem);
244 if (miit == set.end()) {
245 std::ostringstream ss;
247 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"this problem <%s> is there",
250 bool success = set.modify(miit, ProblemChangeRefLevelBitDofMaskSet(
bit));
253 "modification unsuccessful");
◆ modify_problem_ref_level_add_bit()
add ref level to problem
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
if same finite element is solved using different level of refinements, than the level of refinement has to be specificied to problem in query
- Parameters
-
name | Problem name |
BitRefLevel | bitLevel Example:
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF1","ELASTIC");
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF2","ELASTIC");
mField.modify_problem_ref_level_add_bit("BEAM_BENDING_ON_MESH_REF1",bit_level1);
mField.modify_problem_ref_level_add_bit("BEAM_BENDING_ON_MESH_REF2",bit_level2);
Two Problems exist and solved independently, both are elastic, but solved using different mesh refinement
|
Implements MoFEM::CoreInterface.
Definition at line 181 of file ProblemsCore.cpp.
185 ProblemsByName &set =
pRoblems.get<Problem_mi_tag>();
186 ProblemsByName::iterator miit = set.find(name_problem);
187 std::ostringstream ss;
189 if (miit == set.end())
190 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"this problem <%s> is there",
192 bool success = set.modify(miit, ProblemChangeRefLevelBitAdd(
bit));
194 SETERRQ(PETSC_COMM_SELF, 1,
"modification unsuccessful");
◆ modify_problem_ref_level_set_bit()
set ref level for problem
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
if same finite element is solved using different level of refinements, than the level of refinement has to be specificied to problem in query
- Parameters
-
name | Problem name |
BitRefLevel | bitLevel Example:
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF1","ELASTIC");
mField.modify_problem_add_finite_element("BEAM_BENDING_ON_MESH_REF2","ELASTIC");
mField.modify_problem_ref_level_set_bit("BEAM_BENDING_ON_MESH_REF1",bit_level1);
mField.modify_problem_ref_level_set_bit("BEAM_BENDING_ON_MESH_REF2",bit_level2);
Two Problems exist and solved independently, both are elastic, but solved using different mesh refinement
|
Implements MoFEM::CoreInterface.
Definition at line 199 of file ProblemsCore.cpp.
203 ProblemsByName &set =
pRoblems.get<Problem_mi_tag>();
204 ProblemsByName::iterator miit = set.find(name_problem);
205 std::ostringstream ss;
207 if (miit == set.end())
208 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"this problem <%s> is there",
210 bool success = set.modify(miit, ProblemChangeRefLevelBitSet(
bit));
213 "modification unsuccessful");
◆ modify_problem_unset_finite_element()
MoFEMErrorCode MoFEM::Core::modify_problem_unset_finite_element |
( |
const std::string |
name_problem, |
|
|
const std::string & |
fe_name |
|
) |
| |
|
protectedvirtual |
unset finite element from problem, this remove entities assigned to finite element to a particular problem
Note: If problem is build, it need to be cleaned to make this effective
- Note
- add_file is a collective, should be executed on all processors. Otherwise could lead to deadlock.
- Parameters
-
name | Problem name |
name | Finite Element name |
Implements MoFEM::CoreInterface.
Definition at line 162 of file ProblemsCore.cpp.
166 ProblemsByName &set =
pRoblems.get<Problem_mi_tag>();
167 ProblemsByName::iterator miit = set.find(name_problem);
168 if (miit == set.end()) {
169 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"this problem <%s> is not there",
170 name_problem.c_str());
173 bool success = set.modify(miit, ProblemFiniteElementChangeBitUnSet(f_id));
176 "modification unsuccessful");
◆ problem_basic_method_postProcess() [1/2]
Set data for BasicMethod.
This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.
FIXME: Here we need example
- Parameters
-
pointer | to problem data structure |
method | user method derived from BasicMethod |
Implements MoFEM::CoreInterface.
Definition at line 395 of file ProblemsCore.cpp.
401 CHKERR method.postProcess();
◆ problem_basic_method_postProcess() [2/2]
Set data for BasicMethod.
This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.
FIXME: Here we need example
- Parameters
-
problem_name | name of the problem |
method | user method derived from BasicMethod |
Implements MoFEM::CoreInterface.
Definition at line 408 of file ProblemsCore.cpp.
416 ProblemsByName &pRoblems_set =
pRoblems.get<Problem_mi_tag>();
417 ProblemsByName::iterator p_miit = pRoblems_set.find(problem_name);
418 if (p_miit == pRoblems_set.end())
419 SETERRQ1(
mofemComm, 1,
"problem is not in database %s",
420 problem_name.c_str());
◆ problem_basic_method_preProcess() [1/2]
Set data for BasicMethod.
This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.
FIXME: Here we need example
- Parameters
-
pointer | to problem data structure |
method | user method derived from BasicMethod |
Implements MoFEM::CoreInterface.
Definition at line 363 of file ProblemsCore.cpp.
372 CHKERR method.preProcess();
◆ problem_basic_method_preProcess() [2/2]
Set data for BasicMethod.
This function set data about problem, adjacencies and other multi-indices in database. This function can be used a special case when user need to do some pre- and post-processing before matrix or vector is initiated, or to assemble matrix for group of FEMethods. Is used by classes SnesCtx and TsCtx. Look for more details there.
FIXME: Here we need example
- Parameters
-
problem_name | name of the problem |
method | user method derived from BasicMethod |
Implements MoFEM::CoreInterface.
Definition at line 378 of file ProblemsCore.cpp.
385 ProblemsByName &pRoblems_set =
pRoblems.get<Problem_mi_tag>();
386 ProblemsByName::iterator p_miit = pRoblems_set.find(problem_name);
387 if (p_miit == pRoblems_set.end())
388 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"problem is not in database %s",
389 problem_name.c_str());
◆ query_interface()
Getting interface of core database.
- Parameters
-
uuid | unique ID of interface |
iface | returned pointer to interface |
- Returns
- error code
Implements MoFEM::UnknownInterface.
Definition at line 43 of file Core.cpp.
47 if (type_index == boost::typeindex::type_id<CoreInterface>()) {
48 *iface =
static_cast<CoreInterface *
>(
const_cast<Core *
>(
this));
50 }
else if (type_index ==
51 boost::typeindex::type_id<DeprecatedCoreInterface>()) {
52 *iface =
static_cast<DeprecatedCoreInterface *
>(
const_cast<Core *
>(
this));
57 auto it =
iFaces.find(type_index);
◆ rebuild_database()
◆ regEvents()
Register petsc events.
- Template Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 184 of file Core.cpp.
186 auto ptr = boost::make_shared<IFACE>();
190 auto get_event_options = [](
auto *
const ptr) {
193 CHKERR get_event_options(ptr.get());
◆ registerSubInterfaces()
Register insterfaces.
- Returns
- MoFEMErrorCode
Definition at line 463 of file Core.cpp.
469 CHKERR regSubInterface<LogManager>();
470 CHKERR regSubInterface<Simple>();
471 CHKERR regSubInterface<OperatorsTester>();
472 CHKERR regSubInterface<PipelineManager>();
473 CHKERR regSubInterface<ProblemsManager>();
474 CHKERR regSubInterface<MatrixManager>();
475 CHKERR regSubInterface<ISManager>();
476 CHKERR regSubInterface<VecManager>();
477 CHKERR regSubInterface<FieldBlas>();
478 CHKERR regSubInterface<BitRefManager>();
479 CHKERR regSubInterface<Tools>();
480 CHKERR regSubInterface<CommInterface>();
481 CHKERR regSubInterface<MeshsetsManager>();
482 CHKERR regSubInterface<NodeMergerInterface>();
483 CHKERR regSubInterface<PrismsFromSurfaceInterface>();
484 CHKERR regSubInterface<MeshRefinement>();
485 CHKERR regSubInterface<PrismInterface>();
486 CHKERR regSubInterface<CutMeshInterface>();
487 CHKERR regSubInterface<SeriesRecorder>();
489 CHKERR regSubInterface<TetGenInterface>();
492 CHKERR regSubInterface<MedInterface>();
494 CHKERR regSubInterface<FieldEvaluatorInterface>();
495 CHKERR regSubInterface<BcManager>();
498 CHKERR regEvents<SchurEvents>();
◆ regSubInterface()
Register sub-interfaces in core interface.
- Template Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 166 of file Core.cpp.
168 CHKERR registerInterface<IFACE>(
true);
169 IFACE *ptr =
new IFACE(*
this);
174 auto get_sub_iface_options = [](
auto *
const ptr) {
177 CHKERR get_sub_iface_options(ptr);
179 auto type_idx = boost::typeindex::type_id<IFACE>();
180 iFaces.insert(type_idx, ptr);
◆ remove_ents()
remove entities form mofem database
Implements MoFEM::CoreInterface.
Definition at line 429 of file DeleteCore.cpp.
436 for (Range::const_pair_iterator p_eit = ents.pair_begin();
437 p_eit != ents.pair_end(); ++p_eit) {
439 RefElement_multiIndex::index<Ent_mi_tag>::type::iterator frit, hi_frit;
445 RefEntity_multiIndex::index<Ent_mi_tag>::type::iterator rit, hi_rit;
◆ remove_ents_by_bit_ref()
◆ remove_ents_from_field() [1/3]
◆ remove_ents_from_field() [2/3]
◆ remove_ents_from_field() [3/3]
◆ remove_ents_from_field_by_bit_ref()
◆ remove_ents_from_finite_element() [1/3]
◆ remove_ents_from_finite_element() [2/3]
◆ remove_ents_from_finite_element() [3/3]
◆ remove_ents_from_finite_element_by_bit_ref()
remove elements from given refinement level to finite element database
- Parameters
-
BitRefLevel | bit |
BitRefLevel | mask |
verbose | level |
Implements MoFEM::CoreInterface.
Definition at line 418 of file DeleteCore.cpp.
424 CHKERR BitRefManager(*this).getEntitiesByRefLevel(
bit, mask, ents, verb);
◆ remove_parents_by_bit_ref()
Remove parent from entities on bit level.
Evert entity created by refinement, split or any other change on the mesh can have parent. This function remove parent from entity,
- Note
- Functions makeing topological changes on entities should repsect parents child relation. This erase that relation. If you going to split faces and create interface is recommended to call this function before split opeartion.
- Parameters
-
bit | level |
mask | of bit level |
verb | verbosity level |
- Returns
- MoFEMErrorCode
Implements MoFEM::CoreInterface.
Definition at line 465 of file DeleteCore.cpp.
472 CHKERR BitRefManager(*this).getEntitiesByRefLevel(
bit, mask, ents, verb);
◆ remove_parents_by_ents()
Remove parents from entities.
Implements MoFEM::CoreInterface.
Definition at line 477 of file DeleteCore.cpp.
480 std::vector<EntityHandle> leftovers_ents;
481 leftovers_ents.reserve(ents.size());
483 for (
auto pit = ents.pair_begin(); pit != ents.pair_end(); ++pit) {
488 for (;
f <= s; ++
f) {
490 auto check = [
this](
auto lo,
auto f) {
493 if ((*lo)->getEnt() ==
f)
502 "Operation of removing parent unsuccessful");
505 leftovers_ents.emplace_back(
f);
509 if (!leftovers_ents.empty()) {
510 std::vector<EntityHandle> zero_parents(leftovers_ents.size());
512 leftovers_ents.size(),
513 &*zero_parents.begin());
◆ remove_parents_by_parents()
Remove paremts from entities having parents in passed range.
Implements MoFEM::CoreInterface.
Definition at line 518 of file DeleteCore.cpp.
520 for (Range::iterator eit = ents.begin(); eit != ents.end(); ++eit) {
521 RefEntity_multiIndex::index<Ent_Ent_mi_tag>::type::iterator it;
525 it, RefEntity_change_parent(0));
528 "Operation of removing parent unsuccessful");
◆ set_field_order() [1/4]
◆ set_field_order() [2/4]
Set order approximation of the entities in the field.
- Note
- not collective
- Parameters
-
meshset | containing set of the entities (use 0 for all the entities in the meshset) |
type | selected type of the entities f.e. MBTET, MBTRI, MBEDGE, MBVERTEX, see moab documentation |
order | approximation order |
Implements MoFEM::CoreInterface.
Definition at line 967 of file FieldCore.cpp.
◆ set_field_order() [3/4]
Definition at line 930 of file FieldCore.cpp.
945 <<
"Field " << (*field_it)->getName() <<
" core value < "
946 << this->
getValue() <<
" > field value ( "
947 <<
static_cast<int>((*field_it)->getBitNumber()) <<
" )"
948 <<
" nb. of ents " << ents.size();
◆ set_field_order() [4/4]
Set order approximation of the entities in the field.
- Note
- not collective
- Parameters
-
entities | |
type | selected type of the entities f.e. MBTET, MBTRI, MBEDGE, MBVERTEX, see moab documentation |
order | approximation order |
Implements MoFEM::CoreInterface.
Definition at line 978 of file FieldCore.cpp.
◆ set_field_order_by_entity_type_and_bit_ref() [1/2]
◆ set_field_order_by_entity_type_and_bit_ref() [2/2]
Set order approximation of the entities in the field.
- Note
- not collective
- Parameters
-
bit | refinement level |
mask | bit mask |
type | selected type of the entities f.e. MBTET, MBTRI, MBEDGE, MBVERTEX, see moab documentation |
order | approximation order |
Implements MoFEM::CoreInterface.
Definition at line 1001 of file FieldCore.cpp.
1009 CHKERR BitRefManager(*this).getEntitiesByTypeAndRefLevel(
bit, mask,
type,
◆ set_moab_interface()
◆ setFieldOrder()
◆ setFieldOrderImpl()
Definition at line 506 of file FieldCore.cpp.
516 const auto field_meshset = field_ptr->getMeshset();
517 const auto bit_number = field_ptr->getBitNumber();
520 Range ents_of_id_meshset;
521 CHKERR get_moab().get_entities_by_handle(field_meshset, ents_of_id_meshset,
523 Range field_ents = intersect(ents, ents_of_id_meshset);
526 "change nb. of ents for order in the field <%s> %d",
527 field_ptr->getName().c_str(), field_ents.size(), ents.size());
531 auto eiit =
entsFields.get<Unique_mi_tag>().lower_bound(
534 if (eiit !=
entsFields.get<Unique_mi_tag>().end()) {
535 auto hi_eiit =
entsFields.get<Unique_mi_tag>().upper_bound(
537 std::copy(eiit, hi_eiit, std::back_inserter(ents_id_view));
542 "current nb. of ents in the multi index field <%s> %d",
543 field_ptr->getName().c_str(), ents_id_view.size());
546 int nb_ents_set_order_up = 0;
547 int nb_ents_set_order_down = 0;
548 int nb_ents_set_order_new = 0;
550 FieldEntity_change_order modify_order_no_size_change(
order,
false);
551 FieldEntity_change_order modify_order_size_change(
order,
true);
553 for (
auto pit = field_ents.const_pair_begin();
554 pit != field_ents.const_pair_end(); pit++) {
561 switch (field_ptr->getSpace()) {
565 if (
type == MBVERTEX)
567 "Hcurl space on vertices makes no sense");
571 if (
type == MBVERTEX)
573 "Hdiv space on vertices makes no sense");
577 "Hdiv space on edges makes no sense");
585 Range ents_in_database;
586 auto vit = ents_id_view.get<1>().lower_bound(first);
587 auto hi_vit = ents_id_view.get<1>().upper_bound(second);
589 for (; vit != hi_vit; ++vit) {
590 ents_in_database.insert(vit->get()->getEnt());
593 (*vit)->getMaxOrder();
595 if (old_approximation_order !=
order) {
597 FieldEntity_multiIndex::iterator miit =
598 entsFields.get<Unique_mi_tag>().find((*vit)->getLocalUniqueId());
600 if ((*miit)->getMaxOrder() <
order)
601 nb_ents_set_order_up++;
602 if ((*miit)->getMaxOrder() >
order)
603 nb_ents_set_order_down++;
609 bool can_change_size =
true;
610 auto dit =
dofsField.get<Unique_mi_tag>().lower_bound(
613 if (dit !=
dofsField.get<Unique_mi_tag>().end()) {
614 auto hi_dit =
dofsField.get<Unique_mi_tag>().upper_bound(
619 can_change_size =
false;
620 for (; dit != hi_dit; dit++) {
621 if ((*dit)->getDofOrder() >
order) {
623 DofEntity_active_change(
false));
626 "modification unsuccessful");
633 can_change_size ? modify_order_size_change
634 : modify_order_no_size_change);
637 "modification unsuccessful");
642 Range new_ents = subtract(
Range(first, second), ents_in_database);
643 for (Range::const_pair_iterator pit = new_ents.const_pair_begin();
644 pit != new_ents.const_pair_end(); ++pit) {
645 const auto first = pit->first;
646 const auto second = pit->second;
647 const auto ent_type =
get_moab().type_from_handle(first);
649 if (!field_ptr->getFieldOrderTable()[ent_type])
651 "Number of degrees of freedom for entity %s for %s space on "
654 moab::CN::EntityTypeName(ent_type),
655 field_ptr->getSpaceName().c_str(),
656 field_ptr->getApproxBaseName().c_str());
658 auto get_nb_dofs_on_order = [&](
const int order) {
659 return order >= 0 ? (field_ptr->getFieldOrderTable()[ent_type])(
order)
662 const int nb_dofs_on_order = get_nb_dofs_on_order(
order);
663 if (nb_dofs_on_order ||
order == -1) {
665 const int field_rank = field_ptr->getNbOfCoeffs();
666 const int nb_dofs = nb_dofs_on_order * field_rank;
672 auto create_tags_for_max_order = [&](
const Range &ents) {
675 std::vector<ApproximationOrder> o_vec(ents.size(),
order);
682 auto create_tags_for_data = [&](
const Range &ents) {
687 if (ent_type == MBVERTEX) {
688 std::vector<FieldData> d_vec(nb_dofs * ents.size(), 0);
690 ents, &*d_vec.begin());
692 std::vector<int> tag_size(ents.size(), nb_dofs);
693 std::vector<FieldData> d_vec(nb_dofs, 0);
694 std::vector<void const *> d_vec_ptr(ents.size(),
706 auto get_ents_in_ref_ent = [&](
auto miit_ref_ent) {
709 for (; miit_ref_ent != hi; ++miit_ref_ent)
710 in.insert(miit_ref_ent->get()->getEnt());
714 auto get_ents_max_order = [&](
const Range &ents) {
715 boost::shared_ptr<std::vector<const void *>> vec(
716 new std::vector<const void *>());
717 vec->resize(ents.size());
723 auto get_ents_field_data_vector_adaptor =
724 [&](
const Range &ents,
725 boost::shared_ptr<std::vector<const void *>> &ents_max_orders) {
727 boost::shared_ptr<std::vector<double *>> vec(
728 new std::vector<double *>());
729 vec->reserve(ents.size());
731 if (
order >= 0 && nb_dofs == 0) {
733 for (
int i = 0;
i != ents.size(); ++
i)
734 vec->emplace_back(
nullptr);
736 moab::ErrorCode
rval;
737 std::vector<int> tag_size(ents.size());
738 std::vector<const void *> d_vec_ptr(ents.size());
741 if (ent_type == MBVERTEX)
742 rval =
get_moab().tag_get_by_ptr(field_ptr->th_FieldDataVerts,
743 ents, &*d_vec_ptr.begin(),
746 rval =
get_moab().tag_get_by_ptr(field_ptr->th_FieldData,
747 ents, &*d_vec_ptr.begin(),
750 auto cast = [](
auto p) {
756 if (
rval == MB_SUCCESS) {
758 auto tit = d_vec_ptr.begin();
759 auto oit = ents_max_orders->begin();
760 for (
auto sit = tag_size.begin(); sit != tag_size.end();
762 vec->emplace_back(cast(*tit));
766 for (
int i = 0;
i != ents.size(); ++
i)
767 vec->emplace_back(
nullptr);
772 auto oit = ents_max_orders->begin();
773 auto dit = vec->begin();
774 for (
auto eit = ents.begin(); eit != ents.end();
775 ++eit, ++oit, ++dit) {
777 const int ent_order =
779 const int ent_nb_dofs = get_nb_dofs_on_order(ent_order);
784 if (ent_type == MBVERTEX) {
786 field_ptr->th_FieldDataVerts, &*eit, 1, &ret_val,
790 field_ptr->th_FieldData, &*eit, 1, &ret_val,
792 if (
rval != MB_SUCCESS) {
794 const int set_tag_size[] = {ent_nb_dofs * field_rank};
795 std::array<FieldData, MAX_DOFS_ON_ENTITY> set_d_vec;
796 std::fill(set_d_vec.begin(),
797 &set_d_vec[set_tag_size[0]], 0);
798 const void *set_d_vec_ptr[] = {set_d_vec.data()};
800 field_ptr->th_FieldData, &*eit, 1, set_d_vec_ptr,
803 field_ptr->th_FieldData, &*eit, 1, &ret_val,
806 if (
rval != MB_SUCCESS) {
811 <<
"Error is triggered in MOAB, field tag data "
812 "for same reason can not be for accessed.";
814 <<
"Set order: " <<
order;
816 <<
"Nb. dofs on entity for given order: "
820 << moab::CN::EntityTypeName(ent_type);
822 <<
"Field: " << *field_ptr;
827 const_cast<FieldData *&
>(*dit) = cast(ret_val);
835 auto ents_in_ref_ent = get_ents_in_ref_ent(miit_ref_ent);
837 CHKERR create_tags_for_max_order(ents_in_ref_ent);
838 CHKERR create_tags_for_data(ents_in_ref_ent);
839 auto ents_max_order = get_ents_max_order(ents_in_ref_ent);
840 auto ent_field_data =
841 get_ents_field_data_vector_adaptor(ents_in_ref_ent, ents_max_order);
844 auto ents_array = boost::make_shared<std::vector<FieldEntity>>();
849 ents_array->reserve(second - first + 1);
850 auto vit_max_order = ents_max_order->begin();
851 auto vit_field_data = ent_field_data->begin();
852 for (
int i = 0;
i != ents_in_ref_ent.size(); ++
i) {
854 ents_array->emplace_back(
855 field_ptr, *miit_ref_ent,
856 boost::shared_ptr<double *const>(ent_field_data,
858 boost::shared_ptr<const int>(
859 ents_max_order,
static_cast<const int *
>(*vit_max_order)));
864 if (!ents_array->empty())
865 if ((*ents_array)[0].getFieldRawPtr() != field_ptr.get())
867 "Get field ent poiter and field pointer do not match for "
869 field_ptr->getName().c_str());
870 nb_ents_set_order_new += ents_array->size();
874 if (ents_in_ref_ent.size() < (second - first + 1)) {
875 Range ents_not_in_database =
876 subtract(
Range(first, second), ents_in_ref_ent);
877 std::vector<const void *> vec_bits(ents_not_in_database.size());
881 auto cast = [](
auto p) {
884 for (
auto v : vec_bits)
887 "Try to add entities which are not seeded or added to "
893 for (
auto &
v : *ents_array)
894 hint =
entsFields.emplace_hint(hint, ents_array, &
v);
901 "nb. of entities in field <%s> for which order was "
902 "increased %d (order %d)",
903 field_ptr->getName().c_str(), nb_ents_set_order_up,
order);
905 "nb. of entities in field <%s> for which order was "
906 "reduced %d (order %d)",
907 field_ptr->getName().c_str(), nb_ents_set_order_down,
order);
910 "nb. of entities in field <%s> for which order set %d (order %d)",
911 field_ptr->getName().c_str(), nb_ents_set_order_new,
order);
915 auto eiit =
entsFields.get<Unique_mi_tag>().lower_bound(
917 auto hi_eiit =
entsFields.get<Unique_mi_tag>().upper_bound(
920 "nb. of ents in the multi index field <%s> %d",
921 field_ptr->getName().c_str(), std::distance(eiit, hi_eiit));
◆ setMoabInterface()
◆ setRefEntBasicDataPtr()
Definition at line 909 of file Core.cpp.
917 set_ref_ent_basic_data_ptr_impl<0>(ptr);
920 set_ref_ent_basic_data_ptr_impl<1>(ptr);
923 THROW_MESSAGE(
"Core index can vary from -1 to MAX_CORE_TMP");
◆ basicEntityDataPtr
- Returns
- pointer to BasicEntityData structure
BasicEntityData is structure which every BasicEntity have. It keeps data about tags to handles on the mesh, in particular tag to BitRefLevel and tag with handle to parent.
Definition at line 281 of file Core.hpp.
◆ buildMoFEM
keeps flags/semaphores for different stages
Definition at line 1046 of file Core.hpp.
◆ dofsField
dofs on fields
Definition at line 305 of file Core.hpp.
◆ entFEAdjacencies
adjacencies of elements to dofs
Definition at line 311 of file Core.hpp.
◆ entsFields
entities on fields
Definition at line 304 of file Core.hpp.
◆ entsFiniteElements
finite element entities
Definition at line 308 of file Core.hpp.
◆ fIelds
◆ finiteElements
finite elements
Definition at line 307 of file Core.hpp.
◆ iFaces
Hash map of pointers to interfaces.
Definition at line 1044 of file Core.hpp.
◆ initaliseAndBuildField
If true build field on database initialisation
Definition at line 1050 of file Core.hpp.
◆ initaliseAndBuildFiniteElements
◆ isGloballyInitialised
bool MoFEM::Core::isGloballyInitialised = false |
|
staticprotected |
Core base globally initialized.
Definition at line 1056 of file Core.hpp.
◆ isInitialized
PetscBool MoFEM::Core::isInitialized |
|
staticprotected |
petsc was initialised by other agent
Definition at line 1058 of file Core.hpp.
◆ moab
◆ MOFEM_EVENT_createMat
◆ MOFEM_EVENT_operator
Event for evaluating operator of finite element.
Definition at line 1001 of file Core.hpp.
◆ MOFEM_EVENT_postProcess
Event for postProcess finite element.
Definition at line 1003 of file Core.hpp.
◆ MOFEM_EVENT_preProcess
Event for preProcess finite element.
Definition at line 999 of file Core.hpp.
◆ mofemComm
◆ mpiInitialised
int MoFEM::Core::mpiInitialised |
|
staticprotected |
mpi was initialised by other agent
Definition at line 1057 of file Core.hpp.
◆ optionsPrefix
Prefix for options on command line.
Definition at line 1048 of file Core.hpp.
◆ pComm
MOAB communicator structure.
Definition at line 1013 of file Core.hpp.
◆ pRoblems
problems multi-index
Definition at line 313 of file Core.hpp.
◆ rAnk
MOFEM communicator rank.
Definition at line 1016 of file Core.hpp.
◆ refinedEntities
refined entities
Definition at line 300 of file Core.hpp.
◆ refinedFiniteElements
refined elements
Definition at line 301 of file Core.hpp.
◆ sIze
◆ th_ElemType
Needed for VTK files.
Definition at line 269 of file Core.hpp.
◆ th_FEId
◆ th_FEIdCol
◆ th_FEIdData
◆ th_FEIdRow
◆ th_FEName
◆ th_FieldBase
◆ th_FieldContinuity
◆ th_FieldId
◆ th_FieldName
◆ th_FieldName_DataNamePrefix
◆ th_FieldSpace
◆ th_MoFEMBuild
Internal use storing state, used to detect error and inconsistencies
Definition at line 270 of file Core.hpp.
◆ th_Part
Tag for partition number.
Definition at line 257 of file Core.hpp.
◆ th_ProblemFEId
◆ th_ProblemGhostNbDofCol
◆ th_ProblemGhostNbDofRow
◆ th_ProblemId
◆ th_ProblemLocalNbDofCol
◆ th_ProblemLocalNbDofRow
◆ th_ProblemName
◆ th_ProblemNbDofsCol
◆ th_ProblemNbDofsRow
◆ th_ProblemShift
◆ th_RefBitEdge
◆ th_RefBitLevel
◆ th_RefBitLevel_Mask
◆ th_RefFEMeshset
◆ th_RefParentHandle
◆ value
◆ verbose
◆ wrapMPIMOABComm
manage creation and destruction of MOAB communicator
Definition at line 1037 of file Core.hpp.
The documentation for this struct was generated from the following files:
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
MeshsetsManager * get_meshsets_manager_ptr()
get MeshsetsManager pointer
MoFEMErrorCode getOptions(int verb=DEFAULT_VERBOSITY)
Get core options from command line.
MoFEMErrorCode setFieldOrderImpl(boost::shared_ptr< Field > field_ptr, const Range &ents, const ApproximationOrder order, int verb)
MoFEMErrorCode setMoabInterface(moab::Interface &new_moab, int verb=VERBOSE)
PetscLogEvent MOFEM_EVENT_operator
Event for evaluating operator of finite element.
#define MYPCOMM_INDEX
default communicator number PCOMM
MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)
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
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
MoFEMErrorCode registerSubInterfaces()
Register insterfaces.
#define BITFEID_SIZE
max number of finite elements
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
static LoggerType & getLog(const std::string channel)
Get logger by channel.
int rAnk
MOFEM communicator rank.
MoFEMErrorCode remove_parents_by_parents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove paremts from entities having parents in passed range.
MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)
Build finite elements.
static UId getLoLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
static constexpr int value
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ L2
field with C-1 continuity
boost::shared_ptr< WrapMPIComm > wrapMPIMOABComm
manage creation and destruction of MOAB communicator
Tag th_ProblemGhostNbDofCol
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.
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
static PetscErrorCode mofem_error_handler(MPI_Comm comm, int line, const char *fun, const char *file, PetscErrorCode n, PetscErrorType p, const char *mess, void *ctx)
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
int * buildMoFEM
keeps flags/semaphores for different stages
#define SET_BASIC_METHOD(METHOD, PROBLEM_PTR)
MoFEMErrorCode list_problem() const
list problems
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
Set data for BasicMethod.
RefEntity_multiIndex refinedEntities
refined entities
#define MOFEM_LOG_ATTRIBUTES(channel, bit)
Add attributes to channel.
const Field * get_field_structure(const std::string &name, enum MoFEMTypes bh=MF_EXIST) const
get field structure
MoFEMErrorCode remove_parents_by_ents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove parents from entities.
EntityHandle getEnt() const
Get the entity handle.
Tag th_ProblemLocalNbDofRow
MoFEMErrorCode clear_finite_elements(const Range &ents, int verb=DEFAULT_VERBOSITY)
static MoFEMErrorCode getFileVersion(moab::Interface &moab, Version &version)
Get database major version.
interface_RefEntity< RefEntity > interface_type_RefEntity
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.
#define DeleteCoreFunctionBegin
Tag th_FieldName_DataNamePrefix
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
MoFEMErrorCode clearMap()
Cleaning database.
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
static boost::shared_ptr< RefEntityTmp< 0 > > makeSharedRefEntity(MoFEM::Interface &m_field, const EntityHandle ent)
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Tag th_ProblemGhostNbDofRow
MoFEMErrorCode list_finite_elements() const
list finite elements in database
@ USER_BASE
user implemented approximation base
static PetscErrorCode logPetscFPrintf(FILE *fd, const char format[], va_list Argp)
Use to handle PETSc output.
moab::Interface & get_moab()
MoFEMErrorCode addProblem(const BitProblemId id, const std::string &name, int verb=DEFAULT_VERBOSITY)
add problem
DeprecatedCoreInterface Interface
static MoFEMErrorCode fixTagSize(moab::Interface &moab, bool *changed=nullptr)
Fix tag size when BITREFLEVEL_SIZE of core library is different than file BITREFLEVEL_SIZE.
MoFEMErrorCode buildFieldForNoField(const BitFieldId id, std::map< EntityType, int > &dof_counter, int verb=DEFAULT_VERBOSITY)
#define MOFEM_LOG_FUNCTION()
Set scope.
MoFEMErrorCode clear_ents_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_end(const std::string &fe_name) const
get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MF...
MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
clear adjacency map for entities on given bit level
Problem_multiIndex pRoblems
problems multi-index
PetscLogEvent MOFEM_EVENT_preProcess
Event for preProcess finite element.
FieldSpace
approximation spaces
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
MoFEMErrorCode addField(const std::string &name, const FieldSpace space, const FieldContinuity continuity, const FieldApproximationBase base, const FieldCoefficientsNumber nb_coefficients, const TagType tag_type, const enum MoFEMTypes bh, int verb)
Template for add_field.
#define CHKERR
Inline error check.
EntityHandle get_field_meshset(const BitFieldId id) const
int get_comm_size() const
PetscLogEvent MOFEM_EVENT_createMat
MoFEMErrorCode addEntsToFieldByDim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)
FieldBitNumber get_field_bit_number(const std::string name) const
get field bit number
boost::ptr_map< boost::typeindex::type_index, UnknownInterface > iFaces
Hash map of pointers to interfaces.
FieldContinuity
Field continuity.
#define MOFEM_LOG_C(channel, severity, format,...)
static int mpiInitialised
mpi was initialised by other agent
MoFEMErrorCode list_fields() const
list entities in the field
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.
RefElement_multiIndex refinedFiniteElements
refined elements
int FieldCoefficientsNumber
Number of field coefficients.
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
virtual boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()=0
Get pointer to basic entity data.
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
static bool isGloballyInitialised
Core base globally initialized.
int sIze
MoFEM communicator size.
PetscBool initaliseAndBuildField
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
EntityHandle get_id_for_max_type()
#define ProblemCoreFunctionBegin
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
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
static PetscBool isInitialized
petsc was initialised by other agent
static MoFEMErrorCode getOptions()
Get logger option.
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)
@ MOFEM_OPERATION_UNSUCCESSFUL
auto type_from_handle(const EntityHandle h)
get type from entity handle
PetscBool initaliseAndBuildFiniteElements
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
boost::shared_ptr< CacheTuple > CacheTupleSharedPtr
FiniteElement_multiIndex finiteElements
finite elements
FTensor::Index< 'i', SPACE_DIM > i
static UId getLoFieldEntityUId(const FieldBitNumber bit, const EntityHandle ent)
Tag th_Part
Tag for partition number.
MoFEMErrorCode buildFiniteElements(const boost::shared_ptr< FiniteElement > &fe, const Range *ents_ptr=NULL, int verb=DEFAULT_VERBOSITY)
std::reference_wrapper< moab::Interface > moab
moab database
int main(int argc, char *argv[])
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.
boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()
Get pointer to basic entity data.
MPI_Comm mofemComm
MoFEM communicator.
constexpr auto field_name
#define FECoreFunctionBegin
CoreTmp(moab::Interface &moab, MPI_Comm comm=PETSC_COMM_WORLD, const int verbose=VERBOSE)
ParallelComm * pComm
MOAB communicator structure.
MoFEMErrorCode buildFieldForNoFieldImpl(boost::shared_ptr< Field > field_ptr, std::map< EntityType, int > &dof_counter, int verb)
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)
Set data for BasicMethod.
int verbose
Verbosity level.
void set_ref_ent_basic_data_ptr_impl(boost::shared_ptr< BasicEntityData > &ptr)
const double v
phase velocity of light in medium (cm/ns)
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
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)
#define MOFEM_LOG(channel, severity)
Log.
int ApproximationOrder
Approximation on the entity.
#define CATCH_ERRORS
Catch errors.
MoFEMErrorCode get_problem(const std::string &problem_name, const Problem **problem_ptr) const
Get problem database (data structure)
static UId getHiFieldEntityUId(const FieldBitNumber bit, const EntityHandle ent)
std::string optionsPrefix
Prefix for options on command line.
Field_multiIndex fIelds
fields
MoFEMErrorCode getTags(int verb=DEFAULT_VERBOSITY)
Get tag handles.
std::bitset< BITREFEDGES_SIZE > BitRefEdges
MoFEMErrorCode set_field_order(const Range &ents, const BitFieldId id, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)
@ DISCONTINUOUS
Broken continuity (No effect on L2 space)
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
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
double FieldData
Field data type.
@ HCURL
field with continuous tangents
@ MOFEM_DATA_INCONSISTENCY
MoFEMErrorCode coreGenericConstructor(moab::Interface &moab, MPI_Comm comm, const int verbose)
Tag th_ProblemLocalNbDofCol
static void createDefaultSinks(MPI_Comm comm)
Create default sinks.
#define FieldCoreFunctionBegin
FieldApproximationBase
approximation base
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
UBlasVector< double > VectorDouble
interface_RefEntity(const boost::shared_ptr< RefEntity > &sptr)
static UId getHiLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
FTensor::Index< 'm', 3 > m
EntityHandle get_finite_element_meshset(const BitFEId id) const
DofEntity_multiIndex dofsField
dofs on fields
MoFEMErrorCode clear_dofs_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
BitFieldId get_field_id(const std::string &name) const
Get field Id.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
MoFEMErrorCode cache_problem_entities(const std::string prb_name, CacheTupleWeakPtr cache_ptr)
Cache variables.
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
MoFEMErrorCode clear_problem(const std::string name, int verb=DEFAULT_VERBOSITY)
clear problem
FieldEntity_multiIndex entsFields
entities on fields
BitFEId getBitFEId(const std::string &fe_name) const
Get field Id.
bool check_finite_element(const std::string &name) const
Check if finite element is in database.
@ CONTINUOUS
Regular field.
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_begin(const std::string &fe_name) const
get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(...
static void setRefEntBasicDataPtr(MoFEM::Interface &m_field, boost::shared_ptr< BasicEntityData > &ptr)
EntityHandle get_id_for_min_type()
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode remove_ents(const Range ents, int verb=DEFAULT_VERBOSITY)
remove entities form mofem database
@ HDIV
field with continuous normal traction
static auto get_sub_iface_options_imp(T *const ptr, int) -> decltype(ptr->getSubInterfaceOptions())
MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)
build adjacencies
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
PetscLogEvent MOFEM_EVENT_postProcess
Event for postProcess finite element.
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
virtual const int getValue() const =0
Get the core.
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize database getting information on mesh.
static auto get_event_options_imp(T *const ptr, int) -> decltype(ptr->getEventOptions())
const int getValue() const
Get the core.
IFACE getInterface() const
Get interface pointer to pointer of interface.
@ NOFIELD
scalar or vector of scalars describe (no true field)
MoFEMErrorCode remove_ents_from_field(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)
remove entities from field