31 : cOre(const_cast<
MoFEM::
Core &>(core)), dEbug(false) {
34 auto core_log = logging::core::get();
50 MOFEM_LOG(
"BitRefWorld", Sev::noisy) <<
"BitRefManager interface created";
74 Range &seed_ents_range)
const {
77 seed_ents_range.insert(
f, s);
91 for (; rit != hi_rit; ++rit)
94 Range::iterator lo, hi = seed_ents_range.begin();
95 for (
auto pt = to_erase.pair_begin(); pt != to_erase.pair_end(); ++pt) {
96 lo = seed_ents_range.lower_bound(hi, seed_ents_range.end(), pt->first);
97 if (lo != seed_ents_range.end()) {
98 hi = seed_ents_range.upper_bound(lo, seed_ents_range.end(),
100 seed_ents_range.erase(lo, hi);
113 std::vector<boost::shared_ptr<RefEntity>> shared_ref_ents_vec;
114 shared_ref_ents_vec.reserve(seed_ents_range.size());
115 std::vector<const void *> tag_by_ptr;
116 for (Range::const_pair_iterator pit = seed_ents_range.pair_begin();
117 pit != seed_ents_range.pair_end(); pit++) {
119 EntityHandle
f = pit->first;
120 EntityHandle s = pit->second;
122 boost::shared_ptr<std::vector<RefEntityTmp<N>>> ref_ents_vec(
124 ref_ents_vec->reserve(s -
f + 1);
126 tag_by_ptr.resize(s -
f + 1);
128 baseEntData->th_RefParentHandle, Range(
f, s), &*tag_by_ptr.begin());
129 auto tag_parent_it = tag_by_ptr.begin();
130 for (
auto f : Range(
f, s)) {
131 ref_ents_vec->emplace_back(
133 const_cast<EntityHandle *
>(
134 static_cast<const EntityHandle *
>(*tag_parent_it)));
140 tag_by_ptr.resize(s -
f + 1);
142 baseEntData->th_RefBitLevel, Range(
f, s), &*tag_by_ptr.begin());
143 for (
auto &v_bit_ptr : tag_by_ptr)
148 for (
auto &re : *ref_ents_vec)
149 shared_ref_ents_vec.emplace_back(ref_ents_vec,
152 if (!shared_ref_ents_vec.empty()) {
155 ->insert(shared_ref_ents_vec.begin(), shared_ref_ents_vec.end());
156 if ((
refEntsPtr->size() - s0) != shared_ref_ents_vec.size()) {
158 "Data inconsistency %d != %d",
refEntsPtr->size() - s0,
159 shared_ref_ents_vec.size());
172 return addEntsToDatabaseImpl<0>(seed_ents_range);
174 return addEntsToDatabaseImpl<1>(seed_ents_range);
184 Range &seed_fe_range)
const {
186 seed_fe_range.insert(
f, s);
187 RefElement_multiIndex::iterator rit, hi_rit;
196 for (; rit != hi_rit; ++rit) {
197 seed_fe_range.erase(rit->get()->getEnt());
205 std::vector<boost::shared_ptr<RefElement>> shared_ref_fe_vec;
206 shared_ref_fe_vec.reserve(seed_fe_range.size());
208 for (Range::const_pair_iterator pit = seed_fe_range.const_pair_begin();
209 pit != seed_fe_range.const_pair_end(); ++pit) {
210 RefEntity_multiIndex::iterator rit, hi_rit;
212 hi_rit =
refEntsPtr->upper_bound(pit->second);
213 if (
static_cast<int>(std::distance(rit, hi_rit)) !=
214 static_cast<int>(pit->second - pit->first + 1)) {
216 "data inconsistency %d != %d", std::distance(rit, hi_rit),
217 pit->second - pit->first + 1);
219 switch ((*rit)->getEntType()) {
221 boost::shared_ptr<std::vector<RefElement_VERTEX>> ref_fe_vec =
222 boost::make_shared<std::vector<RefElement_VERTEX>>();
223 ref_fe_vec->reserve(pit->second - pit->first + 1);
224 for (; rit != hi_rit; ++rit) {
226 shared_ref_fe_vec.push_back(
227 boost::shared_ptr<RefElement>(ref_fe_vec, &ref_fe_vec->back()));
231 boost::shared_ptr<std::vector<RefElement_EDGE>> ref_fe_vec =
232 boost::make_shared<std::vector<RefElement_EDGE>>();
233 ref_fe_vec->reserve(pit->second - pit->first + 1);
234 for (; rit != hi_rit; ++rit) {
236 shared_ref_fe_vec.push_back(
237 boost::shared_ptr<RefElement>(ref_fe_vec, &ref_fe_vec->back()));
242 boost::shared_ptr<std::vector<RefElementFace>> ref_fe_vec =
243 boost::make_shared<std::vector<RefElementFace>>();
244 ref_fe_vec->reserve(pit->second - pit->first + 1);
245 for (; rit != hi_rit; ++rit) {
247 shared_ref_fe_vec.push_back(
248 boost::shared_ptr<RefElement>(ref_fe_vec, &ref_fe_vec->back()));
253 boost::shared_ptr<std::vector<RefElementVolume>> ref_fe_vec =
254 boost::make_shared<std::vector<RefElementVolume>>();
255 ref_fe_vec->reserve(pit->second - pit->first + 1);
256 for (; rit != hi_rit; ++rit) {
258 shared_ref_fe_vec.push_back(
259 boost::shared_ptr<RefElement>(ref_fe_vec, &ref_fe_vec->back()));
263 boost::shared_ptr<std::vector<RefElement_PRISM>> ref_fe_vec =
264 boost::make_shared<std::vector<RefElement_PRISM>>();
265 ref_fe_vec->reserve(pit->second - pit->first + 1);
266 for (; rit != hi_rit; ++rit) {
268 shared_ref_fe_vec.push_back(
269 boost::shared_ptr<RefElement>(ref_fe_vec, &ref_fe_vec->back()));
273 boost::shared_ptr<std::vector<RefElement_MESHSET>> ref_fe_vec =
274 boost::make_shared<std::vector<RefElement_MESHSET>>();
275 ref_fe_vec->reserve(pit->second - pit->first + 1);
276 for (; rit != hi_rit; ++rit) {
278 shared_ref_fe_vec.push_back(
279 boost::shared_ptr<RefElement>(ref_fe_vec, &ref_fe_vec->back()));
288 ->insert(shared_ref_fe_vec.begin(), shared_ref_fe_vec.end());
295 const bool only_tets,
int verb,
296 Range *adj_ents_ptr)
const {
303 MOFEM_LOG_C(
"BitRefSelf", Sev::noisy,
"Number of entities to add %d",
309 for (
int d = 3;
d >= 1; --
d) {
311 if (only_tets &&
d == 3) {
312 dim_ents = ents.subset_by_type(MBTET);
314 dim_ents = ents.subset_by_dimension(
d);
319 "\tNumber of dim %d entities to add %d",
d, dim_ents.size());
321 if (!dim_ents.empty()) {
322 for (
int dd = 0;
dd <
d; ++
dd) {
326 rval = m_field.
get_moab().get_connectivity(ents, adj_ents,
true);
333 adj_ents = adj_ents_ptr->subset_by_dimension(MBEDGE);
334 }
else if (
dd == 2) {
335 adj_ents = adj_ents_ptr->subset_by_dimension(MBTRI);
339 dim_ents,
dd,
true, adj_ents, moab::Interface::UNION);
348 "\tNumber of dim %d adj entities for dim %d to add %d",
d,
349 dd, adj_ents.size());
351 if (
rval == MB_MULTIPLE_ENTITIES_FOUND) {
352 auto log_message = [&](
const auto sev) {
356 <<
"When get adjacencies moab return MB_MULTIPLE_ENTITIES_ "
358 <<
dd <<
" and dim of entities " <<
d;
363 log_message(Sev::noisy);
365 log_message(Sev::warning);
370 for (Range::pair_iterator pit = adj_ents.pair_begin();
371 pit != adj_ents.pair_end(); ++pit) {
372 Range seed_ents_range;
374 EntityHandle
f = pit->first;
375 EntityHandle s = pit->second;
378 if (!seed_ents_range.empty())
398 for (Range::const_pair_iterator pit = ents.pair_begin();
399 pit != ents.pair_end(); pit++) {
401 EntityHandle
f = pit->first;
402 EntityHandle s = pit->second;
403 Range seed_ents_range;
408 if (!seed_ents_range.empty())
415 if (!seed_fe_range.empty()) {
423 <<
"Number of entities in databse " << ref_ents_ptr->size();
425 <<
"Number of finite element entities in databse " << ref_fe_ptr->size();
438 for (Range::const_pair_iterator pit = ents.pair_begin();
439 pit != ents.pair_end(); pit++) {
441 EntityHandle
f = pit->first;
442 EntityHandle s = pit->second;
443 Range seed_ents_range;
448 if (!seed_ents_range.empty())
461 CHKERR m_field.
get_moab().get_entities_by_handle(field_meshset, field_ents,
495 std::pair<RefEntity_multiIndex::iterator, bool> p_ent =
497 ->insert(boost::shared_ptr<RefEntity>(
499 *(
const_cast<RefEntity *
>(p_ent.first->get())->getBitRefLevelPtr()) |=
bit;
501 boost::shared_ptr<RefElement> fe_ptr =
503 std::pair<RefElement_multiIndex::iterator, bool> p_fe =
508 <<
"Add meshset as ref_ent " << **p_fe.first;
543 std::vector<const BitRefLevel *> ents_bits_vec;
545 for (
auto it : ents_bits_vec)
558 CHKERR moab.get_entities_by_dimension(meshset,
dim, ents,
true);
560 CHKERR moab.get_adjacencies(ents,
dd,
false, adj, moab::Interface::UNION);
565 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Add add bit ref level by dim ";
573 const bool b,
int verb)
const {
576 std::vector<const BitRefLevel *> ents_bits_vec;
578 for (
auto it = ents_bits_vec.begin(); it != ents_bits_vec.end(); ++it) {
582 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Set bit to " << ents;
592 auto hi_dit = ref_ents_ptr->end();
593 for (
auto dit = ref_ents_ptr->begin(); dit != hi_dit; ++dit) {
594 (*
const_cast<RefEntity *
>(dit->get())->getBitRefLevelPtr())[
n] =
b;
596 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Set bit to " << **dit;
617 for (
int ii = 0; ii < shift; ii++) {
620 if (delete_bits.any()) {
624 for (RefEntity_multiIndex::iterator ent_it = ref_ents_ptr->begin();
625 ent_it != ref_ents_ptr->end(); ent_it++) {
629 << (*ent_it)->getBitRefLevel() <<
" : ";
631 right_shift(
const_cast<boost::shared_ptr<RefEntity> &
>(*ent_it));
634 MOFEM_LOG(
"BitRefSelf", Sev::noisy) << (*ent_it)->getBitRefLevel();
643 const char *file_name,
644 const char *file_type,
646 const bool check_for_empty)
const {
650 EntityHandle meshset;
651 CHKERR moab.create_meshset(MESHSET_SET, meshset);
654 CHKERR moab.get_number_entities_by_handle(meshset, nb_ents,
true);
655 if (check_for_empty && !nb_ents) {
657 <<
"No entities to save < " << file_name <<
" > in writeBitLevel";
661 CHKERR moab.write_file(file_name, file_type, options, &meshset, 1);
662 CHKERR moab.delete_entities(&meshset, 1);
668 const int dim,
const char *file_name,
669 const char *file_type,
const char *options,
670 const bool check_for_empty)
const {
676 if (check_for_empty && ents.empty()) {
678 <<
"No entities to save < " << file_name <<
" > in writeBitLevelByDim";
681 EntityHandle meshset;
682 CHKERR moab.create_meshset(MESHSET_SET, meshset);
683 CHKERR moab.add_entities(meshset, ents);
684 CHKERR moab.write_file(file_name, file_type, options, &meshset, 1);
685 CHKERR moab.delete_entities(&meshset, 1);
691 const char *file_name,
const char *file_type,
const char *options,
692 const bool check_for_empty)
const {
698 if (check_for_empty && ents.empty()) {
700 <<
"No entities to save < " << file_name <<
" > in writeBitLevelByType";
703 EntityHandle meshset;
704 CHKERR moab.create_meshset(MESHSET_SET, meshset);
705 CHKERR moab.add_entities(meshset, ents);
706 CHKERR moab.write_file(file_name, file_type, options, &meshset, 1);
707 CHKERR moab.delete_entities(&meshset, 1);
712 const char *file_name,
const char *file_type,
const char *options,
713 const bool check_for_empty)
const {
717 EntityHandle meshset;
720 if (check_for_empty && ents.empty())
722 CHKERR moab.create_meshset(MESHSET_SET, meshset);
723 CHKERR moab.add_entities(meshset, ents);
724 CHKERR moab.write_file(file_name, file_type, options, &meshset, 1);
725 CHKERR moab.delete_entities(&meshset, 1);
731 const char *file_type,
const char *options) {
734 std::string name = boost::lexical_cast<std::string>(ll) +
"_" + file_name;
736 file_type, options,
true);
743 const EntityHandle meshset,
int verb)
const {
749 CHKERR moab.add_entities(meshset, ents);
761 std::vector<EntityHandle> ents_vec;
762 ents_vec.reserve(ents.size());
764 std::vector<BitRefLevel *> tags_bits_ptr_vec(ents.size());
767 auto hint = swap_ents.begin();
769 for (Range::pair_iterator p_eit = ents.pair_begin(); p_eit != ents.pair_end();
772 EntityHandle
f = p_eit->first;
773 const EntityHandle s = p_eit->second;
777 (
const void **)(&*tags_bits_ptr_vec.begin()));
779 if (
rval == MB_SUCCESS) {
781 auto bit_it = tags_bits_ptr_vec.begin();
783 auto check = [&
bit, &mask](
const auto &entity_bit) ->
bool {
786 (entity_bit &
bit).any() &&
788 ((entity_bit & mask) == entity_bit);
793 while (
f != s + 1 && !check(**bit_it)) {
800 const EntityHandle start =
f;
802 while (
f != (s + 1) && check(**bit_it)) {
807 hint = swap_ents.insert(hint, start,
f - 1);
813 ents.swap(swap_ents);
820 Range &ents,
int verb)
const {
824 CHKERR moab.get_entities_by_type(0,
type, ents,
false);
831 const EntityHandle meshset,
int verb)
const {
837 CHKERR moab.add_entities(meshset, ents);
847 CHKERR moab.get_entities_by_dimension(0,
dim, ents,
false);
854 const EntityHandle meshset,
855 const int verb)
const {
861 CHKERR moab.add_entities(meshset, ents);
868 const int verb)
const {
873 CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshset_ents,
false);
874 CHKERR moab.get_entities_by_handle(0, ents,
false);
875 ents.merge(meshset_ents);
884 const int verb)
const {
891 std::vector<EntityHandle> ents_vec;
892 ents_vec.reserve(std::distance(it, hi_it));
893 for (; it != hi_it; it++) {
894 const BitRefLevel &ent_bit = it->get()->getBitRefLevel();
895 if ((ent_bit & mask) == ent_bit && (ent_bit &
bit).any())
896 ents_vec.emplace_back(it->get()->getEnt());
898 ents.insert_list(ents_vec.begin(), ents_vec.end());
901 <<
"getEntitiesByParentType: " << ents << endl;
909 CHKERR moab.get_entities_by_handle(0, ents,
false);
910 ents = subtract(ents, ents.subset_by_type(MBENTITYSET));
919 auto eit = ents.begin();
920 for (; eit != ents.end();) {
921 auto rit = ref_ents_ptr->get<
Ent_mi_tag>().find(*eit);
922 if (rit != ref_ents_ptr->get<
Ent_mi_tag>().end()) {
923 eit = ents.erase(eit);
933 const int to_dimension,
934 Range &adj_entities)
const {
941 CHKERR moab.get_adjacencies(&from_entity, 1, to_dimension,
false,
943 std::vector<BitRefLevel> bit_levels(adj_entities.size());
945 &*bit_levels.begin());
946 auto b_it = bit_levels.begin();
947 auto eit = adj_entities.begin();
948 for (; eit != adj_entities.end(); b_it++) {
949 if (bit_from_entity != *b_it) {
950 eit = adj_entities.erase(eit);
959 const int to_dimension,
960 Range &adj_entities)
const {
967 CHKERR moab.get_adjacencies(&from_entity, 1, to_dimension,
false,
969 std::vector<BitRefLevel> bit_levels(adj_entities.size());
971 &*bit_levels.begin());
972 std::vector<BitRefLevel>::iterator b_it = bit_levels.begin();
973 Range::iterator eit = adj_entities.begin();
974 for (; eit != adj_entities.end(); b_it++) {
975 if (!(bit_from_entity & (*b_it)).any()) {
976 eit = adj_entities.erase(eit);
985 const Problem *problem_ptr,
const EntityHandle *from_entities,
986 const int num_entities,
const int to_dimension, Range &adj_entities,
987 const int operation_type,
const int verb)
const {
991 adj_entities, operation_type);
997 const int num_entities,
const int to_dimension, Range &adj_entities,
998 const int operation_type,
const int verb)
const {
1008 CHKERR moab.get_adjacencies(from_entities, num_entities, to_dimension,
false,
1009 adj_entities, operation_type);
1010 std::vector<BitRefLevel> bit_levels(adj_entities.size());
1012 &*bit_levels.begin());
1013 std::vector<BitRefLevel>::iterator b_it = bit_levels.begin();
1014 for (Range::iterator eit = adj_entities.begin(); eit != adj_entities.end();
1024 if (!((*b_it) &
bit).any()) {
1025 eit = adj_entities.erase(eit);
1030 if (b_it != bit_levels.end()) {
1037 const EntityHandle parent,
const BitRefLevel &parent_bit,
1039 const BitRefLevel &child_mask,
const EntityHandle child,
1040 EntityType child_type,
const bool recursive,
int verb) {
1045 CHKERR moab.get_entities_by_handle(parent, parent_ents, recursive);
1049 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Parnets: " << parent;
1051 Range children_ents;
1053 if (child_type < MBMAXTYPE)
1054 children_ents = children_ents.subset_by_type(child_type);
1057 CHKERR moab.add_entities(child, children_ents);
1062 const EntityHandle parent,
const BitRefLevel &child_bit,
1063 const EntityHandle child,
EntityType child_type,
const bool recursive,
1068 child, child_type, recursive, verb);
1080 for (
auto &fit : (*fields_ptr)) {
1082 const EntityHandle meshset = fit->getMeshset();
1084 CHKERR moab.get_entities_by_handle(meshset, parent_ents,
true);
1088 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Parnets:" << std::endl
1089 << parent_ents << std::endl;
1092 Range children_ents;
1095 children_ents, verb);
1097 CHKERR moab.add_entities(meshset, children_ents);
1101 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Children: " << std::endl
1102 << children_ents << std::endl;
1109 const std::string name,
const BitRefLevel &child_bit,
int verb) {
1117 CHKERR moab.get_entities_by_handle(field_meshset, parent_ents,
true);
1121 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Parnets:" << endl
1122 << parent_ents << std::endl;
1125 Range children_ents;
1130 CHKERR moab.add_entities(field_meshset, children_ents);
1134 MOFEM_LOG(
"BitRefSelf", Sev::noisy) <<
"Children: " << endl
1135 << children_ents << std::endl;
1142 const std::string name,
const BitRefLevel &child_bit,
1148 fe_ent_type,
false, verb);
1159 std::vector<EntityHandle> child_ents_vec;
1160 child_ents_vec.reserve(ref_ents.size());
1161 for (Range::const_pair_iterator pit = parent_ents.const_pair_begin();
1162 pit != parent_ents.const_pair_end(); pit++) {
1163 const auto f = pit->first;
1164 auto it = ref_ents.lower_bound(
f);
1165 if (it != ref_ents.end()) {
1166 const auto s = pit->second;
1167 auto hi_it = ref_ents.upper_bound(s);
1169 if (std::distance(it, hi_it) != (s -
f) + 1) {
1172 "Number of entities and entities parents is different %d != %d ",
1173 std::distance(it, hi_it), (s -
f) + 1);
1176 for (; it != hi_it; it++) {
1178 if (it->get()->getEntType() == MBENTITYSET) {
1180 "This should not happen; Entity should not have part of the "
1181 "meshset. It has no children.");
1184 child_ents_vec.emplace_back((*it)->getEnt());
1190 child_ents.insert_list(child_ents_vec.begin(), child_ents_vec.end());
1202 std::vector<EntityHandle> parent_ents_vec;
1203 parent_ents_vec.reserve(ref_ents.size());
1204 for (Range::const_pair_iterator pit = child_ents.const_pair_begin();
1205 pit != child_ents.const_pair_end(); pit++) {
1206 const auto f = pit->first;
1207 auto it = ref_ents.lower_bound(
f);
1208 if (it != ref_ents.end()) {
1209 const auto s = pit->second;
1210 auto hi_it = ref_ents.upper_bound(s);
1212 if (std::distance(it, hi_it) != (s -
f) + 1) {
1215 "Number of entities and enties parents is diffrent %d != %d ",
1216 std::distance(it, hi_it), (s -
f) + 1);
1219 for (; it != hi_it; it++) {
1221 if (it->get()->getEntType() == MBENTITYSET) {
1223 "This should not happen; Entity should not have part of the "
1224 "meshset. It has no children.");
1227 auto parent = (*it)->getParentEnt();
1229 parent_ents_vec.emplace_back(parent);
1235 parent_ents.insert_list(parent_ents_vec.begin(), parent_ents_vec.end());
#define MOFEM_LOG_C(channel, severity, format,...)
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
#define BITREFLEVEL_SIZE
max number of refinements
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
#define MAX_CORE_TMP
maximal number of cores
#define MoFEMFunctionReturnHot(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 ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getEnt > > > > RefElement_multiIndex
virtual const RefEntity_multiIndex * get_ref_ents() const =0
Get the ref ents object.
virtual const Field_multiIndex * get_fields() const =0
Get the fields object.
virtual const RefElement_multiIndex * get_ref_finite_elements() const =0
Get the ref finite elements object.
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.
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.
MoFEMErrorCode shiftLeftBitRef(const int shift, const BitRefLevel mask=BitRefLevel().set(), int verb=DEFAULT_VERBOSITY) const
left shift bit ref levelthis results of deletion of entities on far left side
MoFEMErrorCode setElementsBitRefLevel(const Range &ents, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const
add entities to database and set bit ref level
MoFEMErrorCode shiftRightBitRef(const int shift, const BitRefLevel mask=BitRefLevel().set(), int verb=DEFAULT_VERBOSITY, MoFEMTypes mf=MF_ZERO) const
right shift bit ref level
MoFEMErrorCode setEntitiesBitRefLevel(const Range &ents, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const
add entities to database and set bit ref level
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
MoFEMErrorCode setBitRefLevel(const Range &ents, const BitRefLevel bit, const bool only_tets=true, int verb=0, Range *adj_ents_ptr=nullptr) const
add entities to database and set bit ref level
MoFEMErrorCode setBitRefLevelByType(const EntityHandle meshset, const EntityType type, const BitRefLevel bit, int verb=QUIET) const
Set the Bit Ref Level By Type object.
MoFEMErrorCode addBitRefLevelByDim(const EntityHandle meshset, const int dim, const BitRefLevel bit, int verb=QUIET) const
add bit ref level by dimension
MoFEMErrorCode setBitLevelToMeshset(const EntityHandle meshset, const BitRefLevel bit, int verb=0) const
MoFEMErrorCode setNthBitRefLevel(const Range &ents, const int n, const bool b, int verb=QUIET) const
Set nth bit ref level.
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,...
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
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,...
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.
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.
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
MoFEMErrorCode addBitRefLevel(const Range &ents, const BitRefLevel bit, int verb=QUIET) const
add bit ref level to ref entity
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
MoFEMErrorCode updateFieldMeshsetByEntitiesChildren(const BitRefLevel &child_bit, int verb=0)
update fields meshesets by child entities
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.
MoFEMErrorCode updateRangeByParent(const Range &parent, Range &child, MoFEMTypes bh=MF_ZERO)
Update range by prents.
MoFEMErrorCode setBitRefLevelByDim(const EntityHandle meshset, const int dim, const BitRefLevel bit, int verb=QUIET) const
Set the Bit Ref Level By Dim object.
MoFEMErrorCode updateRangeByChildren(const Range &parent, Range &child, MoFEMTypes bh=MF_ZERO)
Update range by childresn.
virtual EntityHandle get_finite_element_meshset(const std::string &name) const =0
virtual Field * get_field_structure(const std::string &name)=0
get field structure
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
#define MOFEM_LOG_ATTRIBUTES(channel, bit)
Add attributes to channel.
#define MOFEM_LOG_FUNCTION()
Set scope.
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
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)
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
EntityHandle get_id_for_max_type()
EntityHandle get_id_for_min_type()
moab::Range::iterator insertOrdered(Range &r, Extractor, Iterator begin_iter, Iterator end_iter)
Insert ordered mofem multi-index into range.
RefEntityTmp< 0 > RefEntity
DeprecatedCoreInterface Interface
constexpr auto field_name
MoFEMErrorCode getAllEntitiesNotInDatabase(Range &ents) const
Get all entities not in database.
MoFEMErrorCode writeBitLevelByDim(const BitRefLevel bit, const BitRefLevel mask, const int dim, 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 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 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
MoFEMErrorCode filterEntitiesByRefLevel(const BitRefLevel bit, const BitRefLevel mask, Range &ents, int verb=QUIET) const
filter entities by bit ref level
BitRefManager(const MoFEM::Core &core)
MoFEMErrorCode filterEntitiesNotInDatabase(Range &ents) const
Get entities not in database.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
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.
MoFEMErrorCode writeBitLevel(const BitRefLevel bit, const BitRefLevel mask, 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 writeEntitiesNotInDatabase(const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const
Write ents not in database.
virtual moab::Interface & get_moab()=0
virtual EntityHandle get_field_meshset(const std::string name) const =0
get field meshset
virtual const int getValue() const =0
Get the core.
virtual 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)=0
delete entities form mofem and moab database
virtual boost::shared_ptr< BasicEntityData > & get_basic_entity_data_ptr()=0
Get pointer to basic entity data.
Tag get_th_RefBitLevel() const
Deprecated interface functions.
EntityHandle getMeshset() const
Get field meshset.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
keeps basic data about problem
BitRefLevel getBitRefLevel() const
keeps data about abstract EDGE finite element
keeps data about abstract MESHSET finite element
keeps data about abstract PRISM finite element
keeps data about abstract VERTEX finite element
keeps data about abstract TRI finite element
keeps data about abstract TET finite element
ref mofem entity, right shift
Struct keeps handle to refined handle.
const BitRefLevel & getBitRefLevel() const
Get entity ref bit refinement signature.
static MoFEMErrorCode getBitRefLevel(Interface &moab, Range ents, std::vector< BitRefLevel > &vec_bit_ref_level)
base class for all interface classes