v0.14.0
FECore.cpp
Go to the documentation of this file.
1 /** \file FECore.cpp
2  * \brief Core interface methods for managing deletions and insertion dofs
3  */
4 
5 #include <MoFEM.hpp>
6 
7 #define FECoreFunctionBegin \
8  MoFEMFunctionBegin; \
9  MOFEM_LOG_CHANNEL("WORLD"); \
10  MOFEM_LOG_CHANNEL("SYNC"); \
11  MOFEM_LOG_FUNCTION(); \
12  MOFEM_LOG_TAG("WORLD", "FECore"); \
13  MOFEM_LOG_TAG("SYNC", "FECore");
14 
15 namespace MoFEM {
16 
17 const FiniteElement *
18 Core::get_finite_element_structure(const std::string &name,
19  enum MoFEMTypes bh) const {
20  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
21  if (miit == finiteElements.get<FiniteElement_name_mi_tag>().end()) {
22  if (bh == MF_EXIST) {
23  throw MoFEMException(
25  std::string("finite element < " + name +
26  " > not in database (top tip: check spelling)")
27  .c_str());
28  } else {
29  return nullptr;
30  }
31  }
32  return miit->get();
33 }
34 
35 bool Core::check_finite_element(const std::string &name) const {
36  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
37  if (miit == finiteElements.get<FiniteElement_name_mi_tag>().end())
38  return false;
39  else
40  return true;
41 }
42 
43 MoFEMErrorCode Core::add_finite_element(const std::string &fe_name,
44  enum MoFEMTypes bh, int verb) {
46  *buildMoFEM &= 1 << 0;
47  if (verb == -1) {
48  verb = verbose;
49  }
50 
51  // Add finite element meshset to partion meshset. In case of no elements
52  // on processor part, when mesh file is read, finite element meshset is
53  // prevented from deletion by moab reader.
54  auto add_meshset_to_partition = [&](auto meshset) {
56  const void *tag_vals[] = {&rAnk};
57  ParallelComm *pcomm = ParallelComm::get_pcomm(
58  &get_moab(), get_basic_entity_data_ptr()->pcommID);
59  Tag part_tag = pcomm->part_tag();
60  Range tagged_sets;
61  CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
62  tag_vals, 1, tagged_sets,
63  moab::Interface::UNION);
64  for (auto s : tagged_sets)
65  CHKERR get_moab().add_entities(s, &meshset, 1);
67  };
68 
69  auto &finite_element_name_set =
70  finiteElements.get<FiniteElement_name_mi_tag>();
71  auto it_fe = finite_element_name_set.find(fe_name);
72 
73  if (bh == MF_EXCL) {
74  if (it_fe != finite_element_name_set.end()) {
75  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "this < %s > is there",
76  fe_name.c_str());
77  }
78 
79  } else {
80  if (it_fe != finite_element_name_set.end())
82  }
83  EntityHandle meshset;
84  CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
85  CHKERR add_meshset_to_partition(meshset);
86 
87  // id
88  int fe_shift = 0;
89  for (; finiteElements.get<BitFEId_mi_tag>().find(BitFEId().set(fe_shift)) !=
90  finiteElements.get<BitFEId_mi_tag>().end();
91  ++fe_shift) {
92  }
93 
94  auto id = BitFEId().set(fe_shift);
95  CHKERR get_moab().tag_set_data(th_FEId, &meshset, 1, &id);
96 
97  // id name
98  void const *tag_data[] = {fe_name.c_str()};
99  int tag_sizes[1];
100  tag_sizes[0] = fe_name.size();
101  CHKERR get_moab().tag_set_by_ptr(th_FEName, &meshset, 1, tag_data, tag_sizes);
102 
103  // add FiniteElement
104  auto p = finiteElements.insert(
105  boost::shared_ptr<FiniteElement>(new FiniteElement(moab, meshset)));
106  if (!p.second)
107  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
108  "FiniteElement not inserted");
109 
110  if (verb > QUIET)
111  MOFEM_LOG("WORLD", Sev::inform) << "Add finite element " << fe_name;
112 
114 }
115 
118  const EntityType type,
119  ElementAdjacencyFunct function) {
121  *buildMoFEM &= 1 << 0;
123  FiniteElements_by_name;
124  FiniteElements_by_name &finite_element_name_set =
125  finiteElements.get<FiniteElement_name_mi_tag>();
126  FiniteElements_by_name::iterator it_fe =
127  finite_element_name_set.find(fe_name);
128  if (it_fe == finite_element_name_set.end())
129  SETERRQ(mofemComm, MOFEM_NOT_FOUND,
130  "This finite element is not defined (advise: check spelling)");
131  boost::shared_ptr<FiniteElement> fe;
132  fe = *it_fe;
133  fe->elementAdjacencyTable[type] = function;
135 }
136 
139  const std::string name_data) {
141  *buildMoFEM &= 1 << 0;
143  FiniteElements_by_name;
144  FiniteElements_by_name &finite_element_name_set =
145  finiteElements.get<FiniteElement_name_mi_tag>();
146  FiniteElements_by_name::iterator it_fe =
147  finite_element_name_set.find(fe_name);
148  if (it_fe == finite_element_name_set.end())
149  SETERRQ(mofemComm, MOFEM_NOT_FOUND,
150  "This finite element is not defined (advise: check spelling)");
151  bool success = finite_element_name_set.modify(
152  it_fe, FiniteElement_change_bit_add(get_field_id(name_data)));
153  if (!success)
154  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
155  "modification unsuccessful");
157 }
158 
160 Core::modify_finite_element_add_field_row(const std::string &fe_name,
161  const std::string name_row) {
163  *buildMoFEM &= 1 << 0;
165  FiniteElements_by_name;
166  FiniteElements_by_name &finite_element_name_set =
167  finiteElements.get<FiniteElement_name_mi_tag>();
168  FiniteElements_by_name::iterator it_fe =
169  finite_element_name_set.find(fe_name);
170  if (it_fe == finite_element_name_set.end())
171  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "this < %s > is not there",
172  fe_name.c_str());
173  bool success = finite_element_name_set.modify(
174  it_fe, FiniteElement_row_change_bit_add(get_field_id(name_row)));
175  if (!success)
176  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
177  "modification unsuccessful");
179 }
180 
182 Core::modify_finite_element_add_field_col(const std::string &fe_name,
183  const std::string name_col) {
185  *buildMoFEM &= 1 << 0;
186  auto &finite_element_name_set =
187  finiteElements.get<FiniteElement_name_mi_tag>();
188  auto it_fe = finite_element_name_set.find(fe_name);
189  if (it_fe == finite_element_name_set.end())
190  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
191  "this FiniteElement is there");
192  bool success = finite_element_name_set.modify(
193  it_fe, FiniteElement_col_change_bit_add(get_field_id(name_col)));
194  if (!success)
195  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
196  "modification unsuccessful");
198 }
199 
202  const std::string name_data) {
204  *buildMoFEM &= 1 << 0;
205  auto &finite_element_name_set =
206  finiteElements.get<FiniteElement_name_mi_tag>();
207  auto it_fe = finite_element_name_set.find(fe_name);
208  if (it_fe == finite_element_name_set.end())
209  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "this FiniteElement is there");
210  bool success = finite_element_name_set.modify(
211  it_fe, FiniteElement_change_bit_off(get_field_id(name_data)));
212  if (!success)
213  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
214  "modification unsuccessful");
216 }
217 
219 Core::modify_finite_element_off_field_row(const std::string &fe_name,
220  const std::string name_row) {
222  *buildMoFEM &= 1 << 0;
223  auto &finite_element_name_set =
224  finiteElements.get<FiniteElement_name_mi_tag>();
225  auto it_fe = finite_element_name_set.find(fe_name);
226  if (it_fe == finite_element_name_set.end())
227  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "this < %s > is not there",
228  fe_name.c_str());
229  bool success = finite_element_name_set.modify(
230  it_fe, FiniteElement_row_change_bit_off(get_field_id(name_row)));
231  if (!success)
232  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
233  "modification unsuccessful");
235 }
236 
238 Core::modify_finite_element_off_field_col(const std::string &fe_name,
239  const std::string name_col) {
241  *buildMoFEM &= 1 << 0;
242  auto &finite_element_name_set =
243  finiteElements.get<FiniteElement_name_mi_tag>();
244  auto it_fe = finite_element_name_set.find(fe_name);
245  if (it_fe == finite_element_name_set.end())
246  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "this FiniteElement is there");
247  bool success = finite_element_name_set.modify(
248  it_fe, FiniteElement_col_change_bit_off(get_field_id(name_col)));
249  if (!success)
250  SETERRQ(mofemComm, MOFEM_OPERATION_UNSUCCESSFUL,
251  "modification unsuccessful");
253 }
254 
255 BitFEId Core::getBitFEId(const std::string &fe_name) const {
256  auto &fe_by_id = finiteElements.get<FiniteElement_name_mi_tag>();
257  auto miit = fe_by_id.find(fe_name);
258  if (miit == fe_by_id.end())
260  ("finite element < " + fe_name + " > not found (top tip: check spelling)")
261  .c_str());
262  return (*miit)->getId();
263 }
264 
265 std::string Core::getBitFEIdName(const BitFEId id) const {
266  auto &fe_by_id = finiteElements.get<BitFEId_mi_tag>();
267  auto miit = fe_by_id.find(id);
268  if (miit == fe_by_id.end())
269  THROW_MESSAGE("finite element not found");
270  return (*miit)->getName();
271 }
272 
274  auto &fe_by_id = finiteElements.get<BitFEId_mi_tag>();
275  auto miit = fe_by_id.find(id);
276  if (miit == fe_by_id.end())
277  THROW_MESSAGE("finite element not found");
278  return (*miit)->meshset;
279 }
280 
281 EntityHandle Core::get_finite_element_meshset(const std::string name) const {
282  return get_finite_element_meshset(getBitFEId(name));
283 }
284 
286 Core::get_finite_element_entities_by_dimension(const std::string name, int dim,
287  Range &ents) const {
288 
290 
291  EntityHandle meshset = get_finite_element_meshset(name);
292  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, true);
294 }
295 
297  EntityType type,
298  Range &ents) const {
299 
301 
302  EntityHandle meshset = get_finite_element_meshset(name);
303  CHKERR get_moab().get_entities_by_type(meshset, type, ents, true);
304 
306 }
307 
310  Range &ents) const {
311 
313 
314  EntityHandle meshset = get_finite_element_meshset(name);
315  CHKERR get_moab().get_entities_by_handle(meshset, ents, true);
316 
318 }
319 
322  for (auto &fe : finiteElements.get<FiniteElement_name_mi_tag>())
323  MOFEM_LOG("SYNC", Sev::inform) << fe;
324 
325  MOFEM_LOG_SYNCHRONISE(mofemComm);
327 }
328 
330  const EntityHandle meshset, const EntityType type, const std::string &name,
331  const bool recursive) {
332  *buildMoFEM &= 1 << 0;
333  EntityHandle idm = no_handle;
335 
336  idm = get_finite_element_meshset(getBitFEId(name));
337  Range ents;
338  CHKERR get_moab().get_entities_by_type(meshset, type, ents, recursive);
339  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
340  CHKERR get_moab().add_entities(idm, ents);
341 
343 }
344 
347  const int dim, const std::string &name,
348  const bool recursive) {
349  EntityHandle idm = no_handle;
350  *buildMoFEM &= 1 << 0;
352  idm = get_finite_element_meshset(getBitFEId(name));
353  Range ents;
354  CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
355  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(ents);
356  CHKERR get_moab().add_entities(idm, ents);
358 }
359 
361  const Range &ents, const EntityType type, const std::string &name) {
362  EntityHandle idm = no_handle;
363  *buildMoFEM &= 1 << 0;
365  idm = get_finite_element_meshset(getBitFEId(name));
366  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
367  ents.subset_by_type(type));
368  CHKERR get_moab().add_entities(idm, ents.subset_by_type(type));
370 } // namespace MoFEM
371 
374  const std::string &name) {
375  EntityHandle idm = no_handle;
376  *buildMoFEM &= 1 << 0;
378  idm = get_finite_element_meshset(getBitFEId(name));
379  CHKERR getInterface<BitRefManager>()->setElementsBitRefLevel(
380  ents.subset_by_dimension(dim));
381  CHKERR get_moab().add_entities(idm, ents.subset_by_dimension(dim));
383 }
384 
387  const std::string &name,
388  EntityType type, int verb) {
390  CHKERR add_ents_to_finite_element_by_bit_ref(bit, BitRefLevel().set(), name,
391  type, verb);
392 
394 }
395 
397  const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
398  EntityType type, int verb) {
400  CHKERR add_ents_to_finite_element_by_bit_ref(bit, mask, name, type, verb);
401 
403 }
404 
406  const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name,
407  EntityType type, int verb) {
409 
410  if (verb == -1)
411  verb = verbose;
412  *buildMoFEM &= 1 << 0;
413  const BitFEId id = getBitFEId(name);
414  const EntityHandle idm = get_finite_element_meshset(id);
415 
416  auto &ref_MoFEMFiniteElement = refinedFiniteElements.get<Ent_mi_tag>();
417  auto miit = ref_MoFEMFiniteElement.lower_bound(get_id_for_min_type(type));
418  auto hi_miit = ref_MoFEMFiniteElement.upper_bound(get_id_for_max_type(type));
419 
420  int nb_add_fes = 0;
421  for (; miit != hi_miit; miit++) {
422  const auto &bit2 = miit->get()->getBitRefLevel();
423  if ((bit2 & mask) != bit2)
424  continue;
425  if ((bit2 & bit).any()) {
426  EntityHandle ent = miit->get()->getEnt();
427  CHKERR get_moab().add_entities(idm, &ent, 1);
428  nb_add_fes++;
429  }
430  }
431 
432  MOFEM_LOG("SYNC", Sev::inform)
433  << "Finite element " << name << " added. Nb. of elements added "
434  << nb_add_fes << " out of " << std::distance(miit, hi_miit);
435 
436  MOFEM_LOG_SYNCHRONISE(mofemComm)
437 
439 }
440 
442  const EntityHandle meshset, const std::string &name, const bool recursive) {
444  *buildMoFEM &= 1 << 0;
445  const BitFEId id = getBitFEId(name);
446  const EntityHandle idm = get_finite_element_meshset(id);
447  if (recursive == false) {
448  CHKERR get_moab().add_entities(idm, &meshset, 1);
449  } else {
450  Range meshsets;
451  CHKERR get_moab().get_entities_by_type(meshset, MBENTITYSET, meshsets,
452  false);
453  CHKERR get_moab().add_entities(idm, meshsets);
454  }
456 }
457 
459 Core::buildFiniteElements(const boost::shared_ptr<FiniteElement> &fe,
460  const Range *ents_ptr, int verb) {
462  if (verb == DEFAULT_VERBOSITY)
463  verb = verbose;
464 
465  if (verb > QUIET)
466  MOFEM_LOG("SYNC", Sev::verbose)
467  << "Build Finite Elements " << fe->getName();
468 
469  auto &fields_by_id = fIelds.get<BitFieldId_mi_tag>();
470 
471  // Get id of mofem fields for row, col and data
472  enum IntLoop { ROW = 0, COL, DATA, LAST };
473  std::array<BitFieldId, LAST> fe_fields = {fe.get()->getBitFieldIdRow(),
474  fe.get()->getBitFieldIdCol(),
475  fe.get()->getBitFieldIdData()};
476 
477  // Get finite element meshset
478  EntityHandle meshset = get_finite_element_meshset(fe.get()->getId());
479 
480  // Get entities from finite element meshset // if meshset
481  Range fe_ents;
482  CHKERR get_moab().get_entities_by_handle(meshset, fe_ents, false);
483 
484  if (ents_ptr)
485  fe_ents = intersect(fe_ents, *ents_ptr);
486 
487  // Map entity uid to pointers
488  typedef std::vector<boost::weak_ptr<EntFiniteElement>> VecOfWeakFEPtrs;
489  VecOfWeakFEPtrs processed_fes;
490  processed_fes.reserve(fe_ents.size());
491 
492  int last_data_field_ents_view_size = 0;
493  int last_row_field_ents_view_size = 0;
494  int last_col_field_ents_view_size = 0;
495 
496  // Entities adjacent to entities
497  std::vector<EntityHandle> adj_ents;
498 
499  // Loop meshset finite element ents and add finite elements
500  for (Range::const_pair_iterator peit = fe_ents.const_pair_begin();
501  peit != fe_ents.const_pair_end(); peit++) {
502 
503  const auto first = peit->first;
504  const auto second = peit->second;
505 
506  // Find range of ref entities that is sequence
507  // note: iterator is a wrapper
508  // check if is in refinedFiniteElements database
509  auto ref_fe_miit =
510  refinedFiniteElements.get<Ent_mi_tag>().lower_bound(first);
511  if (ref_fe_miit == refinedFiniteElements.get<Ent_mi_tag>().end()) {
512  std::ostringstream ss;
513  ss << "refinedFiniteElements not in database ent = " << first << " type "
514  << type_from_handle(first) << " " << *fe;
515  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, ss.str().c_str());
516  }
517  auto hi_ref_fe_miit =
518  refinedFiniteElements.get<Ent_mi_tag>().upper_bound(second);
519 
520  EntFiniteElement_multiIndex::iterator hint_p = entsFiniteElements.end();
521  for (; ref_fe_miit != hi_ref_fe_miit; ref_fe_miit++) {
522 
523  // Add finite element to database
524  hint_p = entsFiniteElements.emplace_hint(
525  hint_p, boost::make_shared<EntFiniteElement>(*ref_fe_miit, fe));
526  processed_fes.emplace_back(*hint_p);
527  auto fe_raw_ptr = hint_p->get();
528 
529  // Allocate space for entities view
530  bool row_as_data = false, col_as_row = false;
531  if (fe_fields[DATA] == fe_fields[ROW])
532  row_as_data = true;
533  if (fe_fields[ROW] == fe_fields[COL])
534  col_as_row = true;
535 
536  fe_raw_ptr->getDataFieldEntsPtr()->reserve(
537  last_data_field_ents_view_size);
538 
539  if (row_as_data) {
540  fe_raw_ptr->getRowFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
541  } else {
542  // row and col are different
543  if (fe_raw_ptr->getRowFieldEntsPtr() ==
544  fe_raw_ptr->getDataFieldEntsPtr())
545  fe_raw_ptr->getRowFieldEntsPtr() =
546  boost::make_shared<FieldEntity_vector_view>();
547  fe_raw_ptr->getRowFieldEntsPtr()->reserve(
548  last_row_field_ents_view_size);
549  }
550 
551  if (row_as_data && col_as_row) {
552  fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getDataFieldEntsPtr();
553  } else if (col_as_row) {
554  fe_raw_ptr->getColFieldEntsPtr() = fe_raw_ptr->getRowFieldEntsPtr();
555  } else {
556  if (
557 
558  fe_raw_ptr->getColFieldEntsPtr() ==
559  fe_raw_ptr->getRowFieldEntsPtr() ||
560  fe_raw_ptr->getColFieldEntsPtr() ==
561  fe_raw_ptr->getDataFieldEntsPtr()
562 
563  )
564  fe_raw_ptr->getColFieldEntsPtr() =
565  boost::make_shared<FieldEntity_vector_view>();
566  fe_raw_ptr->getColFieldEntsPtr()->reserve(
567  last_col_field_ents_view_size);
568  }
569 
570  // Iterate over all field and check which one is on the element
571  for (unsigned int ii = 0; ii != BitFieldId().size(); ++ii) {
572 
573  // Common field id for ROW, COL and DATA
574  BitFieldId id_common = 0;
575  // Check if the field (ii) is added to finite element
576  for (int ss = 0; ss < LAST; ss++) {
577  id_common |= fe_fields[ss] & BitFieldId().set(ii);
578  }
579  if (id_common.none())
580  continue;
581 
582  // Find in database data associated with the field (ii)
583  const BitFieldId field_id = BitFieldId().set(ii);
584  auto miit = fields_by_id.find(field_id);
585  if (miit == fields_by_id.end())
586  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Field not found");
587  auto field_bit_number = (*miit)->getBitNumber();
588 
589  // Loop over adjacencies of element and find field entities on those
590  // adjacencies, that create hash map map_uid_fe which is used later
591  const std::string field_name = miit->get()->getName();
592  const bool add_to_data = (field_id & fe_fields[DATA]).any();
593  const bool add_to_row = (field_id & fe_fields[ROW]).any();
594  const bool add_to_col = (field_id & fe_fields[COL]).any();
595 
596  // Resolve entities on element, those entities are used to build tag
597  // with dof uids on finite element tag
598  adj_ents.clear();
599  CHKERR fe_raw_ptr->getElementAdjacency(*miit, adj_ents);
600 
601  for (auto ent : adj_ents) {
602 
603  auto dof_it = entsFields.get<Unique_mi_tag>().find(
604  FieldEntity::getLocalUniqueIdCalculate(field_bit_number, ent));
605  if (dof_it != entsFields.get<Unique_mi_tag>().end()) {
606 
607  if (add_to_data) {
608  fe_raw_ptr->getDataFieldEntsPtr()->emplace_back(*dof_it);
609  }
610  if (add_to_row && !row_as_data) {
611  fe_raw_ptr->getRowFieldEntsPtr()->emplace_back(*dof_it);
612  }
613  if (add_to_col && !col_as_row) {
614  fe_raw_ptr->getColFieldEntsPtr()->emplace_back(*dof_it);
615  }
616 
617  }
618  }
619  }
620 
621  // Sort field ents by uid
622  auto uid_comp = [](const auto &a, const auto &b) {
623  return a.lock()->getLocalUniqueId() < b.lock()->getLocalUniqueId();
624  };
625 
626  // Sort all views
627 
628  // Data
629  sort(fe_raw_ptr->getDataFieldEntsPtr()->begin(),
630  fe_raw_ptr->getDataFieldEntsPtr()->end(), uid_comp);
631  last_data_field_ents_view_size =
632  fe_raw_ptr->getDataFieldEntsPtr()->size();
633 
634  // Row
635  if (!row_as_data) {
636  sort(fe_raw_ptr->getRowFieldEntsPtr()->begin(),
637  fe_raw_ptr->getRowFieldEntsPtr()->end(), uid_comp);
638  last_row_field_ents_view_size =
639  fe_raw_ptr->getRowFieldEntsPtr()->size();
640  }
641 
642  // Column
643  if (!col_as_row) {
644  sort(fe_raw_ptr->getColFieldEntsPtr()->begin(),
645  fe_raw_ptr->getColFieldEntsPtr()->end(), uid_comp);
646  last_col_field_ents_view_size =
647  fe_raw_ptr->getColFieldEntsPtr()->size();
648  }
649  }
650  }
651 
653 }
654 
657 
658  if (verb == DEFAULT_VERBOSITY)
659  verb = verbose;
660 
661  // loop Finite Elements
662  for (auto &fe : finiteElements)
663  CHKERR buildFiniteElements(fe, NULL, verb);
664 
665  if (verb > QUIET) {
666 
667  auto &fe_ents = entsFiniteElements.get<Unique_mi_tag>();
668  for (auto &fe : finiteElements) {
669  auto miit = fe_ents.lower_bound(
671  auto hi_miit =
673  get_id_for_max_type<MBENTITYSET>(), fe->getFEUId()));
674  const auto count = std::distance(miit, hi_miit);
675  MOFEM_LOG("SYNC", Sev::inform)
676  << "Finite element " << fe->getName()
677  << " added. Nb. of elements added " << count;
678  MOFEM_LOG("SYNC", Sev::noisy) << *fe;
679 
680  auto slg = MoFEM::LogManager::getLog("SYNC");
681  for (auto &field : fIelds) {
682  auto rec = slg.open_record(keywords::severity = Sev::verbose);
683  if (rec) {
684  logging::record_ostream strm(rec);
685  strm << "Field " << field->getName() << " on finite element: ";
686  if ((field->getId() & fe->getBitFieldIdRow()).any())
687  strm << "row ";
688  if ((field->getId() & fe->getBitFieldIdCol()).any())
689  strm << "columns ";
690  if ((field->getId() & fe->getBitFieldIdData()).any())
691  strm << "data";
692  strm.flush();
693  slg.push_record(boost::move(rec));
694  }
695  }
696  }
697 
698  MOFEM_LOG_SYNCHRONISE(mofemComm);
699  }
700 
701  *buildMoFEM |= 1 << 1;
703 }
704 
707  SETERRQ(mofemComm, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
709 }
710 
712  const Range *const ents_ptr,
713  int verb) {
715  if (verb == -1)
716  verb = verbose;
717 
718  auto fe_miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
719  if (fe_miit == finiteElements.get<FiniteElement_name_mi_tag>().end())
720  SETERRQ1(mofemComm, MOFEM_NOT_FOUND, "Finite element <%s> not found",
721  fe_name.c_str());
722 
723  CHKERR buildFiniteElements(*fe_miit, ents_ptr, verb);
724 
725  if (verb >= VERBOSE) {
726  auto &fe_ents = entsFiniteElements.get<Unique_mi_tag>();
727  auto miit = fe_ents.lower_bound(
728  EntFiniteElement::getLocalUniqueIdCalculate(0, (*fe_miit)->getFEUId()));
729  auto hi_miit =
731  get_id_for_max_type<MBENTITYSET>(), (*fe_miit)->getFEUId()));
732  const auto count = std::distance(miit, hi_miit);
733  MOFEM_LOG("SYNC", Sev::inform) << "Finite element " << fe_name
734  << " added. Nb. of elements added " << count;
735  MOFEM_LOG_SYNCHRONISE(mofemComm);
736  }
737 
738  *buildMoFEM |= 1 << 1;
740 }
741 
744  if (verb == DEFAULT_VERBOSITY)
745  verb = verbose;
746 
747  if (!((*buildMoFEM) & BUILD_FIELD))
748  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "field not build");
749  if (!((*buildMoFEM) & BUILD_FE))
750  SETERRQ(mofemComm, MOFEM_NOT_FOUND, "fe not build");
751  for (auto peit = ents.pair_begin(); peit != ents.pair_end(); ++peit) {
752  auto fit = entsFiniteElements.get<Ent_mi_tag>().lower_bound(peit->first);
753  auto hi_fit =
754  entsFiniteElements.get<Ent_mi_tag>().upper_bound(peit->second);
755  for (; fit != hi_fit; ++fit) {
756  if ((*fit)->getBitFieldIdRow().none() &&
757  (*fit)->getBitFieldIdCol().none() &&
758  (*fit)->getBitFieldIdData().none())
759  continue;
760  int by = BYROW;
761  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol())
762  by |= BYCOL;
763  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData())
764  by |= BYDATA;
766  auto hint = entFEAdjacencies.end();
767  for (auto e : *(*fit)->getRowFieldEntsPtr()) {
768  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
769  bool success = entFEAdjacencies.modify(hint, modify_row);
770  if (!success)
771  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
772  "modification unsuccessful");
773  }
774  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdCol()) {
775  int by = BYCOL;
776  if ((*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData())
777  by |= BYDATA;
779  auto hint = entFEAdjacencies.end();
780  for (auto e : *(*fit)->getColFieldEntsPtr()) {
781  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
782  bool success = entFEAdjacencies.modify(hint, modify_col);
783  if (!success)
784  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
785  "modification unsuccessful");
786  }
787  }
788  if ((*fit)->getBitFieldIdRow() != (*fit)->getBitFieldIdData() ||
789  (*fit)->getBitFieldIdCol() != (*fit)->getBitFieldIdData()) {
791  BYDATA);
792  auto hint = entFEAdjacencies.end();
793  for (auto &e : (*fit)->getDataFieldEnts()) {
794  hint = entFEAdjacencies.emplace_hint(hint, e.lock(), *fit);
795  bool success = entFEAdjacencies.modify(hint, modify_data);
796  if (!success)
797  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
798  "modification unsuccessful");
799  }
800  }
801  }
802  }
803 
804  if (verb >= VERBOSE) {
805  MOFEM_LOG("WORLD", Sev::inform)
806  << "Number of adjacencies " << entFEAdjacencies.size();
807  MOFEM_LOG_SYNCHRONISE(mofemComm)
808  }
809 
810  *buildMoFEM |= 1 << 2;
812 }
813 
815  const BitRefLevel &mask, int verb) {
817  if (verb == -1)
818  verb = verbose;
819  Range ents;
820  CHKERR BitRefManager(*this).getEntitiesByRefLevel(bit, mask, ents);
821 
822  CHKERR build_adjacencies(ents, verb);
823 
825 }
828  if (verb == -1)
829  verb = verbose;
830  CHKERR build_adjacencies(bit, BitRefLevel().set(), verb);
831 
833 }
834 
835 EntFiniteElement_multiIndex::index<Unique_mi_tag>::type::iterator
836 Core::get_fe_by_name_begin(const std::string &fe_name) const {
837  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
838  if (miit != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
839  return entsFiniteElements.get<Unique_mi_tag>().lower_bound(
840  EntFiniteElement::getLocalUniqueIdCalculate(0, (*miit)->getFEUId()));
841  } else {
842  return entsFiniteElements.get<Unique_mi_tag>().end();
843  }
844 }
845 
846 EntFiniteElement_multiIndex::index<Unique_mi_tag>::type::iterator
847 Core::get_fe_by_name_end(const std::string &fe_name) const {
848  auto miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
849  if (miit != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
850  return entsFiniteElements.get<Unique_mi_tag>().upper_bound(
852  get_id_for_max_type<MBENTITYSET>(), (*miit)->getFEUId()));
853  } else {
854  return entsFiniteElements.get<Unique_mi_tag>().end();
855  }
856 }
857 
859  const std::string &name) const {
861  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
862  it = finiteElements.get<FiniteElement_name_mi_tag>().find(name);
863  if (it == finiteElements.get<FiniteElement_name_mi_tag>().end()) {
864  SETERRQ1(mofemComm, 1, "finite element not found < %s >", name.c_str());
865  }
866  EntityHandle meshset = (*it)->getMeshset();
867 
868  int num_entities;
869  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
870 
871  auto counts_fes = [&]() {
872  return std::distance(get_fe_by_name_begin((*it)->getName()),
873  get_fe_by_name_end((*it)->getName()));
874  };
875 
876  if (counts_fes() != static_cast<size_t>(num_entities)) {
877  SETERRQ1(mofemComm, MOFEM_DATA_INCONSISTENCY,
878  "not equal number of entities in meshset and finite elements "
879  "multiindex < %s >",
880  (*it)->getName().c_str());
881  }
883 }
884 
887  FiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type::iterator it;
888  it = finiteElements.get<FiniteElement_name_mi_tag>().begin();
889  for (; it != finiteElements.get<FiniteElement_name_mi_tag>().end(); it++) {
890  EntityHandle meshset = (*it)->getMeshset();
891 
892  int num_entities;
893  CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
894 
895  auto counts_fes = [&]() {
896  return std::distance(get_fe_by_name_begin((*it)->getName()),
897  get_fe_by_name_end((*it)->getName()));
898  };
899 
900  if (counts_fes() != static_cast<size_t>(num_entities)) {
901  SETERRQ1(mofemComm, MOFEM_DATA_INCONSISTENCY,
902  "not equal number of entities in meshset and finite elements "
903  "multiindex < %s >",
904  (*it)->getName().c_str());
905  }
906  }
908 }
909 
911 Core::get_problem_finite_elements_entities(const std::string problem_name,
912  const std::string &fe_name,
913  const EntityHandle meshset) {
915  auto &prb = pRoblems.get<Problem_mi_tag>();
916  auto p_miit = prb.find(problem_name);
917  if (p_miit == prb.end())
918  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
919  "No such problem like < %s >", problem_name.c_str());
920 
921  auto fe_miit = finiteElements.get<FiniteElement_name_mi_tag>().find(fe_name);
922  if (fe_miit != finiteElements.get<FiniteElement_name_mi_tag>().end()) {
923  auto miit =
924  p_miit->numeredFiniteElementsPtr->get<Unique_mi_tag>().lower_bound(
926  0, (*fe_miit)->getFEUId()));
927  auto hi_miit =
928  p_miit->numeredFiniteElementsPtr->get<Unique_mi_tag>().upper_bound(
930  get_id_for_max_type<MBENTITYSET>(), (*fe_miit)->getFEUId()));
931 
932  if (miit != hi_miit) {
933  std::vector<EntityHandle> ents;
934  ents.reserve(std::distance(miit, hi_miit));
935  for (; miit != hi_miit; ++miit)
936  ents.push_back((*miit)->getEnt());
937  int part = (*miit)->getPart();
938  CHKERR get_moab().tag_clear_data(th_Part, &*ents.begin(), ents.size(),
939  &part);
940  CHKERR get_moab().add_entities(meshset, &*ents.begin(), ents.size());
941  }
942  }
943 
945 }
946 
947 } // namespace MoFEM
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
DEFAULT_VERBOSITY
@ DEFAULT_VERBOSITY
Definition: definitions.h:220
MoFEM::CoreTmp< 0 >::add_ents_to_finite_element_by_MESHSET
MoFEMErrorCode add_ents_to_finite_element_by_MESHSET(const EntityHandle meshset, const std::string &name, const bool recursive=false)
add MESHSET element to finite element database given by name
Definition: FECore.cpp:441
MoFEM::Ent_mi_tag
Definition: TagMultiIndices.hpp:21
MoFEM::BitRefManager::getEntitiesByRefLevel
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
Definition: BitRefManager.cpp:845
MoFEM::FiniteElement_change_bit_add
Add field to data.
Definition: FEMultiIndices.hpp:896
MoFEM::FiniteElement_row_change_bit_add
Add field to row.
Definition: FEMultiIndices.hpp:884
EntityHandle
MoFEM::FiniteElement_col_change_bit_add
Add field to column.
Definition: FEMultiIndices.hpp:872
MoFEM::LogManager::getLog
static LoggerType & getLog(const std::string channel)
Get logger by channel.
Definition: LogManager.cpp:395
MoFEM::Problem_mi_tag
Definition: TagMultiIndices.hpp:70
MoFEM::CoreTmp< 0 >::add_ents_to_finite_element_by_dim
MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle meshset, const int dim, const std::string &name, const bool recursive=true)
add entities to finite element
Definition: FECore.cpp:346
MoFEM::CoreTmp< 0 >::build_finite_elements
MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)
Build finite elements.
Definition: FECore.cpp:655
MoFEM::Exceptions::MoFEMException
Exception to catch.
Definition: Exceptions.hpp:20
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::BitFEId_mi_tag
Definition: TagMultiIndices.hpp:25
MoFEM::Types::BitFieldId
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:42
MoFEM::CoreTmp< 0 >::modify_finite_element_add_field_col
MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_col)
set field col which finite element use
Definition: FECore.cpp:182
MoFEM.hpp
MoFEM::CoreTmp< 0 >::add_ents_to_finite_element_EntType_by_bit_ref
DEPRECATED MoFEMErrorCode add_ents_to_finite_element_EntType_by_bit_ref(const BitRefLevel &bit, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)
Definition: FECore.cpp:386
MoFEM::no_handle
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
Definition: Common.hpp:12
DATA
@ DATA
Definition: definitions.h:136
MoFEM::Types::BitFEId
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:43
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
MoFEM::CoreTmp< 0 >::list_finite_elements
MoFEMErrorCode list_finite_elements() const
list finite elements in database
Definition: FECore.cpp:320
ROW
@ ROW
Definition: definitions.h:136
MoFEM::FiniteElement_row_change_bit_off
Unset field from row.
Definition: FEMultiIndices.hpp:920
MoFEM::CoreTmp< 0 >::get_fe_by_name_end
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_end(const std::string &fe_name) const
get end iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(MF...
Definition: FECore.cpp:847
VERBOSE
@ VERBOSE
Definition: definitions.h:222
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreTmp< 0 >::modify_finite_element_add_field_data
MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_filed)
set finite element field data
Definition: FECore.cpp:138
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::CoreTmp< 0 >::get_finite_element_entities_by_handle
MoFEMErrorCode get_finite_element_entities_by_handle(const std::string name, Range &ents) const
get entities in the finite element by handle
Definition: FECore.cpp:309
MoFEM::FiniteElement_change_bit_off
Unset field from data.
Definition: FEMultiIndices.hpp:932
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
convert.type
type
Definition: convert.py:64
MoFEM::FieldEntity::getLocalUniqueIdCalculate
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
Definition: FieldEntsMultiIndices.hpp:136
MoFEM::EntFiniteElement::getLocalUniqueIdCalculate
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.
Definition: FEMultiIndices.hpp:528
MoFEM::CoreTmp< 0 >::modify_finite_element_off_field_data
MoFEMErrorCode modify_finite_element_off_field_data(const std::string &fe_name, const std::string name_filed)
unset finite element field data
Definition: FECore.cpp:201
MOFEM_LOG_SYNCHRONISE
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
Definition: LogManager.hpp:345
MoFEM::CoreTmp< 0 >::modify_finite_element_add_field_row
MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)
set field row which finite element use
Definition: FECore.cpp:160
COL
@ COL
Definition: definitions.h:136
MoFEM::get_id_for_max_type
EntityHandle get_id_for_max_type()
Definition: RefEntsMultiIndices.hpp:13
MoFEM::CoreTmp< 0 >::add_ents_to_finite_element_by_bit_ref
MoFEMErrorCode add_ents_to_finite_element_by_bit_ref(const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)
add TET entities from given refinement level to finite element database given by name
Definition: FECore.cpp:405
MoFEM::FiniteElement_col_change_bit_off
Unset field from column.
Definition: FEMultiIndices.hpp:908
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MoFEM::type_from_handle
auto type_from_handle(const EntityHandle h)
get type from entity handle
Definition: Templates.hpp:1898
MoFEM::CoreTmp< 0 >::get_finite_element_entities_by_dimension
MoFEMErrorCode get_finite_element_entities_by_dimension(const std::string name, int dim, Range &ents) const
get entities in the finite element by dimension
Definition: FECore.cpp:286
BYDATA
@ BYDATA
Definition: definitions.h:146
MoFEM::CoreTmp< 0 >::modify_finite_element_off_field_row
MoFEMErrorCode modify_finite_element_off_field_row(const std::string &fe_name, const std::string name_row)
unset field row which finite element use
Definition: FECore.cpp:219
MoFEM::FiniteElement
Finite element definition.
Definition: FEMultiIndices.hpp:26
MoFEM::CoreTmp< 0 >::buildFiniteElements
MoFEMErrorCode buildFiniteElements(const boost::shared_ptr< FiniteElement > &fe, const Range *ents_ptr=NULL, int verb=DEFAULT_VERBOSITY)
Definition: FECore.cpp:459
MOFEM_NOT_FOUND
@ MOFEM_NOT_FOUND
Definition: definitions.h:33
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FECoreFunctionBegin
#define FECoreFunctionBegin
Definition: FECore.cpp:7
MoFEM::ElementAdjacencyFunct
boost::function< MoFEMErrorCode(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)> ElementAdjacencyFunct
user adjacency function
Definition: FEMultiIndices.hpp:20
Range
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
BYCOL
@ BYCOL
Definition: definitions.h:145
MoFEM::BitFieldId_mi_tag
Definition: TagMultiIndices.hpp:17
MoFEM::CoreTmp< 0 >::check_number_of_ents_in_ents_finite_element
MoFEMErrorCode check_number_of_ents_in_ents_finite_element() const
check data consistency in entsFiniteElements
Definition: FECore.cpp:885
MoFEM::CoreTmp< 0 >::modify_finite_element_off_field_col
MoFEMErrorCode modify_finite_element_off_field_col(const std::string &fe_name, const std::string name_col)
unset field col which finite element use
Definition: FECore.cpp:238
MoFEM::FiniteElement_name_mi_tag
Definition: TagMultiIndices.hpp:26
MoFEM::CoreTmp< 0 >::get_problem_finite_elements_entities
MoFEMErrorCode get_problem_finite_elements_entities(const std::string name, const std::string &fe_name, const EntityHandle meshset)
add finite elements to the meshset
Definition: FECore.cpp:911
MoFEM::MPC::LAST
@ LAST
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEMTypes
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:110
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
BYROW
@ BYROW
Definition: definitions.h:144
MoFEM::CoreTmp< 0 >::get_finite_element_meshset
EntityHandle get_finite_element_meshset(const BitFEId id) const
Definition: FECore.cpp:273
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
QUIET
@ QUIET
Definition: definitions.h:221
MoFEM::Unique_mi_tag
Definition: TagMultiIndices.hpp:18
MoFEM::CoreTmp< 0 >::getBitFEIdName
std::string getBitFEIdName(const BitFEId id) const
Get field name.
Definition: FECore.cpp:265
MoFEM::CoreTmp< 0 >::getBitFEId
BitFEId getBitFEId(const std::string &fe_name) const
Get field Id.
Definition: FECore.cpp:255
MoFEM::CoreTmp< 0 >::check_finite_element
bool check_finite_element(const std::string &name) const
Check if finite element is in database.
Definition: FECore.cpp:35
MoFEM::CoreTmp< 0 >::add_ents_to_finite_element_by_type
MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle meshset, const EntityType type, const std::string &name, const bool recursive=true)
add entities to finite element
Definition: FECore.cpp:329
MoFEM::CoreTmp< 0 >::add_finite_element
MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)
add finite element
Definition: FECore.cpp:43
MF_EXCL
@ MF_EXCL
Definition: definitions.h:112
MoFEM::CoreTmp< 0 >::get_fe_by_name_begin
EntFiniteElement_multiIndex::index< Unique_mi_tag >::type::iterator get_fe_by_name_begin(const std::string &fe_name) const
get begin iterator of finite elements of given name (instead you can use IT_GET_FES_BY_NAME_FOR_LOOP(...
Definition: FECore.cpp:836
MoFEM::FieldEntityEntFiniteElementAdjacencyMap_change_ByWhat
Definition: AdjacencyMultiIndices.hpp:116
MoFEM::get_id_for_min_type
EntityHandle get_id_for_min_type()
Definition: RefEntsMultiIndices.hpp:18
MF_EXIST
@ MF_EXIST
Definition: definitions.h:113
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::CoreTmp< 0 >::get_finite_element_entities_by_type
MoFEMErrorCode get_finite_element_entities_by_type(const std::string name, EntityType type, Range &ents) const
get entities in the finite element by type
Definition: FECore.cpp:296
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEM::CoreTmp< 0 >::get_finite_element_structure
const FiniteElement * get_finite_element_structure(const std::string &name, enum MoFEMTypes bh=MF_EXCL) const
get finite element struture
Definition: FECore.cpp:18
MoFEM::CoreTmp< 0 >::build_adjacencies
MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)
build adjacencies
Definition: FECore.cpp:742
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::CoreTmp< 0 >::modify_finite_element_adjacency_table
MoFEMErrorCode modify_finite_element_adjacency_table(const std::string &fe_name, const EntityType type, ElementAdjacencyFunct function)
modify finite element table, only for advanced user
Definition: FECore.cpp:117