v0.14.0
FEMultiIndices.cpp
Go to the documentation of this file.
1 /** \file FEMultiIndices.cpp
2  * \brief Multi-index containers for finite elements
3  */
4 
5 namespace MoFEM {
6 
7 constexpr int FiniteElement::ent_shift; // EntityHandle size
8 
25 constexpr std::array<const DefaultElementAdjacency::DefEntTypeMap *, MBMAXTYPE>
27 
29  moab::Interface &moab, const Field &field, const EntFiniteElement &fe,
30  std::vector<EntityHandle> &adjacency) {
32  switch (field.getSpace()) {
33  case H1:
34  adjacency.push_back(fe.getEnt());
35  // build side table
36  for (auto ent : adjacency)
37  fe.getSideNumberPtr(ent);
38  break;
39  case NOFIELD: {
40  CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
41  for (auto ent : adjacency) {
42  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
43  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
44  }
45  } break;
46  default:
47  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
48  "this field is not implemented for VERTEX finite element");
49  }
50 
52 }
53 
56  const EntFiniteElement &fe,
57  std::vector<EntityHandle> &adjacency) {
59  EntityHandle fe_ent = fe.getEnt();
60  // Range nodes;
61  switch (field.getSpace()) {
62  case H1:
63  CHKERR moab.get_connectivity(&fe_ent, 1, adjacency, true);
64  case HCURL:
65  case L2:
66  adjacency.push_back(fe_ent);
67  // build side table
68  for (auto e : adjacency)
69  fe.getSideNumberPtr(e);
70  break;
71  case NOFIELD: {
72  CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
73  for (auto e : adjacency) {
74  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
75  .insert(boost::shared_ptr<SideNumber>(new SideNumber(e, -1, 0, 0)));
76  }
77  } break;
78  default:
79  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
80  "this field is not implemented for EDGE finite element");
81  }
82 
84 }
85 
88  const EntFiniteElement &fe,
89  std::vector<EntityHandle> &adjacency) {
91  // Range nodes,edges;
92  const EntityHandle fe_ent = fe.getEnt();
93  switch (field.getSpace()) {
94  case H1:
95  CHKERR moab.get_connectivity(&fe_ent, 1, adjacency, true);
96  case HCURL:
97  CHKERR moab.get_adjacencies(&fe_ent, 1, 1, false, adjacency,
98  moab::Interface::UNION);
99  case HDIV:
100  case L2:
101  adjacency.push_back(fe_ent);
102  // build side table
103  for (auto ent : adjacency)
104  fe.getSideNumberPtr(ent);
105  break;
106  case NOFIELD: {
107  CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
108  for (auto ent : adjacency) {
109  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
110  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
111  }
112  } break;
113  default:
114  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
115  "this field is not implemented for TRI finite element");
116  }
117 
119 }
120 
122  moab::Interface &moab, const Field &field, const EntFiniteElement &fe,
123  std::vector<EntityHandle> &adjacency) {
125  EntityHandle fe_ent = fe.getEnt();
126  switch (field.getSpace()) {
127  case H1:
128  CHKERR moab.get_connectivity(&fe_ent, 1, adjacency, true);
129  case HCURL:
130  CHKERR moab.get_adjacencies(&fe_ent, 1, 1, false, adjacency,
131  moab::Interface::UNION);
132  case HDIV:
133  CHKERR moab.get_adjacencies(&fe_ent, 1, 2, false, adjacency,
134  moab::Interface::UNION);
135  case L2:
136  adjacency.push_back(fe_ent);
137  // build side table
138  for (auto ent : adjacency)
139  fe.getSideNumberPtr(ent);
140  break;
141  case NOFIELD: {
142  CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
143  for (auto ent : adjacency) {
144  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
145  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
146  }
147  } break;
148  default:
149  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
150  "this field is not implemented for TRI finite element");
151  }
152 
154 }
155 
158  const EntFiniteElement &fe,
159  std::vector<EntityHandle> &adjacency) {
161  const EntityHandle prism = fe.getEnt();
162  Range nodes;
163  // initialize side sets
164  fe.getRefElement()->getSideNumberPtr(prism);
165  EntityHandle face_side3, face_side4;
166  CHKERR moab.side_element(prism, 2, 3, face_side3);
167  CHKERR moab.side_element(prism, 2, 4, face_side4);
168  fe.getRefElement()->getSideNumberPtr(face_side3);
169  fe.getRefElement()->getSideNumberPtr(face_side4);
170  for (int qq = 0; qq < 3; qq++) {
171  EntityHandle quad = 0;
172  rval = moab.side_element(prism, 2, qq, quad);
173  if (rval != MB_SUCCESS || quad == 0)
174  continue;
175  int side_number, sense, offset;
176  rval = moab.side_number(prism, quad, side_number, sense, offset);
177  if (side_number == -1 || rval != MB_SUCCESS)
178  continue;
179  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
180  .insert(boost::shared_ptr<SideNumber>(
181  new SideNumber(quad, side_number, sense, offset)));
182  }
183  int ee = 0;
184  for (; ee < 3; ee++) {
185  EntityHandle edge = 0;
186  CHKERR moab.side_element(prism, 1, ee, edge);
187  boost::shared_ptr<SideNumber> side_ptr =
188  fe.getRefElement()->getSideNumberPtr(edge);
189  if (side_ptr->side_number != ee) {
190  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
191  "data inconsistency for edge %d while in FE data structure is "
192  "numbered %d.",
193  ee, side_ptr->side_number);
194  }
195  CHKERR moab.side_element(prism, 1, 6 + ee, edge);
196  side_ptr = fe.getRefElement()->getSideNumberPtr(edge);
197  if (side_ptr->side_number != ee + 6) {
198  if (side_ptr->side_number != ee) {
199  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
200  "data inconsistency for edge %d while in FE data structure "
201  "is numbered %d.",
202  ee, side_ptr->side_number);
203  } else {
204  side_ptr->brother_side_number = ee + 6;
205  }
206  }
207  }
208  for (; ee < 6; ee++) {
209  EntityHandle edge = 0;
210  rval = moab.side_element(prism, 1, ee, edge);
211  if (rval != MB_SUCCESS || edge == 0)
212  continue;
213  int side_number, sense, offset;
214  rval = moab.side_number(prism, edge, side_number, sense, offset);
215  if (side_number == -1 || rval != MB_SUCCESS)
216  continue;
217  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
218  .insert(boost::shared_ptr<SideNumber>(
219  new SideNumber(edge, side_number, sense, offset)));
220  }
221  int nn = 0;
222  for (; nn < 3; nn++) {
223  EntityHandle node;
224  CHKERR moab.side_element(prism, 0, nn, node);
225  boost::shared_ptr<SideNumber> side_ptr =
226  fe.getRefElement()->getSideNumberPtr(node);
227  if (side_ptr->side_number != nn) {
228  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
229  "data inconsistency for node %d while in FE datastructure is "
230  "numbered %d.",
231  nn, side_ptr->side_number);
232  }
233  CHKERR moab.side_element(prism, 0, nn + 3, node);
234  side_ptr = fe.getRefElement()->getSideNumberPtr(node);
235  if (side_ptr->side_number != nn + 3) {
236  if (side_ptr->side_number != nn) {
237  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
238  "data inconsistency for node %d while in FE datastructure is "
239  "numbered %d.",
240  nn, side_ptr->side_number);
241  } else {
242  side_ptr->brother_side_number = nn + 3;
243  }
244  }
245  }
246 
247  // get adjacencies
248  SideNumber_multiIndex &side_table = fe.getRefElement()->getSideNumberTable();
249  switch (field.getSpace()) {
250  case H1:
251  // moab.get_connectivity(&prism,1,nodes,true);
252  // use get adjacencies, this will allow take in account adjacencies set user
253  CHKERR moab.get_adjacencies(&prism, 1, 0, false, nodes,
254  moab::Interface::UNION);
255  {
256  Range topo_nodes;
257  CHKERR moab.get_connectivity(&prism, 1, topo_nodes, true);
258  Range mid_nodes;
259  CHKERR moab.get_connectivity(&prism, 1, mid_nodes, false);
260  mid_nodes = subtract(mid_nodes, topo_nodes);
261  nodes = subtract(nodes, mid_nodes);
262  }
263  adjacency.insert(adjacency.end(), nodes.begin(), nodes.end());
264  case HCURL: {
265  auto siit = side_table.get<0>().lower_bound(get_id_for_min_type<MBEDGE>());
266  auto hi_siit =
267  side_table.get<0>().upper_bound(get_id_for_max_type<MBEDGE>());
268  for (; siit != hi_siit; siit++)
269  adjacency.push_back(siit->get()->ent);
270  }
271  case HDIV: {
272  auto siit = side_table.get<0>().lower_bound(get_id_for_min_type<MBTRI>());
273  auto hi_siit =
274  side_table.get<0>().upper_bound(get_id_for_max_type<MBQUAD>());
275  for (; siit != hi_siit; siit++)
276  adjacency.push_back(siit->get()->ent);
277  }
278  case L2:
279  adjacency.push_back(prism);
280  break;
281  case NOFIELD: {
282  CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
283  for (auto ent : adjacency) {
284  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
285  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
286  }
287  } break;
288  default:
289  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
290  "this field is not implemented for TRI finite element");
291  }
293 }
294 
296  moab::Interface &moab, const Field &field, const EntFiniteElement &fe,
297  std::vector<EntityHandle> &adjacency) {
299  EntityHandle fe_ent = fe.getEnt();
300  // resolve recursively all ents in the meshset
301  switch (field.getSpace()) {
302  case H1:
303  CHKERR moab.get_entities_by_type(fe_ent, MBVERTEX, adjacency, true);
304  case HCURL:
305  CHKERR moab.get_entities_by_type(fe_ent, MBEDGE, adjacency, true);
306  case HDIV:
307  CHKERR moab.get_entities_by_dimension(fe_ent, 2, adjacency, true);
308  case L2:
309  CHKERR moab.get_entities_by_dimension(fe_ent, 3, adjacency, true);
310  break;
311  case NOFIELD: {
312  CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
313  for (auto ent : adjacency) {
314  const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
315  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
316  }
317  } break;
318  default:
319  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
320  }
322 }
323 
324 // FiniteElement
326  : meshset(_meshset) {
327  Tag th_FEId;
328  CHK_MOAB_THROW(moab.tag_get_handle("_FEId", th_FEId), "get tag");
330  moab.tag_get_by_ptr(th_FEId, &meshset, 1, (const void **)&tagId),
331  "get tag data");
332  Tag th_FEName;
333  CHK_MOAB_THROW(moab.tag_get_handle("_FEName", th_FEName), "get tag");
334  CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEName, &meshset, 1,
335  (const void **)&tagName, &tagNameSize),
336  "get tag data");
337  Tag th_FEIdCol, th_FEIdRow, th_FEIdData;
338  CHK_MOAB_THROW(moab.tag_get_handle("_FEIdCol", th_FEIdCol), "get_tag");
339  CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEIdCol, &meshset, 1,
340  (const void **)&tag_BitFieldId_col_data),
341  "get tag data");
342  CHK_MOAB_THROW(moab.tag_get_handle("_FEIdRow", th_FEIdRow), "get tag");
343  CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEIdRow, &meshset, 1,
344  (const void **)&tag_BitFieldId_row_data),
345  "get tag data");
346  CHK_MOAB_THROW(moab.tag_get_handle("_FEIdData", th_FEIdData), "get tag");
347  CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEIdData, &meshset, 1,
348  (const void **)&tag_BitFieldId_data),
349  "get tag data");
350 
359 
360  feUId = static_cast<UId>(getBitNumber()) << ent_shift;
361 }
362 
363 std::ostream &operator<<(std::ostream &os, const FiniteElement &e) {
364  os << e.getNameRef() << " fe_id " << e.getId().to_ulong() << " f_id_row "
365  << e.getBitFieldIdRow() << " f_id_col " << e.getBitFieldIdCol()
366  << " BitFEId_data " << e.getBitFieldIdData();
367  return os;
368 }
369 
371  boost::shared_ptr<FiniteElement> &fe) {
372  *static_cast<BitFieldId *>(fe->tag_BitFieldId_col_data) |= fIdCol;
373 }
374 
376  boost::shared_ptr<FiniteElement> &fe) {
377  *static_cast<BitFieldId *>(fe->tag_BitFieldId_row_data) |= fIdRow;
378 }
379 
381  boost::shared_ptr<FiniteElement> &fe) {
382  *static_cast<BitFieldId *>(fe->tag_BitFieldId_data) |= fIdData;
383 }
384 
386  boost::shared_ptr<FiniteElement> &fe) {
387  *static_cast<BitFieldId *>(fe->tag_BitFieldId_col_data) &= fIdCol.flip();
388 }
389 
391  boost::shared_ptr<FiniteElement> &fe) {
392  *static_cast<BitFieldId *>(fe->tag_BitFieldId_row_data) &= fIdRow.flip();
393 }
394 
396  boost::shared_ptr<FiniteElement> &fe) {
397  *static_cast<BitFieldId *>(fe->tag_BitFieldId_data) &= fIdData.flip();
398 }
399 
401  boost::shared_ptr<FiniteElement> &fe) {
402  static_cast<BitFieldId *>(fe->tag_BitFieldId_col_data)->reset();
403 }
404 
406  boost::shared_ptr<FiniteElement> &fe) {
407  static_cast<BitFieldId *>(fe->tag_BitFieldId_row_data)->reset();
408 }
409 
411  boost::shared_ptr<FiniteElement> &fe) {
412  static_cast<BitFieldId *>(fe->tag_BitFieldId_data)->reset();
413 }
414 
415 // FiniteElement data
417  const boost::shared_ptr<RefElement> &ref_finite_element,
418  const boost::shared_ptr<FiniteElement> &fe_ptr)
420  ref_finite_element),
421  dataFieldEnts(new FieldEntity_vector_view()),
422  rowFieldEnts(new FieldEntity_vector_view()),
423  colFieldEnts(new FieldEntity_vector_view()) {}
424 
425 std::ostream &operator<<(std::ostream &os, const EntFiniteElement &e) {
426  os << *e.getFiniteElementPtr() << std::endl;
427  os << *e.sPtr;
428  return os;
429 }
430 
432 EntFiniteElement::getElementAdjacency(const boost::shared_ptr<Field> field_ptr,
433  std::vector<EntityHandle> &adjacency) {
434  moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
436  const EntFiniteElement *this_fe_ptr = this;
437  if (getFiniteElementPtr()->elementAdjacencyTable[getEntType()] == NULL)
438  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
439  CHKERR getFiniteElementPtr()->elementAdjacencyTable[getEntType()](
440  moab, *field_ptr, *this_fe_ptr, adjacency);
442 }
443 
444 /**
445  * \Construct indexed finite element
446  */
448  const boost::shared_ptr<EntFiniteElement> &sptr)
449  : interface_EntFiniteElement<EntFiniteElement>(sptr), part(-1){};
450 
451 boost::weak_ptr<FENumeredDofEntity>
453  auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
454 
455  for (auto &it : getRowFieldEnts()) {
456  if (auto e = it.lock()) {
457  if (auto cache = e->entityCacheColDofs.lock()) {
458  auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
459  if (dit != cache->loHi[1])
460  return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
461  } else
462  THROW_MESSAGE("Cache not set");
463  }
464  }
465 
466  return boost::weak_ptr<FENumeredDofEntity>();
467 }
468 
469 boost::weak_ptr<FENumeredDofEntity>
471 
472  auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
473 
474  for (auto &it : getColFieldEnts()) {
475  if (auto e = it.lock()) {
476  if (auto cache = e->entityCacheColDofs.lock()) {
477  auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
478  if (dit != cache->loHi[1])
479  return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
480  } else
481  THROW_MESSAGE("Cache not set");
482  }
483  }
484 
485  return boost::weak_ptr<FENumeredDofEntity>();
486 }
487 
488 std::ostream &operator<<(std::ostream &os, const NumeredEntFiniteElement &e) {
489  os << "part " << e.part << " " << *(e.getEntFiniteElement());
490  return os;
491 }
492 
493 template <typename ENTSVIEW, typename DOFSVIEW, typename EXTRACTOR,
494  typename INSERTER>
495 inline static MoFEMErrorCode
496 get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view,
497  EXTRACTOR &&extractor, INSERTER &&inserter) {
499 
500  auto hint = dofs_view->end();
501  using ValType = typename std::remove_reference<decltype(**hint)>::type;
502 
503  for (auto &it : *ents_view) {
504  if (auto e = it.lock()) {
505 
506  if (auto cache = extractor(e).lock())
507  for (auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit)
508  hint = inserter(dofs_view, hint,
509  boost::reinterpret_pointer_cast<ValType>(*dit));
510  else
511  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Cache not set");
512  }
513  }
514 
516 }
517 
518 boost::shared_ptr<FEDofEntity_multiIndex>
521  struct Extractor {
522  boost::weak_ptr<EntityCacheDofs>
523  operator()(boost::shared_ptr<FieldEntity> &e) {
524  return e->entityCacheDataDofs;
525  }
526  };
527 
528  struct Inserter {
529  FEDofEntity_multiIndex::iterator
530  operator()(boost::shared_ptr<FEDofEntity_multiIndex> &dofs_view,
531  FEDofEntity_multiIndex::iterator &hint,
532  boost::shared_ptr<FEDofEntity> &&dof) {
533  return dofs_view->emplace_hint(hint, dof);
534  }
535  };
536 
537  auto data_dofs = boost::make_shared<FEDofEntity_multiIndex>();
538  if (get_cache_data_dofs_view(dataFieldEnts, data_dofs, Extractor(),
539  Inserter()))
540  THROW_MESSAGE("data_dofs can not be created");
541  return data_dofs;
542 };
543 
544 boost::shared_ptr<std::vector<boost::shared_ptr<FEDofEntity>>>
547 
548  struct Extractor {
549  boost::weak_ptr<EntityCacheDofs>
550  operator()(boost::shared_ptr<FieldEntity> &e) {
551  return e->entityCacheDataDofs;
552  }
553  };
554 
555  struct Inserter {
556  using Vec = std::vector<boost::shared_ptr<FEDofEntity>>;
557  using It = Vec::iterator;
558  It operator()(boost::shared_ptr<Vec> &dofs_view, It &hint,
559  boost::shared_ptr<FEDofEntity> &&dof) {
560  dofs_view->emplace_back(dof);
561  return dofs_view->end();
562  }
563  };
564 
565  auto data_vector_dofs =
566  boost::make_shared<std::vector<boost::shared_ptr<FEDofEntity>>>();
567  if (get_cache_data_dofs_view(dataFieldEnts, data_vector_dofs, Extractor(),
568  Inserter()))
569  THROW_MESSAGE("dataDofs can not be created");
570 
571  return data_vector_dofs;
572 };
573 
574 boost::shared_ptr<FENumeredDofEntity_multiIndex>
577 
578  struct Extractor {
579  boost::weak_ptr<EntityCacheNumeredDofs>
580  operator()(boost::shared_ptr<FieldEntity> &e) {
581  return e->entityCacheRowDofs;
582  }
583  };
584 
585  struct Inserter {
586  using Idx = FENumeredDofEntity_multiIndex;
587  using It = Idx::iterator;
588  It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
589  boost::shared_ptr<FENumeredDofEntity> &&dof) {
590  return dofs_view->emplace_hint(hint, dof);
591  }
592  };
593 
594  auto row_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
595  if (get_cache_data_dofs_view(getRowFieldEntsPtr(), row_dofs, Extractor(),
596  Inserter()))
597  THROW_MESSAGE("row_dofs can not be created");
598 
599  return row_dofs;
600 }
601 
602 boost::shared_ptr<FENumeredDofEntity_multiIndex>
605 
606  struct Extractor {
607  boost::weak_ptr<EntityCacheNumeredDofs>
608  operator()(boost::shared_ptr<FieldEntity> &e) {
609  return e->entityCacheColDofs;
610  }
611  };
612 
613  struct Inserter {
614  using Idx = FENumeredDofEntity_multiIndex;
615  using It = Idx::iterator;
616  It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
617  boost::shared_ptr<FENumeredDofEntity> &&dof) {
618  return dofs_view->emplace_hint(hint, dof);
619  }
620  };
621 
622  auto col_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
623  if (get_cache_data_dofs_view(getColFieldEntsPtr(), col_dofs, Extractor(),
624  Inserter()))
625  THROW_MESSAGE("col_dofs can not be created");
626 
627  return col_dofs;
628 }
629 
630 } // namespace MoFEM
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
MoFEM::operator<<
std::ostream & operator<<(std::ostream &os, const EntitiesFieldData::EntData &e)
Definition: EntitiesFieldData.cpp:240
MoFEM::NumeredEntFiniteElement::getColDofsPtr
boost::shared_ptr< FENumeredDofEntity_multiIndex > getColDofsPtr() const
get FE dof on column
Definition: FEMultiIndices.cpp:603
MoFEM::FiniteElement_row_change_bit_add::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:375
H1
@ H1
continuous field
Definition: definitions.h:85
MoFEM::interface_RefElement::getSideNumberPtr
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
Definition: RefElementMultiIndices.hpp:153
MoFEM::FiniteElement_change_bit_off::fIdData
BitFieldId fIdData
Definition: FEMultiIndices.hpp:933
EntityHandle
MoFEM::interface_RefElement< RefElement >::getRefEntityPtr
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Definition: RefElementMultiIndices.hpp:157
MoFEM::EntFiniteElement::getDataVectorDofsPtr
boost::shared_ptr< std::vector< boost::shared_ptr< FEDofEntity > > > getDataVectorDofsPtr() const
Get data data dos multi-index structure.
Definition: FEMultiIndices.cpp:545
MoFEM::FiniteElement::getId
BitFEId getId() const
Get finite element id.
Definition: FEMultiIndices.hpp:50
MoFEM::Field::getMeshset
EntityHandle getMeshset() const
Get field meshset.
Definition: FieldMultiIndices.hpp:123
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
MoFEM::FiniteElement_col_change_bit_add::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:370
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::Field::getSpace
FieldSpace getSpace() const
Get field approximation space.
Definition: FieldMultiIndices.hpp:151
MoFEM::FieldEntity_vector_view
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
Definition: FieldEntsMultiIndices.hpp:478
MoFEM::DefaultElementAdjacency::defaultEdge
static MoFEMErrorCode defaultEdge(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Definition: FEMultiIndices.cpp:55
MoFEM::FiniteElement::elementAdjacencyTable
std::array< ElementAdjacencyFunct, MBMAXTYPE > elementAdjacencyTable
Table of functions retrieving adjacencies for finite element User can alter and change default behavi...
Definition: FEMultiIndices.hpp:114
MoFEM::interface_RefEntity::sPtr
boost::shared_ptr< T > sPtr
Definition: RefEntsMultiIndices.hpp:711
MoFEM::Types::BitFieldId
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:42
MoFEM::FiniteElement::getNameRef
boost::string_ref getNameRef() const
Get finite element name.
Definition: FEMultiIndices.hpp:62
MoFEM::interface_RefEntity::getEnt
EntityHandle getEnt() const
Get the entity handle.
Definition: RefEntsMultiIndices.hpp:603
MoFEM::EntFiniteElement::getDataDofsPtr
boost::shared_ptr< FEDofEntity_multiIndex > getDataDofsPtr() const
Get the Data Dofs Ptr object.
Definition: FEMultiIndices.cpp:519
MoFEM::EntFiniteElement
Finite element data for entity.
Definition: FEMultiIndices.hpp:501
MoFEM::FiniteElement::tagId
BitFEId * tagId
ptr to tag storing FE id
Definition: FEMultiIndices.hpp:29
MoFEM::FiniteElement_row_change_bit_add::fIdRow
BitFieldId fIdRow
Definition: FEMultiIndices.hpp:885
MoFEM::interface_RefElement::getSideNumberTable
SideNumber_multiIndex & getSideNumberTable() const
Definition: RefElementMultiIndices.hpp:148
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
MoFEM::Field
Provide data structure for (tensor) field approximation.
Definition: FieldMultiIndices.hpp:51
MoFEM::FiniteElement_col_change_bit_off::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:385
MoFEM::FiniteElement::tag_BitFieldId_row_data
BitFieldId * tag_BitFieldId_row_data
tag stores row id_id for fields
Definition: FEMultiIndices.hpp:33
MoFEM::DefaultElementAdjacency::defVertexTypeMap
static constexpr DefEntTypeMap defVertexTypeMap
Definition: FEMultiIndices.hpp:151
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::DefaultElementAdjacency::defTypeMap
static constexpr std::array< const DefEntTypeMap *, MBMAXTYPE > defTypeMap
Definition: FEMultiIndices.hpp:287
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
MoFEM::DefaultElementAdjacency::defaultPrism
static MoFEMErrorCode defaultPrism(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Definition: FEMultiIndices.cpp:157
MoFEM::FiniteElement::meshset
EntityHandle meshset
meshset stores FE ents
Definition: FEMultiIndices.hpp:28
MoFEM::interface_EntFiniteElement< EntFiniteElement >::getRowFieldEntsPtr
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const
Definition: FEMultiIndices.hpp:686
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::NumeredEntFiniteElement::getColDofsByPetscGlobalDofIdx
boost::weak_ptr< FENumeredDofEntity > getColDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
Definition: FEMultiIndices.cpp:470
MoFEM::DefaultElementAdjacency::defEdgeTypeMap
static constexpr DefEntTypeMap defEdgeTypeMap
Definition: FEMultiIndices.hpp:168
MoFEM::NumeredEntFiniteElement::getEntFiniteElement
boost::shared_ptr< EntFiniteElement > & getEntFiniteElement() const
Definition: FEMultiIndices.hpp:740
MoFEM::FiniteElement_change_bit_reset::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:410
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::DefaultElementAdjacency::defaultVertex
static MoFEMErrorCode defaultVertex(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Definition: FEMultiIndices.cpp:28
MoFEM::NumeredEntFiniteElement::getRowDofsPtr
boost::shared_ptr< FENumeredDofEntity_multiIndex > getRowDofsPtr() const
get FE dof on row
Definition: FEMultiIndices.cpp:575
MoFEM::FiniteElement_row_change_bit_off::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:390
MoFEM::DefaultElementAdjacency::defaultMeshset
static MoFEMErrorCode defaultMeshset(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Definition: FEMultiIndices.cpp:295
MoFEM::Types::UId
uint128_t UId
Unique Id.
Definition: Types.hpp:31
MoFEM::FiniteElement::feUId
UId feUId
Definition: FEMultiIndices.hpp:35
MoFEM::interface_FiniteElement::getFiniteElementPtr
boost::shared_ptr< FE > & getFiniteElementPtr() const
Definition: FEMultiIndices.hpp:396
convert.type
type
Definition: convert.py:64
MoFEM::interface_EntFiniteElement< EntFiniteElement >::getRefElement
const boost::shared_ptr< RefElement > & getRefElement() const
Definition: FEMultiIndices.hpp:714
SideNumber_multiIndex
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< ordered_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, signed char, &SideNumber::side_number > > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
Definition: RefEntsMultiIndices.hpp:101
MoFEM::FiniteElement_change_bit_add::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:380
MoFEM::DefaultElementAdjacency::defaultVolume
static MoFEMErrorCode defaultVolume(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Definition: FEMultiIndices.cpp:121
MoFEM::FiniteElement::ent_shift
static constexpr int ent_shift
Definition: FEMultiIndices.hpp:122
MoFEM::FiniteElement::getBitNumber
unsigned int getBitNumber() const
Get bit identifying this element.
Definition: FEMultiIndices.hpp:106
MoFEM::NumeredEntFiniteElement::part
unsigned int part
Partition number.
Definition: FEMultiIndices.hpp:738
MoFEM::FiniteElement_row_change_bit_off::fIdRow
BitFieldId fIdRow
Definition: FEMultiIndices.hpp:921
MoFEM::FiniteElement_col_change_bit_off::fIdCol
BitFieldId fIdCol
Definition: FEMultiIndices.hpp:909
MoFEM::FiniteElement::tag_BitFieldId_col_data
BitFieldId * tag_BitFieldId_col_data
tag stores col id_id for fields
Definition: FEMultiIndices.hpp:32
MoFEM::FiniteElement::tagNameSize
int tagNameSize
numer of characters in FE name
Definition: FEMultiIndices.hpp:31
MoFEM::FiniteElement::getBitFieldIdRow
BitFieldId getBitFieldIdRow() const
Get field ids on rows.
Definition: FEMultiIndices.hpp:86
MoFEM::DefaultElementAdjacency::defaultFace
static MoFEMErrorCode defaultFace(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Definition: FEMultiIndices.cpp:87
MoFEM::RefElement
keeps data about abstract refined finite element
Definition: RefElementMultiIndices.hpp:16
MoFEM::FiniteElement::tag_BitFieldId_data
BitFieldId * tag_BitFieldId_data
tag stores data id_id for fields
Definition: FEMultiIndices.hpp:34
MoFEM::FiniteElement::getBitFieldIdCol
BitFieldId getBitFieldIdCol() const
Get field ids on columns.
Definition: FEMultiIndices.hpp:78
MoFEM::interface_EntFiniteElement< EntFiniteElement >::getColFieldEnts
FieldEntity_vector_view & getColFieldEnts() const
Definition: FEMultiIndices.hpp:690
MoFEM::FiniteElement
Finite element definition.
Definition: FEMultiIndices.hpp:26
MoFEM::FiniteElement_change_bit_off::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:395
MoFEM::EntFiniteElement::EntFiniteElement
EntFiniteElement(const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
Definition: FEMultiIndices.cpp:416
MoFEM::DefaultElementAdjacency::DefEntTypeMap
std::array< bool, MBMAXTYPE > DefEntTypeMap
Definition: FEMultiIndices.hpp:149
Range
MoFEM::SideNumber
keeps information about side number for the finite element
Definition: RefEntsMultiIndices.hpp:57
MoFEM::interface_EntFiniteElement< EntFiniteElement >::getColFieldEntsPtr
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const
Definition: FEMultiIndices.hpp:695
MoFEM::EntFiniteElement::getElementAdjacency
MoFEMErrorCode getElementAdjacency(const boost::shared_ptr< Field > field_ptr, std::vector< EntityHandle > &adjacency)
Definition: FEMultiIndices.cpp:432
MoFEM::interface_EntFiniteElement
interface to EntFiniteElement
Definition: FEMultiIndices.hpp:661
MoFEM::NumeredEntFiniteElement::getRowDofsByPetscGlobalDofIdx
boost::weak_ptr< FENumeredDofEntity > getRowDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
Definition: FEMultiIndices.cpp:452
MoFEM::FiniteElement_change_bit_add::fIdData
BitFieldId fIdData
Definition: FEMultiIndices.hpp:897
MoFEM::DefaultElementAdjacency::defHexTypeMap
static constexpr DefEntTypeMap defHexTypeMap
Definition: FEMultiIndices.hpp:236
MoFEM::DefaultElementAdjacency::defMeshsetTypeMap
static constexpr DefEntTypeMap defMeshsetTypeMap
Definition: FEMultiIndices.hpp:270
MoFEM::FiniteElement::getBitFieldIdData
BitFieldId getBitFieldIdData() const
Get field ids on data.
Definition: FEMultiIndices.hpp:94
MoFEM::FiniteElement_row_change_bit_reset::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:405
HCURL
@ HCURL
field with continuous tangents
Definition: definitions.h:86
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::DefaultElementAdjacency::defTriTypeMap
static constexpr DefEntTypeMap defTriTypeMap
Definition: FEMultiIndices.hpp:185
MoFEM::interface_RefEntity< RefElement >::getEntType
EntityType getEntType() const
Get entity type.
Definition: RefEntsMultiIndices.hpp:643
MoFEM::interface_FiniteElement
Definition: FEMultiIndices.hpp:328
MoFEM::FiniteElement_col_change_bit_reset::operator()
void operator()(boost::shared_ptr< FiniteElement > &fe)
Definition: FEMultiIndices.cpp:400
MoFEM::interface_RefElement::getRefElement
boost::shared_ptr< T > & getRefElement() const
Definition: RefElementMultiIndices.hpp:161
MoFEM::NumeredEntFiniteElement
Partitioned (Indexed) Finite Element in Problem.
Definition: FEMultiIndices.hpp:728
MoFEM::interface_EntFiniteElement< EntFiniteElement >::getRowFieldEnts
FieldEntity_vector_view & getRowFieldEnts() const
Definition: FEMultiIndices.hpp:681
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::EntFiniteElement::dataFieldEnts
boost::shared_ptr< FieldEntity_vector_view > dataFieldEnts
Definition: FEMultiIndices.hpp:651
MoFEM::DefaultElementAdjacency::defTetTypeMap
static constexpr DefEntTypeMap defTetTypeMap
Definition: FEMultiIndices.hpp:219
MoFEM::DefaultElementAdjacency::defPrismTypeMap
static constexpr DefEntTypeMap defPrismTypeMap
Definition: FEMultiIndices.hpp:253
MoFEM::FiniteElement_col_change_bit_add::fIdCol
BitFieldId fIdCol
Definition: FEMultiIndices.hpp:873
MoFEM::get_cache_data_dofs_view
static MoFEMErrorCode get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)
Definition: FEMultiIndices.cpp:496
FENumeredDofEntity_multiIndex
multi_index_container< boost::shared_ptr< FENumeredDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< FENumeredDofEntity::interface_type_DofEntity, UId, &FENumeredDofEntity::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FENumeredDofEntity::interface_type_DofEntity, EntityHandle, &FENumeredDofEntity::getEnt > > > > FENumeredDofEntity_multiIndex
MultiIndex container keeps FENumeredDofEntity.
Definition: DofsMultiIndices.hpp:417
MoFEM::NumeredEntFiniteElement::NumeredEntFiniteElement
NumeredEntFiniteElement(const boost::shared_ptr< EntFiniteElement > &sptr)
Definition: FEMultiIndices.cpp:447
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
HDIV
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEM::RefEntityTmp
Definition: RefEntsMultiIndices.hpp:118
MoFEM::FiniteElement::tagName
void * tagName
ptr to tag storing FE name
Definition: FEMultiIndices.hpp:30
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::FiniteElement::FiniteElement
FiniteElement(Interface &moab, const EntityHandle _meshset)
Definition: FEMultiIndices.cpp:325
NOFIELD
@ NOFIELD
scalar or vector of scalars describe (no true field)
Definition: definitions.h:84
MoFEM::DefaultElementAdjacency::defQuadTypeMap
static constexpr DefEntTypeMap defQuadTypeMap
Definition: FEMultiIndices.hpp:202