15 {
16
18 auto &set = fIelds.get<FieldName_mi_tag>();
19 auto miit =
set.find(
name);
20 if (miit ==
set.
end()) {
22 " > not in database (top tip: check spelling)");
23 }
24 return (*miit)->getId();
25}
26
28 auto &set = fIelds.get<FieldName_mi_tag>();
29 auto miit =
set.find(
name);
30 if (miit ==
set.
end())
32 " > not in database (top tip: check spelling)");
33 return (*miit)->getBitNumber();
34}
35
36std::string Core::get_field_name(const BitFieldId id) const {
37 auto &set = fIelds.get<BitFieldId_mi_tag>();
38 auto miit = set.find(id);
39 if (miit ==
set.
end())
40 THROW_MESSAGE(
"field not in database (top tip: check spelling)");
41 return (*miit)->getName();
42}
43
44EntityHandle Core::get_field_meshset(const BitFieldId id) const {
45 auto &set = fIelds.get<BitFieldId_mi_tag>();
46 auto miit = set.find(id);
47 if (miit ==
set.
end())
48 THROW_MESSAGE(
"field not in database (top tip: check spelling)");
49 return (*miit)->meshSet;
50}
51
52EntityHandle Core::get_field_meshset(
const std::string
name)
const {
53 return get_field_meshset(get_field_id(
name));
54}
55
56bool Core::check_field(
const std::string &
name)
const {
57 auto miit = fIelds.get<FieldName_mi_tag>().find(
name);
58 if (miit == fIelds.get<FieldName_mi_tag>().end())
59 return false;
60 else
61 return true;
62}
63
64const Field *Core::get_field_structure(
const std::string &
name,
66 auto miit = fIelds.get<FieldName_mi_tag>().find(
name);
67 if (miit == fIelds.get<FieldName_mi_tag>().end()) {
69 throw MoFEMException(
71 std::string(
"field < " +
name +
72 " > not in database (top tip: check spelling)")
73 .c_str());
74 else
75 return nullptr;
76 }
77 return miit->get();
78}
79
81 int dim,
83
85 EntityHandle meshset = get_field_meshset(
name);
86 CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents,
true);
88}
89
94 EntityHandle meshset = get_field_meshset(
name);
95 CHKERR get_moab().get_entities_by_type(meshset,
type, ents,
true);
97}
98
102 EntityHandle meshset = get_field_meshset(
name);
103 CHKERR get_moab().get_entities_by_handle(meshset, ents,
true);
105}
106
110 const FieldCoefficientsNumber nb_of_coefficients,
111 const TagType tag_type,
const enum MoFEMTypes bh,
112 int verb) {
119
120
121
122
123 auto add_meshset_to_partition = [&](auto meshset) {
125 const void *tag_vals[] = {&rAnk};
126 ParallelComm *pcomm = ParallelComm::get_pcomm(
127 &get_moab(), get_basic_entity_data_ptr()->pcommID);
128 Tag part_tag = pcomm->part_tag();
130 CHKERR get_moab().get_entities_by_type_and_tag(0, MBENTITYSET, &part_tag,
131 tag_vals, 1, tagged_sets,
132 moab::Interface::UNION);
133 for (
auto s : tagged_sets)
134 CHKERR get_moab().add_entities(
s, &meshset, 1);
136 };
137
138 auto create_tags = [&](auto meshset, auto id) {
140 CHKERR get_moab().tag_set_data(th_FieldId, &meshset, 1, &
id);
141
142 CHKERR get_moab().tag_set_data(th_FieldSpace, &meshset, 1, &space);
143
144 CHKERR get_moab().tag_set_data(th_FieldContinuity, &meshset, 1,
145 &continuity);
146
147 CHKERR get_moab().tag_set_data(th_FieldBase, &meshset, 1, &
base);
148
149
150 void const *tag_data[] = {
name.c_str()};
151 int tag_sizes[1];
152 tag_sizes[0] =
name.size();
153 CHKERR get_moab().tag_set_by_ptr(th_FieldName, &meshset, 1, tag_data,
154 tag_sizes);
155
157 int def_rank = 1;
158 const std::string tag_rank_name =
"_Field_Rank_" +
name;
159 CHKERR get_moab().tag_get_handle(tag_rank_name.c_str(), 1, MB_TYPE_INTEGER,
160 th_rank, MB_TAG_CREAT | MB_TAG_SPARSE,
161 &def_rank);
162 CHKERR get_moab().tag_set_data(th_rank, &meshset, 1, &nb_of_coefficients);
163
164 Version file_ver;
165 ierr = UnknownInterface::getFileVersion(moab, file_ver);
167 if (file_ver.majorVersion >= 0 && file_ver.minorVersion >= 12 &&
168 file_ver.buildVersion >= 1) {
169
170
171
172 const std::string name_data_prefix("_App_Data_");
173 void const *tag_prefix_data[] = {name_data_prefix.c_str()};
174 int tag_prefix_sizes[1];
175 tag_prefix_sizes[0] = name_data_prefix.size();
176 CHKERR get_moab().tag_set_by_ptr(th_FieldName_DataNamePrefix, &meshset, 1,
177 tag_prefix_data, tag_prefix_sizes);
178 Tag th_app_order, th_field_data, th_field_data_vert;
179
180
182 const std::string tag_approx_order_name =
"_App_Order_" +
name;
183 CHKERR get_moab().tag_get_handle(
184 tag_approx_order_name.c_str(), 1, MB_TYPE_INTEGER, th_app_order,
185 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
186
187
188 std::string tag_data_name = name_data_prefix +
name;
189 const int def_len = 0;
190 CHKERR get_moab().tag_get_handle(
191 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE, th_field_data,
192 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
193 std::string tag_data_name_verts = name_data_prefix +
name +
"_V";
195 def_vert_data.clear();
196 CHKERR get_moab().tag_get_handle(
197 tag_data_name_verts.c_str(), nb_of_coefficients, MB_TYPE_DOUBLE,
198 th_field_data_vert, MB_TAG_CREAT | tag_type, &*def_vert_data.begin());
199 } else {
200
201 const std::string name_data_prefix("_App_Data");
202 void const *tag_prefix_data[] = {name_data_prefix.c_str()};
203 int tag_prefix_sizes[1];
204 tag_prefix_sizes[0] = name_data_prefix.size();
205 CHKERR get_moab().tag_set_by_ptr(th_FieldName_DataNamePrefix, &meshset, 1,
206 tag_prefix_data, tag_prefix_sizes);
207 Tag th_app_order, th_field_data, th_field_data_vert;
208
209
211 const std::string tag_approx_order_name =
"_App_Order_" +
name;
212 CHKERR get_moab().tag_get_handle(
213 tag_approx_order_name.c_str(), 1, MB_TYPE_INTEGER, th_app_order,
214 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
215
216
217 std::string tag_data_name = name_data_prefix +
name;
218 const int def_len = 0;
219 CHKERR get_moab().tag_get_handle(
220 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE, th_field_data,
221 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
222 std::string tag_data_name_verts = name_data_prefix +
name +
"V";
224 def_vert_data.clear();
225 CHKERR get_moab().tag_get_handle(
226 tag_data_name_verts.c_str(), nb_of_coefficients, MB_TYPE_DOUBLE,
227 th_field_data_vert, MB_TAG_CREAT | tag_type, &*def_vert_data.begin());
228 }
229
231 };
232
233 if (verb == -1)
234 verb = verbose;
235 *buildMoFEM = 0;
236 auto fit = fIelds.get<FieldName_mi_tag>().find(
name);
237 if (fit != fIelds.get<FieldName_mi_tag>().end()) {
240 "field is <%s> in database",
name.c_str());
241
242 } else {
243
244 EntityHandle meshset;
245 CHKERR get_moab().create_meshset(MESHSET_SET, meshset);
246 CHKERR add_meshset_to_partition(meshset);
247
248
249 int field_shift = 0;
250 for (;
251 fIelds.get<BitFieldId_mi_tag>().find(
BitFieldId().
set(field_shift)) !=
252 fIelds.get<BitFieldId_mi_tag>().
end();
253 ++field_shift) {
256 "Maximal number of fields exceeded");
257 }
258
260 CHKERR create_tags(meshset,
id);
261
262 auto p = fIelds.insert(boost::make_shared<Field>(moab, meshset));
264 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Add field " << **p.first;
266 << "Field " << (*p.first)->getName() << " core value < "
267 << this->getValue() << " > field value ( "
268 << static_cast<int>((*p.first)->getBitNumber()) << " )";
269 }
270
271 if (!p.second)
273 "field not inserted %s (top tip, it could be already "
274 "there)",
275 Field(moab, meshset).getName().c_str());
276 }
277
281}
282
286 const FieldCoefficientsNumber nb_of_coefficients,
287
288 std::vector<
289
290 std::pair<EntityType,
292
293 >>
294 list_dof_side_map,
295
296 const TagType tag_type,
const enum MoFEMTypes bh,
int verb) {
299 tag_type, bh, verb);
300
301 auto fit = fIelds.get<FieldName_mi_tag>().find(
name);
302 if (fit == fIelds.get<FieldName_mi_tag>().end())
304 "field <%s> not in database",
name.c_str());
305
306 for(auto &p : list_dof_side_map) {
307 auto &data_side_map = (*fit)->getDofSideMap()[p.first];
308 CHKERR p.second(data_side_map);
309 }
310
312}
313
316 const FieldCoefficientsNumber nb_of_coefficients,
317 const TagType tag_type,
const enum MoFEMTypes bh,
318 int verb) {
320 tag_type, bh, verb);
321}
322
324 const std::string &
name,
int verb) {
325
326 *buildMoFEM = 0;
328 if (verb == -1)
329 verb = verbose;
330
334
336 idm = get_field_meshset(
name);
338 CHKERR get_moab().tag_get_data(th_FieldSpace, &idm, 1, &space);
340 CHKERR get_moab().tag_get_data(th_FieldContinuity, &idm, 1, &continuity);
341
342 switch (continuity) {
345 break;
346 default:
348 "sorry, unknown continuity added to entity");
349 }
350
351 std::vector<int> nb_ents_on_dim(3, 0);
352 switch (space) {
354 CHKERR get_moab().add_entities(idm, ents);
355 break;
357 CHKERR get_moab().add_entities(idm, ents);
359 break;
360 for (
int dd = 0;
dd != dim; ++
dd) {
362 CHKERR get_moab().get_adjacencies(ents, dd,
false, adj_ents,
363 moab::Interface::UNION);
364 if (dd == 0) {
366 CHKERR get_moab().get_connectivity(ents, topo_nodes,
true);
368 CHKERR get_moab().get_connectivity(ents, mid_nodes,
false);
369 mid_nodes = subtract(mid_nodes, topo_nodes);
370 adj_ents = subtract(adj_ents, mid_nodes);
371 }
372 CHKERR get_moab().add_entities(idm, adj_ents);
373 nb_ents_on_dim[
dd] = adj_ents.size();
374 }
375 break;
377 CHKERR get_moab().add_entities(idm, ents);
379 break;
380 for (
int dd = 1;
dd != dim; ++
dd) {
382 CHKERR get_moab().get_adjacencies(ents, dd,
false, adj_ents,
383 moab::Interface::UNION);
384 CHKERR get_moab().add_entities(idm, adj_ents);
385 nb_ents_on_dim[
dd] = adj_ents.size();
386 }
387 break;
389 CHKERR get_moab().add_entities(idm, ents);
391 break;
392 if (dim > 2) {
394 CHKERR get_moab().get_adjacencies(ents, 2,
false, adj_ents,
395 moab::Interface::UNION);
396 CHKERR get_moab().add_entities(idm, adj_ents);
397 nb_ents_on_dim[2] = adj_ents.size();
398 }
399 break;
400 default:
402 "sorry, unknown space added to entity");
403 }
404
406 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"add entities to field " <<
name;
407 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add ents " << ents.size();
408 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add faces " << nb_ents_on_dim[2];
409 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add edges " << nb_ents_on_dim[1];
410 MOFEM_LOG(
"SYNC", Sev::noisy) <<
"\tnb. add nodes " << nb_ents_on_dim[0];
411 }
413}
414
416 const std::string &
name,
417 int verb) {
419 if (verb == -1)
420 verb = verbose;
421 Range ents_dim = ents.subset_by_dimension(dim);
422 CHKERR addEntsToFieldByDim(ents_dim, dim,
name, verb);
423
427}
428
430 const EntityType
type,
431 const std::string &
name,
432 int verb) {
434 Range ents_type = ents.subset_by_type(
type);
435 if (!ents_type.empty()) {
436 const int dim = get_moab().dimension_from_handle(ents_type[0]);
437 CHKERR addEntsToFieldByDim(ents_type, dim,
name, verb);
438 }
441}
442
443MoFEMErrorCode Core::add_ents_to_field_by_dim(
const EntityHandle meshset,
444 const int dim,
445 const std::string &
name,
446 const bool recursive, int verb) {
449 CHKERR get_moab().get_entities_by_dimension(meshset, dim, ents, recursive);
450 CHKERR addEntsToFieldByDim(ents, dim,
name, verb);
453}
454
455MoFEMErrorCode Core::add_ents_to_field_by_type(
const EntityHandle meshset,
456 const EntityType
type,
457 const std::string &
name,
458 const bool recursive, int verb) {
461 CHKERR get_moab().get_entities_by_type(meshset,
type, ents, recursive);
462 if (!ents.empty()) {
463 const int dim = get_moab().dimension_from_handle(ents[0]);
464 CHKERR addEntsToFieldByDim(ents, dim,
name, verb);
465 }
468}
469
471 const double coords[],
472 int size,
int verb) {
474
476 verb = verbose;
477
479
480 auto create_vertices = [&]() {
482
483 vector<double *> arrays_coord;
484 EntityHandle startv = 0;
485 ReadUtilIface *iface;
486 CHKERR get_moab().query_interface(iface);
487 CHKERR iface->get_node_coords(3,
size, 0, startv, arrays_coord);
488 verts.insert(startv, startv +
size - 1);
489 for (
int n = 0;
n !=
size; ++
n)
490 for (
auto d : {0, 1, 2})
491 arrays_coord[
d][
n] = coords[3 *
n +
d];
492
494 };
495
496 auto add_verts_to_field = [&]() {
498 EntityHandle field_meshset = get_field_meshset(
name);
499 CHKERR get_moab().add_entities(field_meshset, verts);
501 };
502
504 CHKERR add_verts_to_field();
505
507}
508
509MoFEMErrorCode Core::setFieldOrderImpl(boost::shared_ptr<Field> field_ptr,
511 const ApproximationOrder
order,
512 int verb) {
514
516 verb = verbose;
517 *buildMoFEM = 0;
518
519 const auto field_meshset = field_ptr->getMeshset();
520 const auto bit_number = field_ptr->getBitNumber();
521
522
523 Range ents_of_id_meshset;
524 CHKERR get_moab().get_entities_by_handle(field_meshset, ents_of_id_meshset,
525 false);
526 Range field_ents = intersect(ents, ents_of_id_meshset);
529 "change nb. of ents for order in the field <%s> %zu -> %zu",
530 field_ptr->getName().c_str(), ents.size(), field_ents.size());
531 }
532
533
534 auto eiit = entsFields.get<Unique_mi_tag>().lower_bound(
535 FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
537 if (eiit != entsFields.get<Unique_mi_tag>().end()) {
538 auto hi_eiit = entsFields.get<Unique_mi_tag>().upper_bound(
539 FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
540 std::copy(eiit, hi_eiit, std::back_inserter(ents_id_view));
541 }
542
545 "current nb. of ents in the multi index field <%s> %zu",
546 field_ptr->getName().c_str(), ents_id_view.size());
547
548
549 int nb_ents_set_order_up = 0;
550 int nb_ents_set_order_down = 0;
551 int nb_ents_set_order_new = 0;
552
553 FieldEntity_change_order modify_order_no_size_change(
order,
false);
554 FieldEntity_change_order modify_order_size_change(
order,
true);
555
556 for (auto pit = field_ents.const_pair_begin();
557 pit != field_ents.const_pair_end(); pit++) {
558 EntityHandle first = pit->first;
559 EntityHandle second = pit->second;
560
562
563
564 switch (field_ptr->getSpace()) {
566 break;
568 if (
type == MBVERTEX)
570 "Hcurl space on vertices makes no sense");
571
572 break;
574 if (
type == MBVERTEX)
576 "Hdiv space on vertices makes no sense");
577
580 "Hdiv space on edges makes no sense");
581
582 break;
583 default:
584 break;
585 }
586
587
588 Range ents_in_database;
589 auto vit = ents_id_view.get<1>().lower_bound(first);
590 auto hi_vit = ents_id_view.get<1>().upper_bound(second);
592 for (; vit != hi_vit; ++vit) {
593 ents_in_database.insert(vit->get()->getEnt());
594
596 (*vit)->getMaxOrder();
597
598 if (old_approximation_order !=
order) {
599
600 FieldEntity_multiIndex::iterator miit =
601 entsFields.get<Unique_mi_tag>().find((*vit)->getLocalUniqueId());
602
603 if ((*miit)->getMaxOrder() <
order)
604 nb_ents_set_order_up++;
605 if ((*miit)->getMaxOrder() >
order)
606 nb_ents_set_order_down++;
607
608
609
610
611
612 bool can_change_size = true;
613 auto dit = dofsField.get<Unique_mi_tag>().lower_bound(
614 FieldEntity::getLoLocalEntityBitNumber(bit_number,
615 (*miit)->getEnt()));
616 if (dit != dofsField.get<Unique_mi_tag>().end()) {
617 auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(
618 FieldEntity::getHiLocalEntityBitNumber(bit_number,
619 (*miit)->getEnt()));
620
621 if (dit != hi_dit)
622 can_change_size = false;
623 for (; dit != hi_dit; dit++) {
624 if ((*dit)->getDofOrder() >
order) {
625 bool success = dofsField.modify(dofsField.project<0>(dit),
626 DofEntity_active_change(false));
627 if (!success)
629 "modification unsuccessful");
630 }
631 }
632 }
633
634 bool success =
635 entsFields.modify(entsFields.project<0>(miit),
636 can_change_size ? modify_order_size_change
637 : modify_order_no_size_change);
638 if (!success)
640 "modification unsuccessful");
641 }
642 }
643 }
644
645 Range new_ents = subtract(
Range(first, second), ents_in_database);
646 for (Range::const_pair_iterator pit = new_ents.const_pair_begin();
647 pit != new_ents.const_pair_end(); ++pit) {
648 const auto first = pit->first;
649 const auto second = pit->second;
650 const auto ent_type = get_moab().type_from_handle(first);
651
652 if (!field_ptr->getFieldOrderTable()[ent_type])
654 "Number of degrees of freedom for entity %s for %s space on "
655 "base %s can "
656 "not be deduced",
657 moab::CN::EntityTypeName(ent_type),
658 field_ptr->getSpaceName().c_str(),
659 field_ptr->getApproxBaseName().c_str());
660
661 auto get_nb_dofs_on_order = [&](
const int order) {
662 return order >= 0 ? (field_ptr->getFieldOrderTable()[ent_type])(
order)
663 : 0;
664 };
665 const int nb_dofs_on_order = get_nb_dofs_on_order(
order);
666 if (nb_dofs_on_order ||
order == -1) {
667
668 const int field_rank = field_ptr->getNbOfCoeffs();
669 const int nb_dofs = nb_dofs_on_order * field_rank;
670
671
672 auto miit_ref_ent =
673 refinedEntities.get<Ent_mi_tag>().lower_bound(first);
674
675 auto create_tags_for_max_order = [&](
const Range &ents) {
678 std::vector<ApproximationOrder> o_vec(ents.size(),
order);
679 CHKERR get_moab().tag_set_data(field_ptr->th_AppOrder, ents,
680 &*o_vec.begin());
681 }
683 };
684
685 auto create_tags_for_data = [&](
const Range &ents) {
688
689 if (nb_dofs > 0) {
690 if (ent_type == MBVERTEX) {
691 std::vector<FieldData> d_vec(nb_dofs * ents.size(), 0);
692 CHKERR get_moab().tag_set_data(field_ptr->th_FieldDataVerts,
693 ents, &*d_vec.begin());
694 } else {
695 std::vector<int> tag_size(ents.size(), nb_dofs);
696 std::vector<FieldData> d_vec(nb_dofs, 0);
697 std::vector<void const *> d_vec_ptr(ents.size(),
698 &*d_vec.begin());
699 CHKERR get_moab().tag_set_by_ptr(field_ptr->th_FieldData, ents,
700 &*d_vec_ptr.begin(),
701 &*tag_size.begin());
702 }
703 }
704 }
705
707 };
708
709 auto get_ents_in_ref_ent = [&](auto miit_ref_ent) {
710 auto hi = refinedEntities.get<Ent_mi_tag>().upper_bound(second);
712 for (; miit_ref_ent != hi; ++miit_ref_ent)
713 in.insert(miit_ref_ent->get()->getEnt());
714 return in;
715 };
716
717 auto get_ents_max_order = [&](
const Range &ents) {
718 boost::shared_ptr<std::vector<const void *>> vec(
719 new std::vector<const void *>());
720 vec->resize(ents.size());
721 CHKERR get_moab().tag_get_by_ptr(field_ptr->th_AppOrder, ents,
722 &*vec->begin());
723 return vec;
724 };
725
726 auto get_ents_field_data_vector_adaptor =
727 [&](
const Range &ents,
728 boost::shared_ptr<std::vector<const void *>> &ents_max_orders) {
729
730 boost::shared_ptr<std::vector<double *>> vec(
731 new std::vector<double *>());
732 vec->reserve(ents.size());
733
734 if (
order >= 0 && nb_dofs == 0) {
735
736 for (
int i = 0;
i != ents.size(); ++
i)
737 vec->emplace_back(nullptr);
738 } else {
739 moab::ErrorCode rval;
740 std::vector<int> tag_size(ents.size());
741 std::vector<const void *> d_vec_ptr(ents.size());
742
743
744 if (ent_type == MBVERTEX)
745 rval = get_moab().tag_get_by_ptr(field_ptr->th_FieldDataVerts,
746 ents, &*d_vec_ptr.begin(),
747 &*tag_size.begin());
748 else
749 rval = get_moab().tag_get_by_ptr(field_ptr->th_FieldData,
750 ents, &*d_vec_ptr.begin(),
751 &*tag_size.begin());
752
753 auto cast = [](auto p) {
756 };
757
758
759 if (rval == MB_SUCCESS) {
760
761 auto tit = d_vec_ptr.begin();
762 auto oit = ents_max_orders->begin();
763 for (auto sit = tag_size.begin(); sit != tag_size.end();
764 ++sit, ++tit, ++oit)
765 vec->emplace_back(cast(*tit));
766
767 } else {
768
769 for (
int i = 0;
i != ents.size(); ++
i)
770 vec->emplace_back(nullptr);
771
772
773
774
775 auto oit = ents_max_orders->begin();
776 auto dit = vec->begin();
777 for (auto eit = ents.begin(); eit != ents.end();
778 ++eit, ++oit, ++dit) {
779
780 const int ent_order =
782 const int ent_nb_dofs = get_nb_dofs_on_order(ent_order);
783
784 if (ent_nb_dofs) {
785 int tag_size;
786 const void *ret_val;
787 if (ent_type == MBVERTEX) {
788 rval = get_moab().tag_get_by_ptr(
789 field_ptr->th_FieldDataVerts, &*eit, 1, &ret_val,
790 &tag_size);
791 } else {
792 rval = get_moab().tag_get_by_ptr(
793 field_ptr->th_FieldData, &*eit, 1, &ret_val,
794 &tag_size);
795 if (rval != MB_SUCCESS) {
796
797 const int set_tag_size[] = {ent_nb_dofs * field_rank};
798 std::array<FieldData, MAX_DOFS_ON_ENTITY> set_d_vec;
799 std::fill(set_d_vec.begin(),
800 &set_d_vec[set_tag_size[0]], 0);
801 const void *set_d_vec_ptr[] = {set_d_vec.data()};
802 CHKERR get_moab().tag_set_by_ptr(
803 field_ptr->th_FieldData, &*eit, 1, set_d_vec_ptr,
804 set_tag_size);
805 rval = get_moab().tag_get_by_ptr(
806 field_ptr->th_FieldData, &*eit, 1, &ret_val,
807 &tag_size);
808
809 if (rval != MB_SUCCESS) {
811 LogManager::BitLineID |
812 LogManager::BitScope);
814 << "Error is triggered in MOAB, field tag data "
815 "for same reason can not be for accessed.";
817 <<
"Set order: " <<
order;
819 << "Nb. dofs on entity for given order: "
820 << set_tag_size[0];
822 << "Entity type: "
823 << moab::CN::EntityTypeName(ent_type);
825 << "Field: " << *field_ptr;
827 }
828 }
829 }
830 const_cast<FieldData *&
>(*dit) = cast(ret_val);
831 }
832 }
833 }
834 }
835 return vec;
836 };
837
838 auto ents_in_ref_ent = get_ents_in_ref_ent(miit_ref_ent);
839
840 CHKERR create_tags_for_max_order(ents_in_ref_ent);
841 CHKERR create_tags_for_data(ents_in_ref_ent);
842 auto ents_max_order = get_ents_max_order(ents_in_ref_ent);
843 auto ent_field_data =
844 get_ents_field_data_vector_adaptor(ents_in_ref_ent, ents_max_order);
845
846
847 auto ents_array = boost::make_shared<std::vector<FieldEntity>>();
848
849
850
851
852 ents_array->reserve(second - first + 1);
853 auto vit_max_order = ents_max_order->begin();
854 auto vit_field_data = ent_field_data->begin();
855 for (
int i = 0;
i != ents_in_ref_ent.size(); ++
i) {
856
857 ents_array->emplace_back(
858 field_ptr, *miit_ref_ent,
859 boost::shared_ptr<double *const>(ent_field_data,
860 &*vit_field_data),
861 boost::shared_ptr<const int>(
862 ents_max_order, static_cast<const int *>(*vit_max_order)));
863 ++vit_max_order;
864 ++vit_field_data;
865 ++miit_ref_ent;
866 }
867 if (!ents_array->empty())
868 if ((*ents_array)[0].getFieldRawPtr() != field_ptr.get())
870 "Get field ent poiter and field pointer do not match for "
871 "field %s",
872 field_ptr->getName().c_str());
873 nb_ents_set_order_new += ents_array->size();
874
875
876
877 if (ents_in_ref_ent.size() < (second - first + 1)) {
878 Range ents_not_in_database =
879 subtract(
Range(first, second), ents_in_ref_ent);
880 std::vector<const void *> vec_bits(ents_not_in_database.size());
881 CHKERR get_moab().tag_get_by_ptr(
882 get_basic_entity_data_ptr()->th_RefBitLevel, ents_not_in_database,
883 &*vec_bits.begin());
884 auto cast = [](auto p) {
886 };
887 for (
auto v : vec_bits)
890 "Try to add entities which are not seeded or added to "
891 "database");
892 }
893
894
895
896 const auto hint = ents_array->empty()
897 ? entsFields.end()
898 : entsFields.upper_bound(
899 ents_array->back().getLocalUniqueId());
900 for (
auto &
v : *ents_array)
901 entsFields.emplace_hint(hint, ents_array, &
v);
902 }
903 }
904 }
905
908 "nb. of entities in field <%s> for which order was "
909 "increased %d (order %d)",
910 field_ptr->getName().c_str(), nb_ents_set_order_up,
order);
912 "nb. of entities in field <%s> for which order was "
913 "reduced %d (order %d)",
914 field_ptr->getName().c_str(), nb_ents_set_order_down,
order);
916 "SYNC", Sev::noisy,
917 "nb. of entities in field <%s> for which order set %d (order %d)",
918 field_ptr->getName().c_str(), nb_ents_set_order_new,
order);
919 }
920
922 auto eiit = entsFields.get<Unique_mi_tag>().lower_bound(
923 FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
924 auto hi_eiit = entsFields.get<Unique_mi_tag>().upper_bound(
925 FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
927 "nb. of ents in the multi index field <%s> %d",
928 field_ptr->getName().c_str(), std::distance(eiit, hi_eiit));
929 }
930
933
935}
936
938 const ApproximationOrder
order,
int verb) {
945
946
947 auto field_it = fIelds.get<BitFieldId_mi_tag>().find(
id);
948 if (field_it == fIelds.get<BitFieldId_mi_tag>().end())
950
952 << "Field " << (*field_it)->getName() << " core value < "
953 << this->getValue() << " > field value ( "
954 << static_cast<int>((*field_it)->getBitNumber()) << " )"
955 << " nb. of ents " << ents.size();
956
957 CHKERR this->setFieldOrderImpl(*field_it, ents,
order, verb);
958
960}
961
963 const EntityType
type,
const BitFieldId
id,
964 const ApproximationOrder
order,
int verb) {
966 if (verb == -1)
967 verb = verbose;
968 *buildMoFEM = 0;
970 CHKERR get_moab().get_entities_by_type(meshset,
type, ents);
971 CHKERR this->set_field_order(ents,
id,
order, verb);
973}
975 const EntityType
type,
976 const std::string &
name,
977 const ApproximationOrder
order,
int verb) {
979 if (verb == -1)
980 verb = verbose;
981 *buildMoFEM = 0;
984}
986 const ApproximationOrder
order,
int verb) {
988 if (verb == -1)
989 verb = verbose;
990 *buildMoFEM = 0;
993}
995 const BitRefLevel &
bit,
const BitRefLevel &mask,
const EntityType
type,
996 const BitFieldId
id,
const ApproximationOrder
order,
int verb) {
998 if (verb == -1)
999 verb = verbose;
1000 *buildMoFEM = 0;
1002 CHKERR BitRefManager(*this).getEntitiesByTypeAndRefLevel(
bit, mask,
type,
1003 ents, verb);
1004 CHKERR this->set_field_order(ents,
id,
order, verb);
1006}
1007
1009 const BitRefLevel &
bit,
const BitRefLevel &mask,
const EntityType
type,
1010 const std::string &
name,
const ApproximationOrder
order,
int verb) {
1012 if (verb == -1)
1013 verb = verbose;
1014 *buildMoFEM = 0;
1016 CHKERR BitRefManager(*this).getEntitiesByTypeAndRefLevel(
bit, mask,
type,
1017 ents, verb);
1020}
1021
1023Core::buildFieldForNoFieldImpl(boost::shared_ptr<Field> field_ptr,
1024 std::map<EntityType, int> &dof_counter,
1025 int verb) {
1027
1028 const auto bit_number = field_ptr->getBitNumber();
1029
1030
1032 CHKERR get_moab().get_entities_by_handle(field_ptr->getMeshset(), ents,
1033 false);
1035 MOFEM_LOG_C(
"SYNC", Sev::noisy,
"Ents in field %s meshset %zu\n",
1036 field_ptr->getName().c_str(), ents.size());
1037
1038
1039 auto eiit = entsFields.get<Unique_mi_tag>().lower_bound(
1040 FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
1042 if (eiit != entsFields.get<Unique_mi_tag>().end()) {
1043 auto hi_eiit = entsFields.get<Unique_mi_tag>().upper_bound(
1044 FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
1045 std::copy(eiit, hi_eiit, std::back_inserter(ents_id_view));
1046 }
1047
1048 boost::shared_ptr<const int> zero_order(new const int(0));
1049
1050 for (auto ent : ents) {
1051
1052 auto ref_ent_it = refinedEntities.get<Ent_mi_tag>().find(ent);
1053 if (ref_ent_it == refinedEntities.get<Ent_mi_tag>().end())
1055 "Entity is not in MoFEM database, entities in field meshset need "
1056 "to be seeded (i.e. bit ref level add to them)");
1057
1058 auto add_dofs = [&](auto field_eit) {
1060
1061 for (FieldCoefficientsNumber rank = 0; rank < field_ptr->getNbOfCoeffs();
1062 rank++) {
1063
1064 auto p = dofsField.insert(
1065 boost::make_shared<DofEntity>(field_eit, 0, rank, rank));
1066 if (p.second) {
1067 dof_counter[MBENTITYSET]++;
1068 } else
1070 "Dof expected to be created");
1071 }
1073 };
1074
1075
1076 auto field_ent_it = ents_id_view.get<1>().find(ent);
1077 if (field_ent_it == ents_id_view.get<1>().end()) {
1078
1079 auto p = entsFields.insert(
1080
1081 boost::make_shared<FieldEntity>(
1082 field_ptr, *ref_ent_it,
1083 FieldEntity::makeSharedFieldDataAdaptorPtr(field_ptr,
1084 *ref_ent_it),
1085 boost::shared_ptr<const int>(zero_order, zero_order.get()))
1086
1087 );
1088
1089 if ((*p.first)->getFieldRawPtr() != field_ptr.get())
1091 "Get field ent poiter and field pointer do not match for "
1092 "field %s",
1093 field_ptr->getName().c_str());
1094
1095 if (!p.second)
1097 "Entity should be created");
1098
1099 CHKERR add_dofs(*(p.first));
1100
1101 } else {
1102
1103
1104
1105 auto dit = dofsField.get<Unique_mi_tag>().lower_bound(
1106 FieldEntity::getLoLocalEntityBitNumber(bit_number, ent));
1107 auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(
1108 FieldEntity::getHiLocalEntityBitNumber(bit_number, ent));
1109 dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1110 CHKERR add_dofs(*field_ent_it);
1111 }
1112 }
1113
1115 auto lo_dof = dofsField.get<Unique_mi_tag>().lower_bound(
1116 FieldEntity::getLoBitNumberUId(field_ptr->getBitNumber()));
1117 auto hi_dof = dofsField.get<Unique_mi_tag>().upper_bound(
1118 FieldEntity::getHiBitNumberUId(field_ptr->getBitNumber()));
1119 for (; lo_dof != hi_dof; lo_dof++)
1120 MOFEM_LOG(
"SYNC", Sev::noisy) << **lo_dof;
1122 }
1123
1125}
1126
1128Core::buildFieldForNoField(const BitFieldId id,
1129 std::map<EntityType, int> &dof_counter, int verb) {
1131
1132 if (verb == -1)
1133 verb = verbose;
1134
1135
1136 auto field_it = fIelds.get<BitFieldId_mi_tag>().find(
id);
1137 if (field_it == fIelds.get<BitFieldId_mi_tag>().end())
1139
1142 << "Field " << (*field_it)->getName() << " core value < "
1143 << this->getValue() << " > field value () "
1144 << (*field_it)->getBitNumber() << " )";
1145
1146 CHKERR this->buildFieldForNoFieldImpl(*field_it, dof_counter, verb);
1147
1149}
1150
1152 const BitFieldId id, std::map<EntityType, int> &dof_counter,
1153 std::map<EntityType, int> &inactive_dof_counter,
const Range *ents_ptr,
1154 int verb) {
1156 if (verb == -1)
1157 verb = verbose;
1158
1159
1160 auto &set_id = fIelds.get<BitFieldId_mi_tag>();
1162 if (field_it == set_id.end()) {
1164 }
1165 const int bit_number =
field_it->get()->getBitNumber();
1166 const int rank =
field_it->get()->getNbOfCoeffs();
1167
1168
1169 Range ents_of_id_meshset;
1170 CHKERR get_moab().get_entities_by_handle((*field_it)->meshSet,
1171 ents_of_id_meshset, false);
1172
1173
1174 if (ents_ptr)
1175 ents_of_id_meshset = intersect(ents_of_id_meshset, *ents_ptr);
1177 MOFEM_LOG_C(
"SYNC", Sev::noisy,
"Ents in field %s meshset %zu",
1178 (*field_it)->getName().c_str(), ents_of_id_meshset.size());
1179 }
1180
1181 for (auto p_eit = ents_of_id_meshset.pair_begin();
1182 p_eit != ents_of_id_meshset.pair_end(); ++p_eit) {
1183
1184 const EntityHandle first = p_eit->first;
1185 const EntityHandle second = p_eit->second;
1186 const auto lo_uid =
1187 FieldEntity::getLoLocalEntityBitNumber(bit_number, first);
1188 const auto hi_uid =
1189 FieldEntity::getHiLocalEntityBitNumber(bit_number, second);
1190
1191 auto feit = entsFields.get<Unique_mi_tag>().lower_bound(lo_uid);
1192 if (feit == entsFields.get<Unique_mi_tag>().end())
1193 continue;
1194 auto hi_feit = entsFields.get<Unique_mi_tag>().upper_bound(hi_uid);
1195
1196
1197
1198 auto dit = dofsField.get<Unique_mi_tag>().lower_bound(lo_uid);
1199 auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(hi_uid);
1200 dofsField.get<Unique_mi_tag>().erase(dit, hi_dit);
1201
1202
1203 boost::shared_ptr<std::vector<DofEntity>> dofs_array =
1204 boost::make_shared<std::vector<DofEntity>>(std::vector<DofEntity>());
1205
1206 int nb_dofs_on_ents = 0;
1207 for (auto tmp_feit = feit; tmp_feit != hi_feit; ++tmp_feit) {
1208 nb_dofs_on_ents += rank * tmp_feit->get()->getOrderNbDofs(
1209 tmp_feit->get()->getMaxOrder());
1210 }
1211
1212
1213 dofs_array->reserve(nb_dofs_on_ents);
1214
1215
1216 for (; feit != hi_feit; ++feit) {
1217
1218 int DD = 0;
1219
1220 for (int oo = 0; oo <= feit->get()->getMaxOrder(); ++oo) {
1221
1222 for (
int dd = 0;
dd < feit->get()->getOrderNbDofsDiff(oo); ++
dd) {
1223
1224 for (int rr = 0; rr < rank; ++rr, ++DD) {
1225 dofs_array->emplace_back(*feit, oo, rr, DD);
1226 ++dof_counter[feit->get()->getEntType()];
1227 }
1228 }
1229 }
1230 if (DD > feit->get()->getNbDofsOnEnt()) {
1231 std::ostringstream ss;
1232 ss << "rank " << rAnk << " ";
1233 ss << **feit << std::endl;
1235 "Expected number of DOFs on entity not equal to number added "
1236 "to database (DD = %d != %d = "
1237 "feit->get()->getNbDofsOnEnt())\n"
1238 "%s",
1239 DD, feit->get()->getNbDofsOnEnt(), ss.str().c_str());
1240 }
1241 }
1242
1243
1244 int dofs_field_size0 = dofsField.size();
1245
1246 const auto hint = hi_dit;
1247 for (
auto &
v : *dofs_array)
1248 dofsField.emplace_hint(hint, dofs_array, &
v);
1249
1250
1251 field_it->get()->getDofSequenceContainer().push_back(dofs_array);
1252
1253
1254 if (PetscUnlikely(static_cast<int>(dofs_array.use_count()) !=
1255 static_cast<int>(dofs_array->size() + 1))) {
1257 "Wrong use count %ld != %zu", dofs_array.use_count(),
1258 dofs_array->size() + 1);
1259 }
1260 if (dofs_field_size0 + dofs_array->size() != dofsField.size()) {
1262 "Wrong number of inserted DOFs %zu != %zu", dofs_array->size(),
1263 dofsField.size() - dofs_field_size0);
1264 }
1265 }
1267}
1268
1270 const Range *ents_ptr,
int verb) {
1272 if (verb == -1)
1273 verb = verbose;
1275 MOFEM_LOG(
"SYNC", Sev::verbose) <<
"Build field " <<
field->getName();
1276
1277 std::map<EntityType, int> dof_counter;
1278 std::map<EntityType, int> inactive_dof_counter;
1279
1280
1281
1284
1285 switch (
field->getSpace()) {
1287 CHKERR this->buildFieldForNoField(
field->getId(), dof_counter, verb);
1288 break;
1293 CHKERR this->buildFieldForL2H1HcurlHdiv(
field->getId(), dof_counter,
1294 inactive_dof_counter, ents_ptr,
1295 verb);
1296 break;
1297 default:
1299 }
1300
1302 int nb_added_dofs = 0;
1303 int nb_inactive_added_dofs = 0;
1304 for (
auto const &
it : dof_counter) {
1306 <<
"Nb. of dofs (" << moab::CN::EntityTypeName(
it.first) <<
") "
1307 <<
it.second <<
" (inactive " << inactive_dof_counter[
it.first]
1308 << ")";
1309 nb_added_dofs +=
it.second;
1310 nb_inactive_added_dofs += inactive_dof_counter[
it.first];
1311 }
1313 << "Nb. added dofs " << nb_added_dofs << " (number of inactive dofs "
1314 << nb_inactive_added_dofs << " )";
1315 }
1317}
1318
1322 if (field_it == fIelds.get<FieldName_mi_tag>().end())
1325
1326 CHKERR this->buildField(*field_it,
nullptr, verb);
1330}
1331
1333 const Range &ents,
int verb) {
1336 if (field_it == fIelds.get<FieldName_mi_tag>().end())
1339
1340 CHKERR this->buildField(*field_it, &ents, verb);
1344}
1345
1348 if (verb == -1)
1349 verb = verbose;
1350
1351 for (
auto field : fIelds.get<BitFieldId_mi_tag>())
1353
1354 *buildMoFEM = 1 << 0;
1356 MOFEM_LOG(
"SYNC", Sev::verbose) <<
"Number of dofs " << dofsField.size();
1358 }
1360}
1361
1364 if (verb == -1)
1365 verb = verbose;
1366
1367 for (
auto field : fIelds.get<BitFieldId_mi_tag>())
1369
1370 *buildMoFEM = 1 << 0;
1372 MOFEM_LOG(
"SYNC", Sev::verbose) <<
"Number of dofs " << dofsField.size();
1374 }
1375
1377}
1378
1380Core::list_dofs_by_field_name(
const std::string &
field_name)
const {
1382 auto dit = dofsField.get<Unique_mi_tag>().lower_bound(
1383 FieldEntity::getLoBitNumberUId(get_field_bit_number((
field_name))));
1384 auto hi_dit = dofsField.get<Unique_mi_tag>().upper_bound(
1385 FieldEntity::getHiBitNumberUId(get_field_bit_number(
field_name)));
1386 MOFEM_LOG(
"SYNC", Sev::inform) <<
"List DOFs:";
1387 for (; dit != hi_dit; dit++)
1389
1392}
1393
1396 MOFEM_LOG(
"SYNC", Sev::inform) <<
"List Fields:";
1397 for (auto &miit : fIelds.get<BitFieldId_mi_tag>())
1399
1402}
1403
1404FieldEntityByUId::iterator
1405Core::get_ent_field_by_name_begin(
const std::string &
field_name)
const {
1406 return entsFields.get<Unique_mi_tag>().lower_bound(
1407 FieldEntity::getLoBitNumberUId(get_field_bit_number(
field_name)));
1408}
1409FieldEntityByUId::iterator
1410Core::get_ent_field_by_name_end(
const std::string &
field_name)
const {
1411 return entsFields.get<Unique_mi_tag>().upper_bound(
1412 FieldEntity::getHiBitNumberUId(get_field_bit_number(
field_name)));
1413}
1414DofEntityByUId::iterator
1415Core::get_dofs_by_name_begin(
const std::string &
field_name)
const {
1416 return dofsField.get<Unique_mi_tag>().lower_bound(
1417 FieldEntity::getLoBitNumberUId(get_field_bit_number(
field_name)));
1418}
1419DofEntityByUId::iterator
1420Core::get_dofs_by_name_end(
const std::string &
field_name)
const {
1421 return dofsField.get<Unique_mi_tag>().upper_bound(
1422 FieldEntity::getHiBitNumberUId(get_field_bit_number(
field_name)));
1423}
1424DofEntityByUId::iterator
1425Core::get_dofs_by_name_and_ent_begin(
const std::string &
field_name,
1426 const EntityHandle ent) const {
1427 return dofsField.get<Unique_mi_tag>().lower_bound(
1428 FieldEntity::getLoLocalEntityBitNumber(get_field_bit_number(
field_name),
1429 ent));
1430}
1431DofEntityByUId::iterator
1432Core::get_dofs_by_name_and_ent_end(
const std::string &
field_name,
1433 const EntityHandle ent) const {
1434 return dofsField.get<Unique_mi_tag>().upper_bound(
1435 FieldEntity::getHiLocalEntityBitNumber(get_field_bit_number(
field_name),
1436 ent));
1437}
1438DofEntityByUId::iterator
1439Core::get_dofs_by_name_and_type_begin(
const std::string &
field_name,
1440 const EntityType
type)
const {
1441 return dofsField.get<Unique_mi_tag>().lower_bound(
1442 FieldEntity::getLoLocalEntityBitNumber(get_field_bit_number(
field_name),
1444}
1445DofEntityByUId::iterator
1446Core::get_dofs_by_name_and_type_end(
const std::string &
field_name,
1447 const EntityType
type)
const {
1448 return dofsField.get<Unique_mi_tag>().upper_bound(
1449 FieldEntity::getHiLocalEntityBitNumber(get_field_bit_number(
field_name),
1451}
1453Core::check_number_of_ents_in_ents_field(
const std::string &
name)
const {
1455 auto it = fIelds.get<FieldName_mi_tag>().find(
name);
1456 if (
it == fIelds.get<FieldName_mi_tag>().end()) {
1458 "field not found < %s >",
name.c_str());
1459 }
1460 EntityHandle meshset = (*it)->getMeshset();
1461 int num_entities;
1462 CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1463
1464 auto count_field_ents = [&]() {
1465 auto bit_number = (*it)->getBitNumber();
1466 auto low_eit = entsFields.get<Unique_mi_tag>().lower_bound(
1467 FieldEntity::getLoBitNumberUId(bit_number));
1468 auto hi_eit = entsFields.get<Unique_mi_tag>().upper_bound(
1469 FieldEntity::getHiBitNumberUId(bit_number));
1470 return std::distance(low_eit, hi_eit);
1471 };
1472
1473 if (count_field_ents() > (unsigned int)num_entities) {
1475 "not equal number of entities in meshset and field multiindex "
1476 "< %s >",
1478 }
1480}
1483 for (
auto &
it : fIelds.get<FieldName_mi_tag>()) {
1485 continue;
1486
1487 EntityHandle meshset =
it->getMeshset();
1488 int num_entities;
1489 CHKERR get_moab().get_number_entities_by_handle(meshset, num_entities);
1490
1491 auto count_field_ents = [&]() {
1492 auto bit_number =
it->getBitNumber();
1493 auto low_eit = entsFields.get<Unique_mi_tag>().lower_bound(
1494 FieldEntity::getLoBitNumberUId(bit_number));
1495 auto hi_eit = entsFields.get<Unique_mi_tag>().upper_bound(
1496 FieldEntity::getHiBitNumberUId(bit_number));
1497 return std::distance(low_eit, hi_eit);
1498 };
1499
1500 if (count_field_ents() > (unsigned int)num_entities) {
1502 "not equal number of entities in meshset and field "
1503 "multiindex < %s >",
1504 it->getName().c_str());
1505 }
1506 }
1508}
1509
1510}
#define FieldCoreFunctionBegin
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
#define MOFEM_LOG_C(channel, severity, format,...)
static PetscErrorCode ierr
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
FieldApproximationBase
approximation base
@ USER_BASE
user implemented approximation base
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FieldSpace
approximation spaces
@ L2
field with C-1 continuity
@ NOFIELD
scalar or vector of scalars describe (no true field)
@ HCURL
field with continuous tangents
@ HDIV
field with continuous normal traction
FieldContinuity
Field continuity.
@ CONTINUOUS
Regular field.
@ DISCONTINUOUS
Broken continuity (No effect on L2 space)
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define BITFEID_SIZE
max number of finite elements
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
#define MOFEM_LOG_ATTRIBUTES(channel, bit)
Add attributes to channel.
#define MOFEM_LOG_FUNCTION()
Set scope.
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
double FieldData
Field data type.
int ApproximationOrder
Approximation on the entity.
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
UBlasVector< double > VectorDouble
char FieldBitNumber
Field bit number.
multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< sequenced<>, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityHandle, &FieldEntity::getEnt > > > > FieldEntity_multiIndex_ent_view
EntityHandle get_id_for_max_type()
EntityHandle get_id_for_min_type()
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
MoFEM::LogManager::SeverityLevel Sev
const EntityHandle no_handle
No entity handle is indicated by zero handle, i.e. root meshset.
constexpr auto field_name