v0.13.0
DeleteCore.cpp
Go to the documentation of this file.
1 /** \file DeleteCore.cpp
2  * \brief Core interface methods for managing deletions and insertion dofs
3  *
4  * \note If entity/dof/finite element is cleared it mean that is erased from
5  * multi-index database
6  *
7  * \note If entity/dof/finite element is removed is is clearded and
8  * removed from filed or finite element meshset
9  *
10  * \note If entity if deleted is cleated, removed and deleted from MoAB
11  * database.
12  *
13  * \todo Implement tag_field_delete, tag_field_delete_by_bit_ref to remove field
14  * tags from entities. This is for entities which are as well removed, thus
15  * cleared as well.
16  */
17 
18 /* MoFEM is free software: you can redistribute it and/or modify it under
19  * the terms of the GNU Lesser General Public License as published by the
20  * Free Software Foundation, either version 3 of the License, or (at your
21  * option) any later version.
22  *
23  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
24  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
26  * License for more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public
29  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
30  */
31 
32 #include <MoFEM.hpp>
33 
34 #define DeleteCoreFunctionBegin \
35  MoFEMFunctionBegin; \
36  MOFEM_LOG_CHANNEL("WORLD"); \
37  MOFEM_LOG_FUNCTION(); \
38  MOFEM_LOG_TAG("WORLD", "DeleteCore");
39 
40 namespace MoFEM {
41 
44  if (verb == -1)
45  verb = verbose;
46  Range ents;
47  for (DofEntity_multiIndex::iterator dit = dofsField.begin();
48  dit != dofsField.end();) {
49  if (!dit->get()->getActive()) {
50  dit = dofsField.erase(dit);
51  } else {
52  ++dit;
53  }
54  }
56 }
57 
59  const BitRefLevel mask,
60  int verb) {
62  if (verb == -1)
63  verb = verbose;
64  Range ents;
65  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
66  CHKERR clear_dofs_fields(ents, verb);
68 }
69 
70 MoFEMErrorCode Core::clear_dofs_fields(const Range ents, int verb) {
72  if (verb == -1)
73  verb = verbose;
74 
75  for (Range::const_pair_iterator p_eit = ents.pair_begin();
76  p_eit != ents.pair_end(); p_eit++) {
77  EntityHandle first = p_eit->first;
78  EntityHandle second = p_eit->second;
79  // get dofs range
80  DofEntityByEnt::iterator dit, hi_dit;
81  dit = dofsField.get<Ent_mi_tag>().lower_bound(first);
82  if (dit == dofsField.get<Ent_mi_tag>().end())
83  continue;
84  hi_dit = dofsField.get<Ent_mi_tag>().upper_bound(second);
85  // finally clear dofs
86  dofsField.get<Ent_mi_tag>().erase(dit, hi_dit);
87  }
89 }
90 
91 MoFEMErrorCode Core::clear_dofs_fields(const std::string name, const Range ents,
92  int verb) {
94  if (verb == -1)
95  verb = verbose;
96 
97  const auto bit_number = get_field_bit_number(name);
98 
99  for (Range::const_pair_iterator p_eit = ents.pair_begin();
100  p_eit != ents.pair_end(); p_eit++) {
101  const auto first = p_eit->first;
102  const auto second = p_eit->second;
103  const auto lo_uid = DofEntity::getLoFieldEntityUId(bit_number, first);
104  const auto hi_uid = DofEntity::getHiFieldEntityUId(bit_number, second);
105  auto dit = dofsField.get<Unique_mi_tag>().lower_bound(lo_uid);
106  auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(hi_uid);
107  dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
108  }
110 }
111 
113  const BitRefLevel mask,
114  int verb) {
116  if (verb == -1)
117  verb = verbose;
118  Range ents;
119  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
120  CHKERR clear_dofs_fields(ents, verb);
121  CHKERR clear_adjacencies_entities(ents, verb);
122  CHKERR clear_ents_fields(ents, verb);
124 }
125 
126 MoFEMErrorCode Core::clear_ents_fields(const Range ents, int verb) {
128  if (verb == -1)
129  verb = verbose;
130  CHKERR clear_dofs_fields(ents, verb);
131  CHKERR clear_adjacencies_entities(ents, verb);
132  for (Range::const_pair_iterator p_eit = ents.pair_begin();
133  p_eit != ents.pair_end(); p_eit++) {
134  EntityHandle first = p_eit->first;
135  EntityHandle second = p_eit->second;
136  FieldEntity_multiIndex::index<Ent_mi_tag>::type::iterator dit, hi_dit;
137  dit = entsFields.get<Ent_mi_tag>().lower_bound(first);
138  hi_dit = entsFields.get<Ent_mi_tag>().upper_bound(second);
139  entsFields.get<Ent_mi_tag>().erase(dit, hi_dit);
140  }
142 }
143 
144 MoFEMErrorCode Core::clear_ents_fields(const std::string name, const Range ents,
145  int verb) {
147  if (verb == -1)
148  verb = verbose;
149  const auto bit_number = get_field_bit_number(name);
150  CHKERR clear_dofs_fields(name, ents, verb);
151  CHKERR clear_adjacencies_entities(name, ents, verb);
152  for (Range::const_pair_iterator p_eit = ents.pair_begin();
153  p_eit != ents.pair_end(); p_eit++) {
154  const auto first = p_eit->first;
155  const auto second = p_eit->second;
156  auto dit = entsFields.get<Unique_mi_tag>().lower_bound(
157  FieldEntity::getLocalUniqueIdCalculate(bit_number, first));
158  auto hi_dit = entsFields.get<Unique_mi_tag>().upper_bound(
159  FieldEntity::getLocalUniqueIdCalculate(bit_number, second));
160  entsFields.get<Unique_mi_tag>().erase(dit, hi_dit);
161  }
163 }
164 
166  const EntityHandle meshset,
167  const EntityType type, int verb) {
169  if (verb == -1)
170  verb = verbose;
171  Range ents;
172  CHKERR get_moab().get_entities_by_type(meshset, type, ents);
173  CHKERR remove_ents_from_field(name, ents, verb);
175 }
176 
178  const Range ents, int verb) {
180  if (verb == -1)
181  verb = verbose;
182  EntityHandle meshset;
183  meshset = get_field_meshset(name);
184  CHKERR clear_ents_fields(name, ents, verb);
185  CHKERR get_moab().remove_entities(meshset, ents);
187 }
188 
189 MoFEMErrorCode Core::remove_ents_from_field(const Range ents, int verb) {
191  if (verb == -1)
192  verb = verbose;
193  CHKERR clear_ents_fields(ents, verb);
194  for (Field_multiIndex::iterator fit = fIelds.begin(); fit != fIelds.end();
195  fit++) {
196  EntityHandle meshset = fit->get()->getMeshset();
197  CHKERR get_moab().remove_entities(meshset, ents);
198  }
200 }
201 
203  const BitRefLevel mask,
204  int verb) {
206  if (verb == -1)
207  verb = verbose;
208  Range ents;
209  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
210  CHKERR remove_ents_from_field(ents, verb);
212 }
213 
215  const BitRefLevel mask,
216  int verb) {
218  if (verb == -1)
219  verb = verbose;
220  Range ents;
221  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
222  CHKERR clear_adjacencies_entities(ents, verb);
224 }
225 
228  if (verb == -1)
229  verb = verbose;
230  for (Range::const_pair_iterator p_eit = ents.pair_begin();
231  p_eit != ents.pair_end(); ++p_eit) {
232  const EntityHandle first = p_eit->first;
233  const EntityHandle second = p_eit->second;
235  Ent_mi_tag>::type::iterator ait,
236  hi_ait;
237  ait = entFEAdjacencies.get<Ent_mi_tag>().lower_bound(first);
238  hi_ait = entFEAdjacencies.get<Ent_mi_tag>().upper_bound(second);
239  entFEAdjacencies.get<Ent_mi_tag>().erase(ait, hi_ait);
240  }
242 }
243 
245  const Range ents, int verb) {
247  if (verb == -1)
248  verb = verbose;
249 
250  const Field *field_ptr = get_field_structure(name);
251  int field_bit_number = field_ptr->getBitNumber();
252  ParallelComm *pcomm =
253  ParallelComm::get_pcomm(&get_moab(), basicEntityDataPtr->pcommID);
254 
255  for (Range::const_pair_iterator p_eit = ents.pair_begin();
256  p_eit != ents.pair_end(); p_eit++) {
257 
258  // First and last handle
259  const EntityHandle first = p_eit->first;
260  const EntityHandle second = p_eit->second;
261 
262  // Get UId
263  UId first_uid =
264  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, first);
265  UId second_uid =
266  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, second);
267 
268  // Find adjacencies
269  auto ait = entFEAdjacencies.get<Unique_mi_tag>().lower_bound(first_uid);
270  auto hi_ait = entFEAdjacencies.get<Unique_mi_tag>().upper_bound(second_uid);
271  entFEAdjacencies.get<Unique_mi_tag>().erase(ait, hi_ait);
272  }
274 }
275 
277  const BitRefLevel mask,
278  int verb) {
280  if (verb == -1)
281  verb = verbose;
282  Range ents;
283  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
284  CHKERR clear_finite_elements(ents, verb);
286 }
287 
288 MoFEMErrorCode Core::clear_finite_elements(const Range ents, int verb) {
290  if (verb == -1)
291  verb = verbose;
292  CHKERR clear_adjacencies_finite_elements(ents, verb);
293  for (Range::const_pair_iterator p_eit = ents.pair_begin();
294  p_eit != ents.pair_end(); p_eit++) {
295  EntityHandle first = p_eit->first;
296  EntityHandle second = p_eit->second;
297  EntFiniteElement_multiIndex::index<Ent_mi_tag>::type::iterator fit, hi_fit;
298  fit = entsFiniteElements.get<Ent_mi_tag>().lower_bound(first);
299  hi_fit = entsFiniteElements.get<Ent_mi_tag>().upper_bound(second);
300  entsFiniteElements.get<Ent_mi_tag>().erase(fit, hi_fit);
301  }
303 }
304 
306  const Range ents, int verb) {
308  if (verb == -1)
309  verb = verbose;
310  CHKERR clear_adjacencies_finite_elements(name, ents, verb);
311  for (Range::const_pair_iterator p_eit = ents.pair_begin();
312  p_eit != ents.pair_end(); p_eit++) {
313  EntityHandle first = p_eit->first;
314  EntityHandle second = p_eit->second;
316  Composite_Name_And_Ent_mi_tag>::type::iterator fit,
317  hi_fit;
318  fit = entsFiniteElements.get<Composite_Name_And_Ent_mi_tag>().lower_bound(
319  boost::make_tuple(name, first));
320  hi_fit =
321  entsFiniteElements.get<Composite_Name_And_Ent_mi_tag>().upper_bound(
322  boost::make_tuple(name, second));
323  fit = entsFiniteElements.get<Composite_Name_And_Ent_mi_tag>().erase(fit,
324  hi_fit);
325  }
327 }
328 
330  const BitRefLevel mask,
331  int verb) {
333  Range ents;
334  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
335  CHKERR clear_adjacencies_finite_elements(ents, verb);
337 }
338 
340  int verb) {
342  if (verb == -1)
343  verb = verbose;
344  for (Range::const_pair_iterator p_eit = ents.pair_begin();
345  p_eit != ents.pair_end(); p_eit++) {
346  EntityHandle first = p_eit->first;
347  EntityHandle second = p_eit->second;
349  FEEnt_mi_tag>::type::iterator ait,
350  hi_ait;
351  ait = entFEAdjacencies.get<FEEnt_mi_tag>().lower_bound(first);
352  hi_ait = entFEAdjacencies.get<FEEnt_mi_tag>().upper_bound(second);
353  entFEAdjacencies.get<FEEnt_mi_tag>().erase(ait, hi_ait);
354  }
356 }
357 
359  const Range ents,
360  int verb) {
362  if (verb == -1)
363  verb = verbose;
364 
365  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator
366  it_fe = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
367  if (it_fe != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
368 
369  const auto fe_uid = (*it_fe)->getFEUId();
370 
371  for (Range::const_pair_iterator p_eit = ents.pair_begin();
372  p_eit != ents.pair_end(); p_eit++) {
373 
374  // First and last handle
375  const EntityHandle first = p_eit->first;
376  const EntityHandle second = p_eit->second;
377 
378  // Get UId
379  UId first_uid =
381  UId second_uid =
383 
384  // Find and remove adjacencies
386  FE_Unique_mi_tag>::type::iterator ait,
387  hi_ait;
388  ait = entFEAdjacencies.get<FE_Unique_mi_tag>().lower_bound(first_uid);
389  hi_ait = entFEAdjacencies.get<FE_Unique_mi_tag>().upper_bound(second_uid);
390  entFEAdjacencies.get<FE_Unique_mi_tag>().erase(ait, hi_ait);
391  }
392  }
394 }
395 
397  const EntityHandle meshset,
398  const EntityType type,
399  int verb) {
401  if (verb == -1)
402  verb = verbose;
403  Range ents;
404  CHKERR get_moab().get_entities_by_type(meshset, type, ents, false);
405  CHKERR remove_ents_from_finite_element(name, ents, verb);
407 }
408 
410  const Range ents,
411  int verb) {
413  if (verb == -1)
414  verb = verbose;
415  CHKERR clear_finite_elements(name, ents, verb);
416  const EntityHandle idm = get_finite_element_meshset(name);
417  CHKERR get_moab().remove_entities(idm, ents);
419 }
420 
422  int verb) {
424  if (verb == -1)
425  verb = verbose;
426  CHKERR clear_finite_elements(ents, verb);
427  for (FiniteElement_multiIndex::iterator fe_it = finiteElements.begin();
428  fe_it != finiteElements.end(); fe_it++) {
429  EntityHandle meshset = fe_it->get()->getMeshset();
430  CHKERR get_moab().remove_entities(meshset, ents);
431  }
433 }
434 
436  const BitRefLevel bit, const BitRefLevel mask, int verb) {
438  if (verb == -1)
439  verb = verbose;
440  Range ents;
441  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
442  CHKERR remove_ents_from_finite_element(ents, verb);
444 }
445 
446 MoFEMErrorCode Core::remove_ents(const Range ents, int verb) {
448  if (verb == -1)
449  verb = verbose;
450  CHKERR remove_ents_from_finite_element(ents, verb);
451  CHKERR remove_ents_from_field(ents, verb);
452 
453  for (Range::const_pair_iterator p_eit = ents.pair_begin();
454  p_eit != ents.pair_end(); ++p_eit) {
455 
456  RefElement_multiIndex::index<Ent_mi_tag>::type::iterator frit, hi_frit;
457  frit = refinedFiniteElements.get<Ent_mi_tag>().lower_bound(p_eit->first);
458  hi_frit =
459  refinedFiniteElements.get<Ent_mi_tag>().upper_bound(p_eit->second);
460  refinedFiniteElements.get<Ent_mi_tag>().erase(frit, hi_frit);
461 
462  RefEntity_multiIndex::index<Ent_mi_tag>::type::iterator rit, hi_rit;
463  rit = refinedEntities.get<Ent_mi_tag>().lower_bound(p_eit->first);
464  hi_rit = refinedEntities.get<Ent_mi_tag>().upper_bound(p_eit->second);
465  refinedEntities.get<Ent_mi_tag>().erase(rit, hi_rit);
466  }
467 
469 }
470 
472  const BitRefLevel mask, int verb) {
474  if (verb == -1)
475  verb = verbose;
476  Range ents;
477  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
478  CHKERR remove_ents(ents, verb);
480 }
481 
483  const BitRefLevel mask,
484  int verb) {
486  if (verb == -1)
487  verb = verbose;
488  Range ents;
489  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
490  CHKERR remove_parents_by_ents(ents, verb);
492 }
493 
494 MoFEMErrorCode Core::remove_parents_by_ents(const Range &ents, int verb) {
496 
497  std::vector<EntityHandle> leftovers_ents;
498  leftovers_ents.reserve(ents.size());
499 
500  for (auto pit = ents.pair_begin(); pit != ents.pair_end(); ++pit) {
501 
502  EntityHandle f = pit->first;
503  const EntityHandle s = pit->second;
504  auto lo = refinedEntities.lower_bound(f);
505  for (; f <= s; ++f) {
506 
507  auto check = [this](auto lo, auto f) {
508  if (lo == refinedEntities.end())
509  return false;
510  if ((*lo)->getEnt() == f)
511  return true;
512  return false;
513  };
514 
515  if (check(lo, f)) {
516  bool success = refinedEntities.modify(lo, RefEntity_change_parent(0));
517  if (!success)
518  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
519  "Operation of removing parent unsuccessful");
520  ++lo;
521  } else
522  leftovers_ents.emplace_back(f);
523  }
524  }
525 
526  if (!leftovers_ents.empty()) {
527  std::vector<EntityHandle> zero_parents(leftovers_ents.size());
528  CHKERR get_moab().tag_set_data(th_RefParentHandle, &leftovers_ents[0],
529  leftovers_ents.size(),
530  &*zero_parents.begin());
531  }
533 }
534 
535 MoFEMErrorCode Core::remove_parents_by_parents(const Range &ents, int verb) {
537  for (Range::iterator eit = ents.begin(); eit != ents.end(); ++eit) {
538  RefEntity_multiIndex::index<Ent_Ent_mi_tag>::type::iterator it;
539  while ((it = refinedEntities.get<Ent_Ent_mi_tag>().find(*eit)) !=
540  refinedEntities.get<Ent_Ent_mi_tag>().end()) {
541  bool success = refinedEntities.get<Ent_Ent_mi_tag>().modify(
542  it, RefEntity_change_parent(0));
543  if (!success) {
544  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
545  "Operation of removing parent unsuccessful");
546  }
547  }
548  }
550 }
551 
553  const BitRefLevel mask,
554  const bool remove_parent, int verb,
555  MoFEMTypes mf) {
557  if (verb == -1)
558  verb = verbose;
559 
560  Range ents;
561  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
562  Range ents_meshsets = ents.subset_by_type(MBENTITYSET);
563  ents = subtract(ents, ents_meshsets);
564  if(ents.empty()) {
565  if (verb >= VERBOSE)
566  MOFEM_LOG("WORLD", Sev::verbose) << "Nb. of deleted entities 0";
568  }
569 
570  if (verb >= VERBOSE)
571  MOFEM_LOG("WORLD", Sev::noisy) << "Deleted ents:\n" << ents;
572 
573  CHKERR remove_ents(ents, verb);
574 
575  // remove parent
576  if (remove_parent) {
577  CHKERR remove_parents_by_parents(ents);
578  }
579 
580  Range meshsets;
581  CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets, true);
582  for (auto m : meshsets) {
583  CHKERR get_moab().remove_entities(m, ents);
584 
585  }
586 
587  rval = get_moab().delete_entities(ents);
588  if (rval != MB_SUCCESS) {
590  if (verb == QUIET) {
591  MOFEM_LOG("SELF", Sev::noisy) << "Problem deleting:\n" << ents;
592  } else {
593  MOFEM_LOG("SELF", Sev::warning) << "Problem deleting:\n" << ents;
594  }
595  MOFEM_LOG_CHANNEL("WORLD");
596  MOFEM_LOG_TAG("WORLD", "DeleteCore");
597  if (!(mf & MF_NOT_THROW)) {
598  CHK_MOAB_THROW(rval, "Can not delete entities");
599  } else {
600  rval = MB_SUCCESS;
601  }
602  }
603 
604  MOFEM_LOG_C("SELF", Sev::noisy, "Nb. of deleted entities %d", ents.size());
605 
607 }
608 
609 MoFEMErrorCode Core::delete_finite_element(const std::string name, int verb) {
611  auto &fe = finiteElements.get<FiniteElement_name_mi_tag>();
612  auto mit = fe.find(name);
613  if (mit == fe.end()) {
614  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
615  "Finite element <%s> not found", name.c_str());
616  }
617  EntityHandle meshset = mit->get()->getMeshset();
618  Range ents;
619  CHKERR get_moab().get_entities_by_handle(meshset, ents, false);
620  CHKERR remove_ents_from_finite_element(name, ents, verb);
621  fe.erase(mit);
622  CHKERR get_moab().delete_entities(&meshset, 1);
624 }
625 
626 MoFEMErrorCode Core::delete_field(const std::string name, int verb) {
628  auto &f = fIelds.get<FieldName_mi_tag>();
629  auto mit = f.find(name);
630  if (mit == f.end()) {
631  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
632  "Finite element <%s> not found", name.c_str());
633  }
634  EntityHandle meshset = mit->get()->getMeshset();
635  Range ents;
636  CHKERR get_moab().get_entities_by_handle(meshset, ents, false);
637  CHKERR remove_ents_from_field(name, ents, verb);
638  CHKERR get_moab().tag_delete((*mit)->th_FieldDataVerts);
639  CHKERR get_moab().tag_delete((*mit)->th_FieldData);
640  CHKERR get_moab().tag_delete((*mit)->th_AppOrder);
641  f.erase(mit);
642  CHKERR get_moab().delete_entities(&meshset, 1);
644 }
645 } // namespace MoFEM
#define DeleteCoreFunctionBegin
Definition: DeleteCore.cpp:34
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:314
@ QUIET
Definition: definitions.h:221
@ VERBOSE
Definition: definitions.h:222
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:110
@ MF_NOT_THROW
Definition: definitions.h:114
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:47
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
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
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:311
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:342
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:287
#define MOFEM_LOG_ATTRIBUTES(channel, bit)
Add attributes to channel.
Definition: LogManager.hpp:299
auto bit
set bit
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
uint128_t UId
Unique Id.
Definition: Types.hpp:42
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
FTensor::Index< 'm', 3 > m
Managing BitRefLevels.
MoFEMErrorCode clear_adjacencies_entities(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
clear adjacency map for entities on given bit level
Definition: DeleteCore.cpp:214
MoFEMErrorCode remove_ents_from_finite_element(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)
remove entities from given refinement level to finite element database
Definition: DeleteCore.cpp:396
MoFEMErrorCode clear_ents_fields_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:112
MoFEMErrorCode remove_ents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
remove entities form mofem database
Definition: DeleteCore.cpp:471
MoFEMErrorCode clear_finite_elements_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:276
MoFEMErrorCode clear_dofs_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:70
MoFEMErrorCode clear_dofs_fields_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:58
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
Definition: DeleteCore.cpp:435
MoFEMErrorCode remove_parents_by_ents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove parents from entities.
Definition: DeleteCore.cpp:494
MoFEMErrorCode delete_finite_element(const std::string name, int verb=DEFAULT_VERBOSITY)
delete finite element from mofem database
Definition: DeleteCore.cpp:609
MoFEMErrorCode remove_ents_from_field(const std::string name, const EntityHandle meshset, const EntityType type, int verb=DEFAULT_VERBOSITY)
remove entities from field
Definition: DeleteCore.cpp:165
MoFEMErrorCode clear_inactive_dofs(int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:42
MoFEMErrorCode clear_adjacencies_finite_elements(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
clear adjacency map for finite elements on given bit level
Definition: DeleteCore.cpp:329
MoFEMErrorCode clear_finite_elements(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:288
MoFEMErrorCode delete_field(const std::string name, int verb=DEFAULT_VERBOSITY)
Delete field.
Definition: DeleteCore.cpp:626
MoFEMErrorCode remove_parents_by_parents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove paremts from entities having parents in passed range.
Definition: DeleteCore.cpp:535
MoFEMErrorCode remove_parents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
Remove parent from entities on bit level.
Definition: DeleteCore.cpp:482
MoFEMErrorCode clear_ents_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:126
MoFEMErrorCode remove_ents(const Range ents, int verb=DEFAULT_VERBOSITY)
remove entities form mofem database
Definition: DeleteCore.cpp:446
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
Definition: DeleteCore.cpp:552
MoFEMErrorCode remove_ents_from_field_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
remove entities from field
Definition: DeleteCore.cpp:202
static UId getLoFieldEntityUId(const FieldBitNumber bit, const EntityHandle ent)
static UId getHiFieldEntityUId(const FieldBitNumber bit, const EntityHandle ent)
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
Provide data structure for (tensor) field approximation.
FieldBitNumber getBitNumber() const
Get number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set for giv...
MultiIndex Tag for field name.