v0.13.1
FEMultiIndices.cpp
Go to the documentation of this file.
1/** \file FEMultiIndices.cpp
2 * \brief Multi-index containers for finite elements
3 */
4
5/* MoFEM is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the
7 * Free Software Foundation, either version 3 of the License, or (at your
8 * option) any later version.
9 *
10 * MoFEM is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13 * License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
17 */
18
19namespace MoFEM {
20
37constexpr std::array<const DefaultElementAdjacency::DefEntTypeMap *, MBMAXTYPE>
39
41 moab::Interface &moab, const Field &field, const EntFiniteElement &fe,
42 std::vector<EntityHandle> &adjacency) {
44 switch (field.getSpace()) {
45 case H1:
46 adjacency.push_back(fe.getEnt());
47 // build side table
48 for (auto ent : adjacency)
49 fe.getSideNumberPtr(ent);
50 break;
51 case NOFIELD: {
52 CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
53 for (auto ent : adjacency) {
55 .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
56 }
57 } break;
58 default:
59 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
60 "this field is not implemented for VERTEX finite element");
61 }
62
64}
65
68 const EntFiniteElement &fe,
69 std::vector<EntityHandle> &adjacency) {
71 EntityHandle fe_ent = fe.getEnt();
72 // Range nodes;
73 switch (field.getSpace()) {
74 case H1:
75 CHKERR moab.get_connectivity(&fe_ent, 1, adjacency, true);
76 case L2:
77 case HCURL:
78 adjacency.push_back(fe_ent);
79 // build side table
80 for (auto e : adjacency)
81 fe.getSideNumberPtr(e);
82 break;
83 case NOFIELD: {
84 CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
85 for (auto e : adjacency) {
87 .insert(boost::shared_ptr<SideNumber>(new SideNumber(e, -1, 0, 0)));
88 }
89 } break;
90 default:
91 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
92 "this field is not implemented for EDGE finite element");
93 }
94
96}
97
100 const EntFiniteElement &fe,
101 std::vector<EntityHandle> &adjacency) {
103 // Range nodes,edges;
104 const EntityHandle fe_ent = fe.getEnt();
105 switch (field.getSpace()) {
106 case H1:
107 CHKERR moab.get_connectivity(&fe_ent, 1, adjacency, true);
108 case HCURL:
109 CHKERR moab.get_adjacencies(&fe_ent, 1, 1, false, adjacency,
110 moab::Interface::UNION);
111 case HDIV:
112 case L2:
113 adjacency.push_back(fe_ent);
114 // build side table
115 for (auto ent : adjacency)
116 fe.getSideNumberPtr(ent);
117 break;
118 case NOFIELD: {
119 CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
120 for (auto ent : adjacency) {
121 const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
122 .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
123 }
124 } break;
125 default:
126 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
127 "this field is not implemented for TRI finite element");
128 }
129
131}
132
134 moab::Interface &moab, const Field &field, const EntFiniteElement &fe,
135 std::vector<EntityHandle> &adjacency) {
137 EntityHandle fe_ent = fe.getEnt();
138 switch (field.getSpace()) {
139 case H1:
140 CHKERR moab.get_connectivity(&fe_ent, 1, adjacency, true);
141 case HCURL:
142 CHKERR moab.get_adjacencies(&fe_ent, 1, 1, false, adjacency,
143 moab::Interface::UNION);
144 case HDIV:
145 CHKERR moab.get_adjacencies(&fe_ent, 1, 2, false, adjacency,
146 moab::Interface::UNION);
147 case L2:
148 adjacency.push_back(fe_ent);
149 // build side table
150 for (auto ent : adjacency)
151 fe.getSideNumberPtr(ent);
152 break;
153 case NOFIELD: {
154 CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
155 for (auto ent : adjacency) {
156 const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
157 .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
158 }
159 } break;
160 default:
161 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
162 "this field is not implemented for TRI finite element");
163 }
164
166}
167
170 const EntFiniteElement &fe,
171 std::vector<EntityHandle> &adjacency) {
173 const EntityHandle prism = fe.getEnt();
174 Range nodes;
175 // initialize side sets
176 fe.getRefElement()->getSideNumberPtr(prism);
177 EntityHandle face_side3, face_side4;
178 CHKERR moab.side_element(prism, 2, 3, face_side3);
179 CHKERR moab.side_element(prism, 2, 4, face_side4);
180 fe.getRefElement()->getSideNumberPtr(face_side3);
181 fe.getRefElement()->getSideNumberPtr(face_side4);
182 for (int qq = 0; qq < 3; qq++) {
183 EntityHandle quad = 0;
184 rval = moab.side_element(prism, 2, qq, quad);
185 if (rval != MB_SUCCESS || quad == 0)
186 continue;
187 int side_number, sense, offset;
188 rval = moab.side_number(prism, quad, side_number, sense, offset);
189 if (side_number == -1 || rval != MB_SUCCESS)
190 continue;
191 const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
192 .insert(boost::shared_ptr<SideNumber>(
193 new SideNumber(quad, side_number, sense, offset)));
194 }
195 int ee = 0;
196 for (; ee < 3; ee++) {
197 EntityHandle edge = 0;
198 CHKERR moab.side_element(prism, 1, ee, edge);
199 boost::shared_ptr<SideNumber> side_ptr =
200 fe.getRefElement()->getSideNumberPtr(edge);
201 if (side_ptr->side_number != ee) {
202 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
203 "data inconsistency for edge %d while in FE datastructure is "
204 "numbered %d.",
205 ee, side_ptr->side_number);
206 }
207 CHKERR moab.side_element(prism, 1, 6 + ee, edge);
208 side_ptr = fe.getRefElement()->getSideNumberPtr(edge);
209 if (side_ptr->side_number != ee + 6) {
210 if (side_ptr->side_number != ee) {
211 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
212 "data inconsistency for edge %d while in FE datastructure "
213 "is numbered %d.",
214 ee, side_ptr->side_number);
215 } else {
216 side_ptr->brother_side_number = ee + 6;
217 }
218 }
219 }
220 for (; ee < 6; ee++) {
221 EntityHandle edge = 0;
222 rval = moab.side_element(prism, 1, ee, edge);
223 if (rval != MB_SUCCESS || edge == 0)
224 continue;
225 int side_number, sense, offset;
226 rval = moab.side_number(prism, edge, side_number, sense, offset);
227 if (side_number == -1 || rval != MB_SUCCESS)
228 continue;
229 const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
230 .insert(boost::shared_ptr<SideNumber>(
231 new SideNumber(edge, side_number, sense, offset)));
232 }
233 int nn = 0;
234 for (; nn < 3; nn++) {
235 EntityHandle node;
236 CHKERR moab.side_element(prism, 0, nn, node);
237 boost::shared_ptr<SideNumber> side_ptr =
238 fe.getRefElement()->getSideNumberPtr(node);
239 if (side_ptr->side_number != nn) {
240 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
241 "data inconsistency for node %d while in FE datastructure is "
242 "numbered %d.",
243 nn, side_ptr->side_number);
244 }
245 CHKERR moab.side_element(prism, 0, nn + 3, node);
246 side_ptr = fe.getRefElement()->getSideNumberPtr(node);
247 if (side_ptr->side_number != nn + 3) {
248 if (side_ptr->side_number != nn) {
249 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
250 "data inconsistency for node %d while in FE datastructure is "
251 "numbered %d.",
252 nn, side_ptr->side_number);
253 } else {
254 side_ptr->brother_side_number = nn + 3;
255 }
256 }
257 }
258
259 // get adjacencies
260 SideNumber_multiIndex &side_table = fe.getRefElement()->getSideNumberTable();
261 switch (field.getSpace()) {
262 case H1:
263 // moab.get_connectivity(&prism,1,nodes,true);
264 // use get adjacencies, this will allow take in account adjacencies set user
265 CHKERR moab.get_adjacencies(&prism, 1, 0, false, nodes,
266 moab::Interface::UNION);
267 {
268 Range topo_nodes;
269 CHKERR moab.get_connectivity(&prism, 1, topo_nodes, true);
270 Range mid_nodes;
271 CHKERR moab.get_connectivity(&prism, 1, mid_nodes, false);
272 mid_nodes = subtract(mid_nodes, topo_nodes);
273 nodes = subtract(nodes, mid_nodes);
274 }
275 adjacency.insert(adjacency.end(), nodes.begin(), nodes.end());
276 case HCURL: {
277 auto siit = side_table.get<0>().lower_bound(get_id_for_min_type<MBEDGE>());
278 auto hi_siit =
279 side_table.get<0>().upper_bound(get_id_for_max_type<MBEDGE>());
280 for (; siit != hi_siit; siit++)
281 adjacency.push_back(siit->get()->ent);
282 }
283 case HDIV: {
284 auto siit = side_table.get<0>().lower_bound(get_id_for_min_type<MBTRI>());
285 auto hi_siit =
286 side_table.get<0>().upper_bound(get_id_for_max_type<MBQUAD>());
287 for (; siit != hi_siit; siit++)
288 adjacency.push_back(siit->get()->ent);
289 }
290 case L2:
291 adjacency.push_back(prism);
292 break;
293 case NOFIELD: {
294 CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
295 for (auto ent : adjacency) {
296 const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
297 .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
298 }
299 } break;
300 default:
301 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
302 "this field is not implemented for TRI finite element");
303 }
305}
306
308 moab::Interface &moab, const Field &field, const EntFiniteElement &fe,
309 std::vector<EntityHandle> &adjacency) {
311 EntityHandle fe_ent = fe.getEnt();
312 // resolve recursively all ents in the meshset
313 switch (field.getSpace()) {
314 case H1:
315 CHKERR moab.get_entities_by_type(fe_ent, MBVERTEX, adjacency, true);
316 case HCURL:
317 CHKERR moab.get_entities_by_type(fe_ent, MBEDGE, adjacency, true);
318 case HDIV:
319 CHKERR moab.get_entities_by_dimension(fe_ent, 2, adjacency, true);
320 case L2:
321 CHKERR moab.get_entities_by_dimension(fe_ent, 3, adjacency, true);
322 break;
323 case NOFIELD: {
324 CHKERR moab.get_entities_by_handle(field.getMeshset(), adjacency, false);
325 for (auto ent : adjacency) {
326 const_cast<SideNumber_multiIndex &>(fe.getSideNumberTable())
327 .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, -1, 0, 0)));
328 }
329 } break;
330 default:
331 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
332 }
334}
335
336// FiniteElement
337FiniteElement::FiniteElement(moab::Interface &moab, const EntityHandle _meshset)
338 : meshset(_meshset) {
339 Tag th_FEId;
340 rval = moab.tag_get_handle("_FEId", th_FEId);
342 rval = moab.tag_get_by_ptr(th_FEId, &meshset, 1, (const void **)&tagId);
344 Tag th_FEName;
345 rval = moab.tag_get_handle("_FEName", th_FEName);
347 rval = moab.tag_get_by_ptr(th_FEName, &meshset, 1, (const void **)&tagName,
348 &tagNameSize);
350 Tag th_FEIdCol, th_FEIdRow, th_FEIdData;
351 rval = moab.tag_get_handle("_FEIdCol", th_FEIdCol);
353 rval = moab.tag_get_by_ptr(th_FEIdCol, &meshset, 1,
354 (const void **)&tag_BitFieldId_col_data);
356 rval = moab.tag_get_handle("_FEIdRow", th_FEIdRow);
358 rval = moab.tag_get_by_ptr(th_FEIdRow, &meshset, 1,
359 (const void **)&tag_BitFieldId_row_data);
361 rval = moab.tag_get_handle("_FEIdData", th_FEIdData);
363 rval = moab.tag_get_by_ptr(th_FEIdData, &meshset, 1,
364 (const void **)&tag_BitFieldId_data);
366
375
376 feUId = static_cast<UId>(getBitNumber()) << 8 * sizeof(EntityHandle);
377}
378
379std::ostream &operator<<(std::ostream &os, const FiniteElement &e) {
380 os << e.getNameRef() << " fe_id " << e.getId().to_ulong() << " f_id_row "
381 << e.getBitFieldIdRow() << " f_id_col " << e.getBitFieldIdCol()
382 << " BitFEId_data " << e.getBitFieldIdData();
383 return os;
384}
385
387 boost::shared_ptr<FiniteElement> &fe) {
388 *static_cast<BitFieldId *>(fe->tag_BitFieldId_col_data) |= fIdCol;
389}
390
392 boost::shared_ptr<FiniteElement> &fe) {
393 *static_cast<BitFieldId *>(fe->tag_BitFieldId_row_data) |= fIdRow;
394}
395
397 boost::shared_ptr<FiniteElement> &fe) {
398 *static_cast<BitFieldId *>(fe->tag_BitFieldId_data) |= fIdData;
399}
400
402 boost::shared_ptr<FiniteElement> &fe) {
403 *static_cast<BitFieldId *>(fe->tag_BitFieldId_col_data) &= fIdCol.flip();
404}
405
407 boost::shared_ptr<FiniteElement> &fe) {
408 *static_cast<BitFieldId *>(fe->tag_BitFieldId_row_data) &= fIdRow.flip();
409}
410
412 boost::shared_ptr<FiniteElement> &fe) {
413 *static_cast<BitFieldId *>(fe->tag_BitFieldId_data) &= fIdData.flip();
414}
415
417 boost::shared_ptr<FiniteElement> &fe) {
418 static_cast<BitFieldId *>(fe->tag_BitFieldId_col_data)->reset();
419}
420
422 boost::shared_ptr<FiniteElement> &fe) {
423 static_cast<BitFieldId *>(fe->tag_BitFieldId_row_data)->reset();
424}
425
427 boost::shared_ptr<FiniteElement> &fe) {
428 static_cast<BitFieldId *>(fe->tag_BitFieldId_data)->reset();
429}
430
431// FiniteElement data
433 const boost::shared_ptr<RefElement> &ref_finite_element,
434 const boost::shared_ptr<FiniteElement> &fe_ptr)
436 ref_finite_element),
437 dataFieldEnts(new FieldEntity_vector_view()),
438 rowFieldEnts(new FieldEntity_vector_view()),
439 colFieldEnts(new FieldEntity_vector_view()) {}
440
441std::ostream &operator<<(std::ostream &os, const EntFiniteElement &e) {
442 os << *e.getFiniteElementPtr() << std::endl;
443 os << *e.sPtr;
444 return os;
445}
446
448EntFiniteElement::getElementAdjacency(const boost::shared_ptr<Field> field_ptr,
449 std::vector<EntityHandle> &adjacency) {
450 moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
452 const EntFiniteElement *this_fe_ptr = this;
453 if (getFiniteElementPtr()->elementAdjacencyTable[getEntType()] == NULL)
454 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
455 CHKERR getFiniteElementPtr()->elementAdjacencyTable[getEntType()](
456 moab, *field_ptr, *this_fe_ptr, adjacency);
458}
459
460/**
461 * \Construct indexed finite element
462 */
464 const boost::shared_ptr<EntFiniteElement> &sptr)
465 : interface_EntFiniteElement<EntFiniteElement>(sptr), part(-1){};
466
467boost::weak_ptr<FENumeredDofEntity>
469 auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
470
471 for (auto &it : getRowFieldEnts()) {
472 if (auto e = it.lock()) {
473 if (auto cache = e->entityCacheColDofs.lock()) {
474 auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
475 if (dit != cache->loHi[1])
476 return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
477 } else
478 THROW_MESSAGE("Cache not set");
479 }
480 }
481
482 return boost::weak_ptr<FENumeredDofEntity>();
483}
484
485boost::weak_ptr<FENumeredDofEntity>
487
488 auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
489
490 for (auto &it : getColFieldEnts()) {
491 if (auto e = it.lock()) {
492 if (auto cache = e->entityCacheColDofs.lock()) {
493 auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
494 if (dit != cache->loHi[1])
495 return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
496 } else
497 THROW_MESSAGE("Cache not set");
498 }
499 }
500
501 return boost::weak_ptr<FENumeredDofEntity>();
502}
503
504std::ostream &operator<<(std::ostream &os, const NumeredEntFiniteElement &e) {
505 os << "part " << e.part << " " << *(e.getEntFiniteElement());
506 return os;
507}
508
509template <typename ENTSVIEW, typename DOFSVIEW, typename EXTRACTOR,
510 typename INSERTER>
511inline static MoFEMErrorCode
512get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view,
513 EXTRACTOR &&extractor, INSERTER &&inserter) {
515
516 auto hint = dofs_view->end();
517 using ValType = typename std::remove_reference<decltype(**hint)>::type;
518
519 for (auto &it : *ents_view) {
520 if (auto e = it.lock()) {
521
522 if (auto cache = extractor(e).lock())
523 for (auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit)
524 hint = inserter(dofs_view, hint,
525 boost::reinterpret_pointer_cast<ValType>(*dit));
526 else
527 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Cache not set");
528 }
529 }
530
532}
533
534boost::shared_ptr<FEDofEntity_multiIndex>
537 struct Extractor {
538 boost::weak_ptr<EntityCacheDofs>
539 operator()(boost::shared_ptr<FieldEntity> &e) {
540 return e->entityCacheDataDofs;
541 }
542 };
543
544 struct Inserter {
545 FEDofEntity_multiIndex::iterator
546 operator()(boost::shared_ptr<FEDofEntity_multiIndex> &dofs_view,
547 FEDofEntity_multiIndex::iterator &hint,
548 boost::shared_ptr<FEDofEntity> &&dof) {
549 return dofs_view->emplace_hint(hint, dof);
550 }
551 };
552
553 auto data_dofs = boost::make_shared<FEDofEntity_multiIndex>();
554 if (get_cache_data_dofs_view(dataFieldEnts, data_dofs, Extractor(),
555 Inserter()))
556 THROW_MESSAGE("data_dofs can not be created");
557 return data_dofs;
558};
559
560boost::shared_ptr<std::vector<boost::shared_ptr<FEDofEntity>>>
563
564 struct Extractor {
565 boost::weak_ptr<EntityCacheDofs>
566 operator()(boost::shared_ptr<FieldEntity> &e) {
567 return e->entityCacheDataDofs;
568 }
569 };
570
571 struct Inserter {
572 using Vec = std::vector<boost::shared_ptr<FEDofEntity>>;
573 using It = Vec::iterator;
574 It operator()(boost::shared_ptr<Vec> &dofs_view, It &hint,
575 boost::shared_ptr<FEDofEntity> &&dof) {
576 dofs_view->emplace_back(dof);
577 return dofs_view->end();
578 }
579 };
580
581 auto data_vector_dofs =
582 boost::make_shared<std::vector<boost::shared_ptr<FEDofEntity>>>();
583 if (get_cache_data_dofs_view(dataFieldEnts, data_vector_dofs, Extractor(),
584 Inserter()))
585 THROW_MESSAGE("dataDofs can not be created");
586
587 return data_vector_dofs;
588};
589
590boost::shared_ptr<FENumeredDofEntity_multiIndex>
593
594 struct Extractor {
595 boost::weak_ptr<EntityCacheNumeredDofs>
596 operator()(boost::shared_ptr<FieldEntity> &e) {
597 return e->entityCacheRowDofs;
598 }
599 };
600
601 struct Inserter {
603 using It = Idx::iterator;
604 It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
605 boost::shared_ptr<FENumeredDofEntity> &&dof) {
606 return dofs_view->emplace_hint(hint, dof);
607 }
608 };
609
610 auto row_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
611 if (get_cache_data_dofs_view(getRowFieldEntsPtr(), row_dofs, Extractor(),
612 Inserter()))
613 THROW_MESSAGE("row_dofs can not be created");
614
615 return row_dofs;
616}
617
618boost::shared_ptr<FENumeredDofEntity_multiIndex>
621
622 struct Extractor {
623 boost::weak_ptr<EntityCacheNumeredDofs>
624 operator()(boost::shared_ptr<FieldEntity> &e) {
625 return e->entityCacheColDofs;
626 }
627 };
628
629 struct Inserter {
631 using It = Idx::iterator;
632 It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
633 boost::shared_ptr<FENumeredDofEntity> &&dof) {
634 return dofs_view->emplace_hint(hint, dof);
635 }
636 };
637
638 auto col_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
639 if (get_cache_data_dofs_view(getColFieldEntsPtr(), col_dofs, Extractor(),
640 Inserter()))
641 THROW_MESSAGE("col_dofs can not be created");
642
643 return col_dofs;
644}
645
646} // namespace MoFEM
constexpr double a
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:554
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
@ L2
field with C-1 continuity
Definition: definitions.h:101
@ NOFIELD
scalar or vector of scalars describe (no true field)
Definition: definitions.h:97
@ H1
continuous field
Definition: definitions.h:98
@ HCURL
field with continuous tangents
Definition: definitions.h:99
@ HDIV
field with continuous normal traction
Definition: definitions.h:100
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:44
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:45
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
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.
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.
BlockParamData * cache
const FTensor::Tensor2< T, Dim, Dim > Vec
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
uint128_t UId
Unique Id.
Definition: Types.hpp:42
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
std::ostream & operator<<(std::ostream &os, const EntitiesFieldData::EntData &e)
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
static MoFEMErrorCode get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
static constexpr DefEntTypeMap defVertexTypeMap
static constexpr DefEntTypeMap defEdgeTypeMap
std::array< bool, MBMAXTYPE > DefEntTypeMap
static constexpr DefEntTypeMap defQuadTypeMap
static constexpr DefEntTypeMap defTriTypeMap
static MoFEMErrorCode defaultMeshset(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultVertex(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultVolume(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static constexpr std::array< const DefEntTypeMap *, MBMAXTYPE > defTypeMap
static constexpr DefEntTypeMap defTetTypeMap
static constexpr DefEntTypeMap defHexTypeMap
static constexpr DefEntTypeMap defMeshsetTypeMap
static MoFEMErrorCode defaultEdge(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultPrism(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultFace(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static constexpr DefEntTypeMap defPrismTypeMap
Finite element data for entity.
EntFiniteElement(const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
boost::shared_ptr< std::vector< boost::shared_ptr< FEDofEntity > > > getDataVectorDofsPtr() const
Get data data dos multi-index structure.
boost::shared_ptr< FieldEntity_vector_view > dataFieldEnts
boost::shared_ptr< FEDofEntity_multiIndex > getDataDofsPtr() const
Get the Data Dofs Ptr object.
MoFEMErrorCode getElementAdjacency(const boost::shared_ptr< Field > field_ptr, std::vector< EntityHandle > &adjacency)
Provide data structure for (tensor) field approximation.
EntityHandle getMeshset() const
Get field meshset.
FieldSpace getSpace() const
Get field approximation space.
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
Finite element definition.
BitFieldId * tag_BitFieldId_col_data
tag stores col id_id for fields
void * tagName
ptr to tag storing FE name
unsigned int getBitNumber() const
Get bit identifying this element.
BitFieldId * tag_BitFieldId_data
tag stores data id_id for fields
BitFEId * tagId
ptr to tag storing FE id
BitFieldId getBitFieldIdRow() const
Get field ids on rows.
BitFEId getId() const
Get finite element id.
FiniteElement(Interface &moab, const EntityHandle _meshset)
BitFieldId * tag_BitFieldId_row_data
tag stores row id_id for fields
boost::string_ref getNameRef() const
Get finite element name.
BitFieldId getBitFieldIdData() const
Get field ids on data.
BitFieldId getBitFieldIdCol() const
Get field ids on columns.
int tagNameSize
numer of characters in FE name
EntityHandle meshset
meshset stores FE ents
std::array< ElementAdjacencyFunct, MBMAXTYPE > elementAdjacencyTable
Table of functions retrieving adjacencies for finite element User can alter and change default behavi...
Partitioned (Indexed) Finite Element in Problem.
boost::weak_ptr< FENumeredDofEntity > getRowDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
boost::weak_ptr< FENumeredDofEntity > getColDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
NumeredEntFiniteElement(const boost::shared_ptr< EntFiniteElement > &sptr)
boost::shared_ptr< EntFiniteElement > & getEntFiniteElement() const
boost::shared_ptr< FENumeredDofEntity_multiIndex > getRowDofsPtr() const
get FE dof on row
boost::shared_ptr< FENumeredDofEntity_multiIndex > getColDofsPtr() const
get FE dof on column
unsigned int part
Partition number.
keeps data about abstract refined finite element
keeps information about side number for the finite element
interface to EntFiniteElement
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const
const boost::shared_ptr< RefElement > & getRefElement() const
boost::shared_ptr< FE > & getFiniteElementPtr() const
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
SideNumber_multiIndex & getSideNumberTable() const
boost::shared_ptr< T > & getRefElement() const
EntityType getEntType() const
Get entity type.
EntityHandle getEnt() const
Get the entity handle.