 |
| v0.10.0
|
Managing BitRefLevels.
More...
#include <src/interfaces/BitRefManager.hpp>
|
MoFEMErrorCode | query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const |
|
| BitRefManager (const MoFEM::Core &core) |
|
virtual | ~BitRefManager ()=default |
| Destructor. More...
|
|
template<class IFACE > |
MoFEMErrorCode | registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true) |
| Register interface. More...
|
|
template<class IFACE , bool VERIFY = false> |
MoFEMErrorCode | getInterface (const MOFEMuuid &uuid, IFACE *&iface) const |
| Get interface by uuid and return reference to pointer of interface. More...
|
|
template<class IFACE > |
MoFEMErrorCode | getInterface (IFACE *&iface) const |
| Get interface refernce to pointer of interface. More...
|
|
template<class IFACE > |
MoFEMErrorCode | getInterface (IFACE **const iface) const |
| Get interface pointer to pointer of interface. More...
|
|
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0> |
IFACE | getInterface () const |
| Get interface pointer to pointer of interface. More...
|
|
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0> |
IFACE | getInterface () const |
| Get reference to interface. More...
|
|
template<class IFACE > |
IFACE * | getInterface () const |
| Function returning pointer to interface. More...
|
|
virtual | ~UnknownInterface ()=default |
|
virtual MoFEMErrorCode | getLibVersion (Version &version) const |
| Get library version. More...
|
|
virtual const MoFEMErrorCode | getFileVersion (moab::Interface &moab, Version &version) const |
| Get database major version. More...
|
|
virtual MoFEMErrorCode | getInterfaceVersion (Version &version) const |
| Get database major version. More...
|
|
template<> |
MoFEMErrorCode | getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const |
|
|
MoFEMErrorCode | setBitRefLevel (const Range &ents, const BitRefLevel bit, const bool only_tets=true, int verb=0) const |
| add entities to database and set bit ref level More...
|
|
MoFEMErrorCode | setElementsBitRefLevel (const Range &ents, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const |
| add entities to database and set bit ref level More...
|
|
MoFEMErrorCode | setEntitiesBitRefLevel (const Range &ents, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const |
| add entities to database and set bit ref level More...
|
|
MoFEMErrorCode | setFieldEntitiesBitRefLevel (const std::string field_name, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const |
| Set the bit ref level to entities in the field meshset. More...
|
|
MoFEMErrorCode | setBitRefLevelByDim (const EntityHandle meshset, const int dim, const BitRefLevel bit, int verb=QUIET) const |
| Set the Bit Ref Level By Dim object. More...
|
|
MoFEMErrorCode | setBitRefLevelByType (const EntityHandle meshset, const EntityType type, const BitRefLevel bit, int verb=QUIET) const |
| Set the Bit Ref Level By Type object. More...
|
|
MoFEMErrorCode | setBitLevelToMeshset (const EntityHandle meshset, const BitRefLevel bit, int verb=0) const |
|
MoFEMErrorCode | addToDatabaseBitRefLevelByType (const EntityType type, const BitRefLevel bit, const BitRefLevel mask=BitRefLevel().set(), int verb=QUIET) const |
| Add entities which exist in MoAB database, and have set appropiate BitRef level tag, to multi-indices in MoFEM. More...
|
|
MoFEMErrorCode | addToDatabaseBitRefLevelByDim (const int dim, const BitRefLevel bit, const BitRefLevel mask=BitRefLevel().set(), int verb=QUIET) const |
| Add entities which exist in MoAB database, and have set appropiate BitRef level tag, to multi-indices in MoFEM. More...
|
|
MoFEMErrorCode | addBitRefLevel (const Range &ents, const BitRefLevel bit, int verb=QUIET) const |
| add bit ref level to ref entity More...
|
|
MoFEMErrorCode | addBitRefLevelByDim (const EntityHandle meshset, const int dim, const BitRefLevel bit, int verb=QUIET) const |
| add bit ref level by dimension More...
|
|
MoFEMErrorCode | setNthBitRefLevel (const Range &ents, const int n, const bool b, int verb=0) const |
| Set nth bit ref level. More...
|
|
MoFEMErrorCode | setNthBitRefLevel (const int n, const bool b, int verb=0) const |
| Set nth bit ref level. More...
|
|
MoFEMErrorCode | shiftLeftBitRef (const int shift, const BitRefLevel mask=BitRefLevel().set(), int verb=-1) const |
| left shift bit ref levelthis results of deletion of entities on far left side More...
|
|
MoFEMErrorCode | shiftRightBitRef (const int shift, const BitRefLevel mask=BitRefLevel().set(), int verb=-1) const |
| right shift bit ref level More...
|
|
|
MoFEMErrorCode | filterEntitiesByRefLevel (const BitRefLevel bit, const BitRefLevel mask, Range &ents, int verb=QUIET) const |
| filter entities by bit ref level More...
|
|
MoFEMErrorCode | getEntitiesByTypeAndRefLevel (const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const EntityHandle meshset, int verb=0) const |
| add all ents from ref level given by bit to meshset More...
|
|
MoFEMErrorCode | getEntitiesByTypeAndRefLevel (const BitRefLevel bit, const BitRefLevel mask, const EntityType type, Range &ents, int verb=0) const |
| add all ents from ref level given by bit to meshset More...
|
|
MoFEMErrorCode | getEntitiesByDimAndRefLevel (const BitRefLevel bit, const BitRefLevel mask, const int dim, const EntityHandle meshset, int verb=0) const |
| add all ents from ref level given by bit to meshset More...
|
|
MoFEMErrorCode | getEntitiesByDimAndRefLevel (const BitRefLevel bit, const BitRefLevel mask, const int dim, Range &ents, int verb=0) const |
| add all ents from ref level given by bit to meshset More...
|
|
MoFEMErrorCode | getEntitiesByRefLevel (const BitRefLevel bit, const BitRefLevel mask, const EntityHandle meshset, const int verb=QUIET) const |
| add all ents from ref level given by bit to meshset More...
|
|
MoFEMErrorCode | getEntitiesByRefLevel (const BitRefLevel bit, const BitRefLevel mask, Range &ents, const int verb=QUIET) const |
| add all ents from ref level given by bit to meshset More...
|
|
MoFEMErrorCode | getEntitiesByParentType (const BitRefLevel bit, const BitRefLevel mask, const EntityType type, Range &ents, const int verb=QUIET) const |
| get entities by bit ref level and type of parent More...
|
|
MoFEMErrorCode | getAllEntitiesNotInDatabase (Range &ents) const |
| Get all entities not in database. More...
|
|
MoFEMErrorCode | filterEntitiesNotInDatabase (Range &ents) const |
| Get entities not in database. More...
|
|
|
virtual MoFEMErrorCode | getAdjacenciesEquality (const EntityHandle from_entity, const int to_dimension, Range &adj_entities) const |
| Get the adjacencies associated with a entity to entities of a specified dimension. More...
|
|
virtual MoFEMErrorCode | getAdjacenciesAny (const EntityHandle from_entity, const int to_dimension, Range &adj_entities) const |
| Get the adjacencies associated with a entity to entities of a specified dimension. More...
|
|
virtual MoFEMErrorCode | getAdjacencies (const Problem *problem_ptr, const EntityHandle *from_entities, const int num_entities, const int to_dimension, Range &adj_entities, const int operation_type=moab::Interface::INTERSECT, const int verb=0) const |
| Get the adjacencies associated with a entity to entities of a specified dimension. More...
|
|
virtual MoFEMErrorCode | getAdjacencies (const BitRefLevel bit, const EntityHandle *from_entities, const int num_entities, const int to_dimension, Range &adj_entities, const int operation_type=moab::Interface::INTERSECT, const int verb=0) const |
| Get the adjacencies associated with a entity to entities of a specified dimension. More...
|
|
|
MoFEMErrorCode | updateMeshsetByEntitiesChildren (const EntityHandle parent, const BitRefLevel &parent_bit, const BitRefLevel &parent_mask, const BitRefLevel &child_bit, const BitRefLevel &child_mask, const EntityHandle child, EntityType child_type, const bool recursive=false, int verb=0) |
| Get child entities form meshset containing parent entities. More...
|
|
MoFEMErrorCode | updateMeshsetByEntitiesChildren (const EntityHandle parent, const BitRefLevel &child_bit, const EntityHandle child, EntityType child_type, const bool recursive=false, int verb=0) |
| Get child entities form meshset containing parent entities. More...
|
|
MoFEMErrorCode | updateFieldMeshsetByEntitiesChildren (const BitRefLevel &child_bit, int verb=0) |
| update fields meshesets by child entities More...
|
|
MoFEMErrorCode | updateFieldMeshsetByEntitiesChildren (const std::string name, const BitRefLevel &child_bit, int verb=0) |
| update field meshset by child entities More...
|
|
MoFEMErrorCode | updateFiniteElementMeshsetByEntitiesChildren (const std::string name, const BitRefLevel &child_bit, const EntityType fe_ent_type, int verb=0) |
| update finite element meshset by child entities More...
|
|
MoFEMErrorCode | updateRange (const Range &parent, Range &child, MoFEMTypes bh=MF_ZERO) |
| Update range by prents. More...
|
|
|
MoFEMErrorCode | writeBitLevelByType (const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const |
| Write bit ref level to file. More...
|
|
MoFEMErrorCode | writeEntitiesNotInDatabase (const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const |
| Write ents not in database. More...
|
|
MoFEMErrorCode | writeEntitiesAllBitLevelsByType (const BitRefLevel mask, const EntityType type, const char *file_name, const char *file_type, const char *options) |
| Write all entities by bit levels and type. More...
|
|
Managing BitRefLevels.
- Examples
- bernstein_bezier_generate_base.cpp, build_large_problem.cpp, build_problems.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, dm_build_partitioned_mesh.cpp, dm_create_subdm.cpp, dm_partitioned_no_field.cpp, elasticity.cpp, elasticity_mixed_formulation.cpp, ep.cpp, field_axpy_atom_test.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, hcurl_divergence_operator_2d.cpp, mesh_cut.cpp, mesh_insert_interface_atom.cpp, mesh_smoothing.cpp, minimal_surface_area.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, Remodeling.cpp, remove_entities_from_problem.cpp, simple_contact.cpp, split_sideset.cpp, test_jacobian_of_simple_contact_element.cpp, and unsaturated_transport.cpp.
Definition at line 34 of file BitRefManager.hpp.
◆ BitRefManager()
MoFEM::BitRefManager::BitRefManager |
( |
const MoFEM::Core & |
core | ) |
|
Definition at line 34 of file BitRefManager.cpp.
38 auto core_log = logging::core::get();
54 MOFEM_LOG(
"BitRefWorld", Sev::noisy) <<
"BitRefManager interface created";
◆ ~BitRefManager()
virtual MoFEM::BitRefManager::~BitRefManager |
( |
| ) |
|
|
virtualdefault |
◆ filterEntitiesByRefLevel()
filter entities by bit ref level
- Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 642 of file BitRefManager.cpp.
650 std::vector<EntityHandle> ents_vec;
651 ents_vec.reserve(ents.size());
653 std::vector<BitRefLevel *> tags_bits_ptr_vec(ents.size());
656 auto hint = swap_ents.begin();
658 for (Range::pair_iterator p_eit = ents.pair_begin(); p_eit != ents.pair_end();
666 (
const void **)(&*tags_bits_ptr_vec.begin()));
668 if (
rval == MB_SUCCESS) {
670 auto bit_it = tags_bits_ptr_vec.begin();
672 auto check = [&bit, &mask](
const auto &entity_bit) ->
bool {
675 (entity_bit & bit).any() &&
677 ((entity_bit & mask) == entity_bit);
682 while (
f != s + 1 && !check(**bit_it)) {
691 while (
f != (s + 1) && check(**bit_it)) {
696 hint = swap_ents.insert(hint, start,
f - 1);
702 ents.swap(swap_ents);
◆ filterEntitiesNotInDatabase()
MoFEMErrorCode MoFEM::BitRefManager::filterEntitiesNotInDatabase |
( |
Range & |
ents | ) |
const |
Get entities not in database.
- Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 803 of file BitRefManager.cpp.
807 auto eit = ents.begin();
808 for (; eit != ents.end();) {
809 auto rit = ref_ents_ptr->get<Ent_mi_tag>().find(*eit);
810 if (rit != ref_ents_ptr->get<Ent_mi_tag>().end()) {
811 eit = ents.erase(eit);
◆ getAllEntitiesNotInDatabase()
MoFEMErrorCode MoFEM::BitRefManager::getAllEntitiesNotInDatabase |
( |
Range & |
ents | ) |
const |
Get all entities not in database.
- Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 793 of file BitRefManager.cpp.
797 CHKERR moab.get_entities_by_handle(0, ents,
false);
798 ents = subtract(ents, ents.subset_by_type(MBENTITYSET));
◆ getEntitiesByParentType()
get entities by bit ref level and type of parent
- Note
- Entities have to be added to MoFEM database
- Parameters
-
BitRefLevel | bitLevel |
BitRefLevel | mask |
type | of parent |
ents | returned ents |
- Returns
- error code
Definition at line 769 of file BitRefManager.cpp.
777 auto &ref_ents = ref_ents_ptr->get<Ent_Ent_mi_tag>();
780 std::vector<EntityHandle> ents_vec;
781 ents_vec.reserve(std::distance(it, hi_it));
782 for (; it != hi_it; it++) {
783 const BitRefLevel &ent_bit = it->get()->getBitRefLevel();
784 if ((ent_bit & mask) == ent_bit && (ent_bit & bit).any())
785 ents_vec.emplace_back(it->get()->getEnt());
787 ents.insert_list(ents_vec.begin(), ents_vec.end());
789 cerr <<
"getEntitiesByParentType: " << ents << endl;
◆ query_interface()
◆ writeBitLevelByType()
MoFEMErrorCode MoFEM::BitRefManager::writeBitLevelByType |
( |
const BitRefLevel |
bit, |
|
|
const BitRefLevel |
mask, |
|
|
const EntityType |
type, |
|
|
const char * |
file_name, |
|
|
const char * |
file_type, |
|
|
const char * |
options, |
|
|
const bool |
check_for_empty = true |
|
) |
| const |
Write bit ref level to file.
- Parameters
-
bit | bit ref level |
mask | mask of bit ref level |
type | type of entity |
file_name | file name (see moab documentation) |
file_type | file type (see moab documentation) |
options | file options (see moab documentation) |
- Returns
- error code
Definition at line 581 of file BitRefManager.cpp.
590 if (check_for_empty && ents.empty())
593 CHKERR moab.create_meshset(MESHSET_SET, meshset);
594 CHKERR moab.add_entities(meshset, ents);
595 CHKERR moab.write_file(file_name, file_type, options, &meshset, 1);
596 CHKERR moab.delete_entities(&meshset, 1);
◆ writeEntitiesAllBitLevelsByType()
MoFEMErrorCode MoFEM::BitRefManager::writeEntitiesAllBitLevelsByType |
( |
const BitRefLevel |
mask, |
|
|
const EntityType |
type, |
|
|
const char * |
file_name, |
|
|
const char * |
file_type, |
|
|
const char * |
options |
|
) |
| |
Write all entities by bit levels and type.
- Parameters
-
mask | |
type | |
file_name | |
file_type | |
options | |
- Returns
- MoFEMErrorCode
Definition at line 618 of file BitRefManager.cpp.
623 std::string name = boost::lexical_cast<std::string>(ll) +
"_" + file_name;
625 file_type, options,
true);
◆ writeEntitiesNotInDatabase()
MoFEMErrorCode MoFEM::BitRefManager::writeEntitiesNotInDatabase |
( |
const char * |
file_name, |
|
|
const char * |
file_type, |
|
|
const char * |
options, |
|
|
const bool |
check_for_empty = true |
|
) |
| const |
Write ents not in database.
- Parameters
-
file_name | |
file_type | for example "VTK" |
options | |
check_for_empty | |
- Returns
- MoFEMErrorCode
Definition at line 600 of file BitRefManager.cpp.
609 if (check_for_empty && ents.empty())
611 CHKERR moab.create_meshset(MESHSET_SET, meshset);
612 CHKERR moab.add_entities(meshset, ents);
613 CHKERR moab.write_file(file_name, file_type, options, &meshset, 1);
614 CHKERR moab.delete_entities(&meshset, 1);
◆ cOre
◆ dEbug
bool MoFEM::BitRefManager::dEbug |
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()
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Deprecated interface functions.
static const MOFEMuuid IDD_MOFEMBitRefManager
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
DeprecatedCoreInterface Interface
virtual moab::Interface & get_moab()=0
MoFEMErrorCode writeBitLevelByType(const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const
Write bit ref level to file.
MoFEMErrorCode filterEntitiesNotInDatabase(Range &ents) const
Get entities not in database.
#define MOFEM_LOG_FUNCTION()
Set scope.
BitRefManager(const MoFEM::Core &core)
MoFEMErrorCode getAllEntitiesNotInDatabase(Range &ents) const
Get all entities not in database.
#define CHKERR
Inline error check.
Tag get_th_RefBitLevel() const
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
EntityHandle get_id_for_max_type()
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG(channel, severity)
Log.
EntityHandle get_id_for_min_type()
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
#define BITREFLEVEL_SIZE
max number of refinements
virtual const RefEntity_multiIndex * get_ref_ents() const =0
Get the ref ents object.
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
MoFEMErrorCode getEntitiesByTypeAndRefLevel(const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const EntityHandle meshset, int verb=0) const
add all ents from ref level given by bit to meshset
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval