v0.9.1
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 namespace MoFEM {
33 
36  if (verb == -1)
37  verb = verbose;
38  Range ents;
39  for (DofEntity_multiIndex::iterator dit = dofsField.begin();
40  dit != dofsField.end();) {
41  if (!dit->get()->getActive()) {
42  dit = dofsField.erase(dit);
43  } else {
44  ++dit;
45  }
46  }
48 }
49 
51  const BitRefLevel mask, int verb) {
53  if (verb == -1)
54  verb = verbose;
55  Range ents;
56  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
57  CHKERR clear_dofs_fields(ents, verb);
59 }
60 
61 MoFEMErrorCode Core::clear_dofs_fields(const Range ents, int verb) {
63  if (verb == -1)
64  verb = verbose;
65 
66  for (Range::const_pair_iterator p_eit = ents.pair_begin();
67  p_eit != ents.pair_end(); p_eit++) {
68  EntityHandle first = p_eit->first;
69  EntityHandle second = p_eit->second;
70  // get dofs range
71  DofEntityByEnt::iterator dit, hi_dit;
72  dit = dofsField.get<Ent_mi_tag>().lower_bound(first);
73  if (dit == dofsField.get<Ent_mi_tag>().end())
74  continue;
75  hi_dit = dofsField.get<Ent_mi_tag>().upper_bound(second);
76  // finally clear dofs
77  dofsField.get<Ent_mi_tag>().erase(dit,hi_dit);
78  }
80 }
81 
82 MoFEMErrorCode Core::clear_dofs_fields(const std::string name,
83  const Range ents, int verb) {
85  if (verb == -1)
86  verb = verbose;
87 
88  for (Range::const_pair_iterator p_eit = ents.pair_begin();
89  p_eit != ents.pair_end(); p_eit++) {
90  EntityHandle first = p_eit->first;
91  EntityHandle second = p_eit->second;
92  DofEntityByNameAndEnt::iterator dit, hi_dit;
93  dit = dofsField.get<Composite_Name_And_Ent_mi_tag>().lower_bound(
94  boost::make_tuple(name, first));
95  hi_dit = dofsField.get<Composite_Name_And_Ent_mi_tag>().upper_bound(
96  boost::make_tuple(name, second));
97  dofsField.get<Composite_Name_And_Ent_mi_tag>().erase(dit, hi_dit);
98  }
100 }
101 
103  const BitRefLevel mask, int verb) {
105  if (verb == -1)
106  verb = verbose;
107  Range ents;
108  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
109  CHKERR clear_dofs_fields(ents, verb);
111  CHKERR clear_ents_fields(ents, verb);
113 }
114 
115 MoFEMErrorCode Core::clear_ents_fields(const Range ents, int verb) {
117  if (verb == -1)
118  verb = verbose;
119  CHKERR clear_dofs_fields(ents, verb);
121  for (Range::const_pair_iterator p_eit = ents.pair_begin();
122  p_eit != ents.pair_end(); p_eit++) {
123  EntityHandle first = p_eit->first;
124  EntityHandle second = p_eit->second;
125  FieldEntity_multiIndex::index<Ent_mi_tag>::type::iterator dit, hi_dit;
126  dit = entsFields.get<Ent_mi_tag>().lower_bound(first);
127  hi_dit = entsFields.get<Ent_mi_tag>().upper_bound(second);
128  entsFields.get<Ent_mi_tag>().erase(dit, hi_dit);
129  }
131 }
132 
134  const Range ents, int verb) {
136  if (verb == -1)
137  verb = verbose;
138  CHKERR clear_dofs_fields(name, ents, verb);
139  CHKERR clear_adjacencies_entities(name, ents, verb);
140  for (Range::const_pair_iterator p_eit = ents.pair_begin();
141  p_eit != ents.pair_end(); p_eit++) {
142  EntityHandle first = p_eit->first;
143  EntityHandle second = p_eit->second;
144  FieldEntity_multiIndex::index<Composite_Name_And_Ent_mi_tag>::type::iterator
145  dit,
146  hi_dit;
147  dit = entsFields.get<Composite_Name_And_Ent_mi_tag>().lower_bound(
148  boost::make_tuple(name, first));
149  hi_dit = entsFields.get<Composite_Name_And_Ent_mi_tag>().upper_bound(
150  boost::make_tuple(name, second));
151  entsFields.get<Composite_Name_And_Ent_mi_tag>().erase(dit, hi_dit);
152  }
154 }
155 
157  const EntityHandle meshset,
158  const EntityType type, int verb) {
160  if (verb == -1)
161  verb = verbose;
162  Range ents;
163  CHKERR get_moab().get_entities_by_type(meshset, type, ents);
164  CHKERR remove_ents_from_field(name, ents, verb);
166 }
167 
169  const Range ents, int verb) {
171  if (verb == -1)
172  verb = verbose;
173  EntityHandle meshset;
174  meshset = get_field_meshset(name);
175  CHKERR clear_ents_fields(name, ents, verb);
176  CHKERR get_moab().remove_entities(meshset, ents);
178 }
179 
180 MoFEMErrorCode Core::remove_ents_from_field(const Range ents, int verb) {
182  if (verb == -1)
183  verb = verbose;
184  CHKERR clear_ents_fields(ents, verb);
185  for (Field_multiIndex::iterator fit = fIelds.begin(); fit != fIelds.end();
186  fit++) {
187  EntityHandle meshset = fit->get()->getMeshset();
188  CHKERR get_moab().remove_entities(meshset, ents);
189  }
191 }
192 
194  const BitRefLevel mask,
195  int verb) {
197  if (verb == -1)
198  verb = verbose;
199  Range ents;
200  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
201  CHKERR remove_ents_from_field(ents, verb);
203 }
204 
206  const BitRefLevel mask,
207  int verb) {
209  if (verb == -1)
210  verb = verbose;
211  Range ents;
212  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
215 }
216 
219  if (verb == -1)
220  verb = verbose;
221  for (Range::const_pair_iterator p_eit = ents.pair_begin();
222  p_eit != ents.pair_end(); ++p_eit) {
223  const EntityHandle first = p_eit->first;
224  const EntityHandle second = p_eit->second;
225  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
226  Ent_mi_tag>::type::iterator ait,
227  hi_ait;
228  ait = entFEAdjacencies.get<Ent_mi_tag>().lower_bound(first);
229  hi_ait = entFEAdjacencies.get<Ent_mi_tag>().upper_bound(second);
230  entFEAdjacencies.get<Ent_mi_tag>().erase(ait, hi_ait);
231  }
233 }
234 
236  const Range ents, int verb) {
238  if (verb == -1)
239  verb = verbose;
240 
241  const Field *field_ptr = get_field_structure(name);
242  int field_bit_number = field_ptr->getBitNumber();
243  bool is_distributed_mesh = basicEntityDataPtr->trueIfDistributedMesh();
244  ParallelComm *pcomm =
245  ParallelComm::get_pcomm(&get_moab(), basicEntityDataPtr->pcommID);
246 
247  for (Range::const_pair_iterator p_eit = ents.pair_begin();
248  p_eit != ents.pair_end(); p_eit++) {
249 
250  // First and last handle
251  const EntityHandle first = p_eit->first;
252  const EntityHandle second = p_eit->second;
253 
254  // Get owner proc and owner handle
255  int f_owner_proc;
256  EntityHandle f_moab_owner_handle;
257  CHKERR pcomm->get_owner_handle(first, f_owner_proc, f_moab_owner_handle);
258  int s_owner_proc;
259  EntityHandle s_moab_owner_handle;
260  CHKERR pcomm->get_owner_handle(second, s_owner_proc, s_moab_owner_handle);
261 
262  // Get UId
264  f_owner_proc, field_bit_number, f_moab_owner_handle,
265  is_distributed_mesh);
267  s_owner_proc, field_bit_number, s_moab_owner_handle,
268  is_distributed_mesh);
269 
270  // Find adjacencies
271  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
272  Unique_mi_tag>::type::iterator ait,
273  hi_ait;
274  ait = entFEAdjacencies.get<Unique_mi_tag>().lower_bound(first_uid);
275  hi_ait = entFEAdjacencies.get<Unique_mi_tag>().upper_bound(second_uid);
276  entFEAdjacencies.get<Unique_mi_tag>().erase(ait, hi_ait);
277  }
279 }
280 
282  const BitRefLevel mask,
283  int verb) {
285  if (verb == -1)
286  verb = verbose;
287  Range ents;
288  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
289  CHKERR clear_finite_elements(ents, verb);
291 }
292 
293 MoFEMErrorCode Core::clear_finite_elements(const Range ents, int verb) {
295  if (verb == -1)
296  verb = verbose;
298  for (Range::const_pair_iterator p_eit = ents.pair_begin();
299  p_eit != ents.pair_end(); p_eit++) {
300  EntityHandle first = p_eit->first;
301  EntityHandle second = p_eit->second;
302  EntFiniteElement_multiIndex::index<Ent_mi_tag>::type::iterator fit, hi_fit;
303  fit = entsFiniteElements.get<Ent_mi_tag>().lower_bound(first);
304  hi_fit = entsFiniteElements.get<Ent_mi_tag>().upper_bound(second);
305  entsFiniteElements.get<Ent_mi_tag>().erase(fit, hi_fit);
306  }
308 }
309 
311  const Range ents, int verb) {
313  if (verb == -1)
314  verb = verbose;
315  CHKERR clear_adjacencies_finite_elements(name, ents, verb);
316  for (Range::const_pair_iterator p_eit = ents.pair_begin();
317  p_eit != ents.pair_end(); p_eit++) {
318  EntityHandle first = p_eit->first;
319  EntityHandle second = p_eit->second;
320  EntFiniteElement_multiIndex::index<
321  Composite_Name_And_Ent_mi_tag>::type::iterator fit,
322  hi_fit;
323  fit = entsFiniteElements.get<Composite_Name_And_Ent_mi_tag>().lower_bound(
324  boost::make_tuple(name, first));
325  hi_fit =
327  boost::make_tuple(name, second));
328  fit = entsFiniteElements.get<Composite_Name_And_Ent_mi_tag>().erase(fit,
329  hi_fit);
330  }
332 }
333 
335  const BitRefLevel mask,
336  int verb) {
338  Range ents;
339  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
342 }
343 
345  int verb) {
347  if (verb == -1)
348  verb = verbose;
349  for (Range::const_pair_iterator p_eit = ents.pair_begin();
350  p_eit != ents.pair_end(); p_eit++) {
351  EntityHandle first = p_eit->first;
352  EntityHandle second = p_eit->second;
353  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
354  FEEnt_mi_tag>::type::iterator ait,
355  hi_ait;
356  ait = entFEAdjacencies.get<FEEnt_mi_tag>().lower_bound(first);
357  hi_ait = entFEAdjacencies.get<FEEnt_mi_tag>().upper_bound(second);
358  entFEAdjacencies.get<FEEnt_mi_tag>().erase(ait, hi_ait);
359  }
361 }
362 
364  const Range ents,
365  int verb) {
367  if (verb == -1)
368  verb = verbose;
369 
370  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator
371  it_fe = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
372  if (it_fe != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
373 
374  const int fe_bit_number = it_fe->get()->getBitNumber();
375 
376  for (Range::const_pair_iterator p_eit = ents.pair_begin();
377  p_eit != ents.pair_end(); p_eit++) {
378 
379  // First and last handle
380  const EntityHandle first = p_eit->first;
381  const EntityHandle second = p_eit->second;
382 
383  // Get UId
384  UId first_uid =
385  EntFiniteElement::getGlobalUniqueIdCalculate(first, fe_bit_number);
386  UId second_uid =
387  EntFiniteElement::getGlobalUniqueIdCalculate(second, fe_bit_number);
388 
389  // Find and remove adjacencies
390  FieldEntityEntFiniteElementAdjacencyMap_multiIndex::index<
391  FE_Unique_mi_tag>::type::iterator ait,
392  hi_ait;
393  ait = entFEAdjacencies.get<FE_Unique_mi_tag>().lower_bound(first_uid);
394  hi_ait = entFEAdjacencies.get<FE_Unique_mi_tag>().upper_bound(second_uid);
395  entFEAdjacencies.get<FE_Unique_mi_tag>().erase(ait, hi_ait);
396  }
397  }
399 }
400 
402  const EntityHandle meshset,
403  const EntityType type,
404  int verb) {
406  if (verb == -1)
407  verb = verbose;
408  Range ents;
409  CHKERR get_moab().get_entities_by_type(meshset, type, ents, false);
410  CHKERR remove_ents_from_finite_element(name, ents, verb);
412 }
413 
415  const Range ents,
416  int verb) {
418  if (verb == -1)
419  verb = verbose;
420  CHKERR clear_finite_elements(name, ents, verb);
421  const EntityHandle idm = get_finite_element_meshset(name);
422  CHKERR get_moab().remove_entities(idm, ents);
424 }
425 
427  int verb) {
429  if (verb == -1)
430  verb = verbose;
431  CHKERR clear_finite_elements(ents, verb);
432  for (FiniteElement_multiIndex::iterator fe_it = finiteElements.begin();
433  fe_it != finiteElements.end(); fe_it++) {
434  EntityHandle meshset = fe_it->get()->getMeshset();
435  CHKERR get_moab().remove_entities(meshset, ents);
436  }
438 }
439 
441  const BitRefLevel bit, const BitRefLevel mask, int verb) {
443  if (verb == -1)
444  verb = verbose;
445  Range ents;
446  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
449 }
450 
451 MoFEMErrorCode Core::remove_ents(const Range ents, int verb) {
453  if (verb == -1)
454  verb = verbose;
456  CHKERR remove_ents_from_field(ents, verb);
457 
458  for (Range::const_pair_iterator p_eit = ents.pair_begin();
459  p_eit != ents.pair_end(); ++p_eit) {
460 
461  RefElement_multiIndex::index<Ent_mi_tag>::type::iterator frit, hi_frit;
462  frit = refinedFiniteElements.get<Ent_mi_tag>().lower_bound(p_eit->first);
463  hi_frit =
464  refinedFiniteElements.get<Ent_mi_tag>().upper_bound(p_eit->second);
465  refinedFiniteElements.get<Ent_mi_tag>().erase(frit, hi_frit);
466 
467  RefEntity_multiIndex::index<Ent_mi_tag>::type::iterator rit, hi_rit;
468  rit = refinedEntities.get<Ent_mi_tag>().lower_bound(p_eit->first);
469  hi_rit = refinedEntities.get<Ent_mi_tag>().upper_bound(p_eit->second);
470  refinedEntities.get<Ent_mi_tag>().erase(rit, hi_rit);
471 
472  }
473 
475 }
476 
478  const BitRefLevel mask, int verb) {
480  if (verb == -1)
481  verb = verbose;
482  Range ents;
483  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
484  CHKERR remove_ents(ents, verb);
486 }
487 
489  const BitRefLevel &mask,
490  int verb) {
492  if (verb == -1)
493  verb = verbose;
494  Range ents;
495  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
496  CHKERR remove_parents_by_ents(ents, verb);
498 }
499 
500 MoFEMErrorCode Core::remove_parents_by_ents(const Range &ents, int verb) {
502  Range removed_from_ents;
503  for (Range::iterator eit = ents.begin(); eit != ents.end(); ++eit) {
504  RefEntity_multiIndex::iterator it = refinedEntities.find(*eit);
505  if (it != refinedEntities.end()) {
506  bool success = refinedEntities.modify(it, RefEntity_change_parent(0));
507  if (!success) {
508  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
509  "Operation of removing parent unsuccessful");
510  } else {
511  removed_from_ents.insert(*eit);
512  }
513  }
514  }
515  Range leftovers_ents = subtract(ents,removed_from_ents);
516  if (!leftovers_ents.empty()) {
517  std::vector<EntityHandle> zero_parents(leftovers_ents.size());
518  CHKERR get_moab().tag_set_data(th_RefParentHandle, leftovers_ents,
519  &*zero_parents.begin());
520  }
522 }
523 
524 MoFEMErrorCode Core::remove_parents_by_parents(const Range &ents, int verb) {
526  for (Range::iterator eit = ents.begin(); eit != ents.end(); ++eit) {
527  RefEntity_multiIndex::index<Ent_Ent_mi_tag>::type::iterator it;
528  while ((it = refinedEntities.get<Ent_Ent_mi_tag>().find(*eit)) !=
529  refinedEntities.get<Ent_Ent_mi_tag>().end()) {
530  bool success = refinedEntities.get<Ent_Ent_mi_tag>().modify(
531  it, RefEntity_change_parent(0));
532  if (!success) {
533  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
534  "Operation of removing parent unsuccessful");
535  }
536  }
537  }
539 }
540 
542  const BitRefLevel mask,
543  const bool remove_parent,
544  int verb) {
545 
547  if (verb == -1)
548  verb = verbose;
549 
550  Range ents;
551  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents, verb);
552  Range ents_meshsets = ents.subset_by_type(MBENTITYSET);
553  ents = subtract(ents,ents_meshsets);
554 
555  CHKERR remove_ents(ents, verb);
556 
557  // remove parent
558  if (remove_parent) {
560  }
561 
562  Range meshsets;
563  CHKERR get_moab().get_entities_by_type(0, MBENTITYSET, meshsets, false);
564  for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
565  CHKERR get_moab().remove_entities(*mit, ents);
566  }
567 
568  rval = get_moab().delete_entities(ents);
569  if(rval != MB_SUCCESS) {
570  if(verb >= VERY_VERBOSE) {
571  for (Range::iterator eit = ents.begin(); eit != ents.end(); ++eit) {
572  try {
573  RefEntity ref_ent(basicEntityDataPtr, *eit);
574  cerr << "Error: " << RefEntity(basicEntityDataPtr, *eit) << " "
575  << ref_ent.getBitRefLevel() << endl;
576  } catch (std::exception const &ex) {
577  }
578  };
579  }
580  EntityHandle out_meshset;
581  CHKERR get_moab().create_meshset(MESHSET_SET, out_meshset);
582  CHKERR get_moab().add_entities(out_meshset,ents);
583  CHKERR get_moab().write_file("error.vtk", "VTK", "", &out_meshset, 1);
584  THROW_MESSAGE("Can not delete entities from MoAB database (see error.vtk)");
585  }
586 
587  if(verb >= VERBOSE) {
588  PetscPrintf(get_comm(),"Nb. of deleted entities %d\n",ents.size());
589  }
590 
592 }
593 
594 MoFEMErrorCode Core::delete_finite_element(const std::string name, int verb) {
597  FiniteElementsByName;
598  FiniteElementsByName &fe = finiteElements.get<FiniteElement_name_mi_tag>();
599  FiniteElementsByName::iterator mit = fe.find(name);
600  if (mit == fe.end()) {
601  SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
602  "Finite element <%s> not found", name.c_str());
603  }
604  EntityHandle meshset = mit->get()->getMeshset();
605  Range ents;
606  CHKERR get_moab().get_entities_by_handle(meshset, ents, false);
607  CHKERR remove_ents_from_finite_element(name, ents, verb);
608  fe.erase(mit);
609  CHKERR get_moab().delete_entities(&meshset, 1);
611 }
612 }
DofEntity_multiIndex dofsField
dofs on fields
Definition: Core.hpp:249
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:268
MoFEMErrorCode delete_finite_element(const std::string name, int verb=DEFAULT_VERBOSITY)
delete finite element from mofem database
Definition: DeleteCore.cpp:594
change parentUse this function with care. Some other multi-indices can deponent on this.
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:205
RefEntity_multiIndex refinedEntities
refined entities
Definition: Core.hpp:244
Provide data structure for (tensor) field approximation.The Field is intended to provide support for ...
FieldEntity_multiIndex entsFields
entities on fields
Definition: Core.hpp:248
moab::Interface & get_moab()
Definition: Core.hpp:266
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
MoFEMErrorCode remove_parents_by_ents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove parents from entities.
Definition: DeleteCore.cpp:500
Tag th_RefParentHandle
Definition: Core.hpp:201
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
MoFEMErrorCode clear_inactive_dofs(int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:34
UId getGlobalUniqueIdCalculate() const
Calculate global UId.
UId getGlobalUniqueIdCalculate() const
Generate UId for finite element entity.
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:625
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
MoFEMErrorCode remove_ents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
remove entities form mofem database
Definition: DeleteCore.cpp:477
Struct keeps handle to refined handle.
const Field * get_field_structure(const std::string &name)
get field structure
Definition: FieldCore.cpp:51
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
MoFEMErrorCode remove_parents_by_by_bit_ref(const BitRefLevel &bit, const BitRefLevel &mask, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:488
MoFEMErrorCode clear_dofs_fields_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:50
MoFEMErrorCode clear_ents_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:115
MoFEMErrorCode clear_ents_fields_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:102
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
FieldEntityEntFiniteElementAdjacencyMap_multiIndex entFEAdjacencies
adjacencies of elements to dofs
Definition: Core.hpp:255
MoFEMErrorCode clear_dofs_fields(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:61
Managing BitRefLevels.
RefElement_multiIndex refinedFiniteElements
refined elements
Definition: Core.hpp:245
FiniteElement_multiIndex finiteElements
finite elements
Definition: Core.hpp:251
#define CHKERR
Inline error check.
Definition: definitions.h:601
Field_multiIndex fIelds
fields
Definition: Core.hpp:247
boost::shared_ptr< BasicEntityData > basicEntityDataPtr
Definition: Core.hpp:225
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:156
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
unsigned int getBitNumber() const
Get number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set for giv...
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 clear_finite_elements(const Range ents, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:293
MoFEMErrorCode remove_parents_by_parents(const Range &ents, int verb=DEFAULT_VERBOSITY)
Remove paremts from entities having parents in passed range.
Definition: DeleteCore.cpp:524
int verbose
Verbosity level.
Definition: Core.hpp:885
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:334
static MoFEMErrorCode getBitRefLevel(Interface &moab, Range ents, std::vector< BitRefLevel > &vec_bit_ref_level)
EntityHandle get_field_meshset(const BitFieldId id) const
Definition: FieldCore.cpp:31
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
MoFEMErrorCode delete_ents_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, const bool remove_parent=false, int verb=DEFAULT_VERBOSITY)
delete entities form mofem and moab database
Definition: DeleteCore.cpp:541
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:193
EntFiniteElement_multiIndex entsFiniteElements
finite element entities
Definition: Core.hpp:252
MoFEMErrorCode remove_ents(const Range ents, int verb=DEFAULT_VERBOSITY)
remove entities form mofem database
Definition: DeleteCore.cpp:451
MPI_Comm & get_comm() const
Definition: Core.hpp:855
uint128_t UId
Unique Id.
Definition: Types.hpp:41
MoFEMErrorCode clear_finite_elements_by_bit_ref(const BitRefLevel bit, const BitRefLevel mask, int verb=DEFAULT_VERBOSITY)
Definition: DeleteCore.cpp:281
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:401
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:440