19 if (
auto a_ptr =
a.lock()) {
20 if (a_ptr->getLocalUniqueId() < b)
30 if (
auto a_ptr =
a.lock()) {
31 if (b < a_ptr->getLocalUniqueId())
43 mField(m_field), getRuleHook(0), setRuleHook(0),
61 dataOnElement[
HCURL]),
67 dataNoField(*dataOnElement[
NOFIELD].get()),
68 dataH1(*dataOnElement[
H1].get()), dataHcurl(*dataOnElement[
HCURL].get()),
69 dataHdiv(*dataOnElement[
HDIV].get()), dataL2(*dataOnElement[
L2].get()),
70 lastEvaluatedElementEntityType(MBMAXTYPE), sidePtrFE(nullptr),
71 refinePtrFE(nullptr) {
85 const EntityType type,
86 boost::ptr_vector<EntitiesFieldData::EntData> &data)
const {
91 if (sit != side_table.end()) {
93 for (; sit != hi_sit; ++sit) {
94 if (
const auto side_number = (*sit)->side_number; side_number >= 0) {
95 const int brother_side_number = (*sit)->brother_side_number;
96 const int sense = (*sit)->sense;
98 data[side_number].getSense() = sense;
99 if (brother_side_number != -1)
100 data[brother_side_number].getSense() = sense;
109template <
typename ENTMULTIINDEX>
112 for (
auto ent_field_weak_ptr : multi_index)
113 if (
auto e = ent_field_weak_ptr.lock()) {
114 const int order = e->getMaxOrder();
115 max_order = (max_order <
order) ?
order : max_order;
123 if (
auto ptr = e.lock()) {
124 const int order = ptr->getMaxOrder();
125 max_order = (max_order <
order) ?
order : max_order;
140 const EntityType type,
const FieldSpace space,
141 boost::ptr_vector<EntitiesFieldData::EntData> &data)
const {
144 auto set_order = [&]() {
148 for (
unsigned int s = 0; s != data.size(); ++s)
149 data[s].getOrder() = 0;
154 r.first != r.second; ++r.first) {
156 const auto field_bit_number = (*r.first)->getBitNumber();
159 auto lo = std::lower_bound(data_field_ent.begin(), data_field_ent.end(),
161 if (lo != data_field_ent.end()) {
165 std::upper_bound(lo, data_field_ent.end(), hi_uid,
cmp_uid_hi);
166 for (; lo != hi; ++lo) {
168 if (
auto ptr = lo->lock()) {
171 auto sit = side_table.find(e.getEnt());
172 if (sit != side_table.end()) {
174 if (
const auto side_number = side->side_number;
177 auto &dat = data[side_number];
179 dat.getOrder() > ent_order ? dat.getOrder() : ent_order;
183 "Entity on side of the element not found");
192 auto set_order_on_brother = [&]() {
197 if (sit != side_table.end()) {
199 for (; sit != hi_sit; ++sit) {
200 const int brother_side_number = (*sit)->brother_side_number;
201 if (brother_side_number != -1) {
202 const int side_number = (*sit)->side_number;
203 data[brother_side_number].getOrder() = data[side_number].getOrder();
211 CHKERR set_order_on_brother();
218template <
typename EXTRACTOR>
222 EXTRACTOR &&extractor)
const {
230 if ((*field_it)->getBitNumber() != bit_number)
235 auto lo = std::lower_bound(ents_field.begin(), ents_field.end(), lo_uid,
237 if (lo != ents_field.end()) {
240 auto hi = std::upper_bound(lo, ents_field.end(), hi_uid,
cmp_uid_hi);
243 const int nb_dofs_on_vert = (*field_it)->getNbOfCoeffs();
244 const int max_nb_dofs = nb_dofs_on_vert * num_nodes;
247 for (
auto it = lo; it != hi; ++it) {
248 if (
auto e = it->lock()) {
249 if (
auto cache = extractor(e).lock()) {
250 if (cache->loHi[0] != cache->loHi[1]) {
251 nb_dofs += std::distance(cache->loHi[0], cache->loHi[1]);
259 nodes_indices.resize(max_nb_dofs,
false);
260 local_nodes_indices.resize(max_nb_dofs,
false);
262 nodes_indices.resize(0,
false);
263 local_nodes_indices.resize(0,
false);
266 if (nb_dofs != max_nb_dofs) {
267 std::fill(nodes_indices.begin(), nodes_indices.end(), -1);
268 std::fill(local_nodes_indices.begin(), local_nodes_indices.end(), -1);
271 for (
auto it = lo; it != hi; ++it) {
272 if (
auto e = it->lock()) {
273 auto side_ptr = e->getSideNumberPtr();
274 if (
const auto side_number = side_ptr->side_number;
276 const auto brother_side_number = side_ptr->brother_side_number;
277 if (
auto cache = extractor(e).lock()) {
278 for (
auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit) {
280 const int idx = dof.getPetscGlobalDofIdx();
281 const int local_idx = dof.getPetscLocalDofIdx();
283 side_number * nb_dofs_on_vert + dof.getDofCoeffIdx();
284 nodes_indices[pos] = idx;
285 local_nodes_indices[pos] = local_idx;
286 if (brother_side_number != -1) {
287 const int elem_idx = brother_side_number * nb_dofs_on_vert +
288 (*dit)->getDofCoeffIdx();
289 nodes_indices[elem_idx] = idx;
290 local_nodes_indices[elem_idx] = local_idx;
298 nodes_indices.resize(0,
false);
299 local_nodes_indices.resize(0,
false);
303 nodes_indices.resize(0,
false);
304 local_nodes_indices.resize(0,
false);
312 const int bit_number)
const {
315 boost::weak_ptr<EntityCacheNumeredDofs>
316 operator()(boost::shared_ptr<FieldEntity> &e) {
317 return e->entityCacheRowDofs;
329 const int bit_number)
const {
332 boost::weak_ptr<EntityCacheNumeredDofs>
333 operator()(boost::shared_ptr<FieldEntity> &e) {
334 return e->entityCacheColDofs;
344template <
typename EXTRACTOR>
348 const EntityType type_hi, EXTRACTOR &&extractor)
const {
351 for (EntityType
t = type_lo;
t != type_hi; ++
t) {
353 dat.getIndices().resize(0,
false);
354 dat.getLocalIndices().resize(0,
false);
360 auto lo = std::lower_bound(ents_field.begin(), ents_field.end(), lo_uid,
362 if (lo != ents_field.end()) {
365 auto hi = std::upper_bound(lo, ents_field.end(), hi_uid,
cmp_uid_hi);
368 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
370 for (
auto it = lo; it != hi; ++it)
371 if (
auto e = it->lock()) {
373 const EntityType type = e->getEntType();
374 auto side_ptr = e->getSideNumberPtr();
375 if (
const auto side = side_ptr->side_number; side >= 0) {
376 const auto nb_dofs_on_ent = e->getNbDofsOnEnt();
377 const auto brother_side = side_ptr->brother_side_number;
379 auto &ent_field_indices = dat.getIndices();
380 auto &ent_field_local_indices = dat.getLocalIndices();
382 ent_field_indices.resize(nb_dofs_on_ent,
false);
383 ent_field_local_indices.resize(nb_dofs_on_ent,
false);
384 std::fill(ent_field_indices.data().begin(),
385 ent_field_indices.data().end(), -1);
386 std::fill(ent_field_local_indices.data().begin(),
387 ent_field_local_indices.data().end(), -1);
389 if (
auto cache = extractor(e).lock()) {
390 for (
auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit) {
391 const int idx = (*dit)->getEntDofIdx();
392 ent_field_indices[idx] = (*dit)->getPetscGlobalDofIdx();
393 ent_field_local_indices[idx] = (*dit)->getPetscLocalDofIdx();
397 if (brother_side != -1) {
399 dat_brother.getIndices().resize(nb_dofs_on_ent,
false);
400 dat_brother.getLocalIndices().resize(nb_dofs_on_ent,
false);
401 noalias(dat_brother.getIndices()) = dat.getIndices();
402 noalias(dat_brother.getLocalIndices()) = dat.getLocalIndices();
414 const EntityType type_hi)
const {
417 boost::weak_ptr<EntityCacheNumeredDofs>
418 operator()(boost::shared_ptr<FieldEntity> &e) {
419 return e->entityCacheRowDofs;
429 const EntityType type_hi)
const {
432 boost::weak_ptr<EntityCacheNumeredDofs>
433 operator()(boost::shared_ptr<FieldEntity> &e) {
434 return e->entityCacheColDofs;
453 nodes_indices.resize(field_struture->
getNbOfCoeffs() * num_nodes,
false);
454 std::fill(nodes_indices.begin(), nodes_indices.end(), -1);
458 auto siit = side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 0));
460 side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 10000));
463 for (; siit != hi_siit; siit++, nn++) {
464 if (siit->get()->side_number >= 0) {
471 for (; dit != hi_dit; dit++) {
472 nodes_indices[siit->get()->side_number * (*dit)->getNbOfCoeffs() +
473 (*dit)->getDofCoeffIdx()] =
474 (*dit)->getPetscGlobalDofIdx();
479 nodes_indices.resize(0,
false);
487 EntityType type,
int side_number,
VectorInt &indices)
const {
495 side_table.get<1>().lower_bound(boost::make_tuple(type, side_number));
497 side_table.get<1>().upper_bound(boost::make_tuple(type, side_number));
499 for (; siit != hi_siit; siit++) {
500 if (siit->get()->side_number >= 0) {
508 indices.resize(std::distance(dit, hi_dit));
509 for (; dit != hi_dit; dit++) {
511 indices[(*dit)->getEntDofIdx()] = (*dit)->getPetscGlobalDofIdx();
527 EntityType type,
int side_number,
530 type, side_number, indices);
541 EntityType type,
int side_number,
544 type, side_number, indices);
554 for (
auto &dat : data->dataOnEntities) {
555 for (
auto &ent_dat : dat) {
556 ent_dat.getEntDataBitRefLevel().clear();
563 for (
auto it : field_ents) {
564 if (
auto e = it.lock()) {
567 const EntityType type = e->getEntType();
568 const signed char side = e->getSideNumberPtr()->side_number;
571 if (type == MBVERTEX) {
572 auto &dat = data->dataOnEntities[type][0];
574 dat.getEntDataBitRefLevel()[side] = e->getBitRefLevel();
576 auto &dat = data->dataOnEntities[type][side];
577 dat.getEntDataBitRefLevel().resize(1,
579 dat.getEntDataBitRefLevel()[0] = e->getBitRefLevel();
592 const int bit_number)
const {
594 auto get_nodes_field_data = [&](
VectorDouble &nodes_data,
601 nodes_data.resize(0,
false);
602 nodes_dofs.resize(0,
false);
603 field_entities.resize(0,
false);
610 if ((*field_it)->getBitNumber() != bit_number)
613 const int nb_dofs_on_vert = (*field_it)->getNbOfCoeffs();
614 space = (*field_it)->getSpace();
615 base = (*field_it)->getApproxBase();
620 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
622 if (lo != field_ents.end()) {
625 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
629 for (
auto it = lo; it != hi; ++it) {
630 if (
auto e = it->lock()) {
631 if (
auto cache = e->entityCacheDataDofs.lock()) {
632 if (cache->loHi[0] != cache->loHi[1]) {
633 nb_dofs += std::distance(cache->loHi[0], cache->loHi[1]);
643 bb_node_order.resize(num_nodes,
false);
644 bb_node_order.clear();
645 const int max_nb_dofs = nb_dofs_on_vert * num_nodes;
646 nodes_data.resize(max_nb_dofs,
false);
647 nodes_dofs.resize(max_nb_dofs,
false);
648 field_entities.resize(num_nodes,
false);
649 std::fill(nodes_data.begin(), nodes_data.end(), 0);
650 std::fill(nodes_dofs.begin(), nodes_dofs.end(),
nullptr);
651 std::fill(field_entities.begin(), field_entities.end(),
nullptr);
653 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
655 for (
auto it = lo; it != hi; ++it) {
656 if (
auto e = it->lock()) {
657 const auto &sn = e->getSideNumberPtr();
660 if (
const auto side_number = sn->side_number;
662 const int brother_side_number = sn->brother_side_number;
664 field_entities[side_number] = e.get();
665 if (brother_side_number != -1) {
666 brother_ents_vec.emplace_back(e);
667 field_entities[side_number] = field_entities[side_number];
670 bb_node_order[side_number] = e->getMaxOrder();
671 int pos = side_number * nb_dofs_on_vert;
672 auto ent_filed_data_vec = e->getEntFieldData();
673 if (
auto cache = e->entityCacheDataDofs.lock()) {
674 for (
auto dit = cache->loHi[0]; dit != cache->loHi[1];
676 const auto dof_idx = (*dit)->getEntDofIdx();
677 nodes_data[pos + dof_idx] = ent_filed_data_vec[dof_idx];
678 nodes_dofs[pos + dof_idx] =
686 for (
auto &it : brother_ents_vec) {
687 if (
const auto e = it.lock()) {
688 const auto &sn = e->getSideNumberPtr();
689 const int side_number = sn->side_number;
690 const int brother_side_number = sn->brother_side_number;
691 bb_node_order[brother_side_number] = bb_node_order[side_number];
692 int pos = side_number * nb_dofs_on_vert;
693 int brother_pos = brother_side_number * nb_dofs_on_vert;
694 for (
int ii = 0; ii != nb_dofs_on_vert; ++ii) {
695 nodes_data[brother_pos] = nodes_data[pos];
696 nodes_dofs[brother_pos] = nodes_dofs[pos];
710 return get_nodes_field_data(
721 const EntityType type_hi)
const {
723 for (EntityType
t = type_lo;
t != type_hi; ++
t) {
728 dat.getFieldData().resize(0,
false);
729 dat.getFieldDofs().resize(0,
false);
730 dat.getFieldEntities().resize(0,
false);
737 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
739 if (lo != field_ents.end()) {
742 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
745 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
747 for (
auto it = lo; it != hi; ++it)
748 if (
auto e = it->lock()) {
749 auto side_ptr = e->getSideNumberPtr();
750 if (
const auto side = side_ptr->side_number; side >= 0) {
751 const EntityType type = e->getEntType();
753 auto &ent_field = dat.getFieldEntities();
754 auto &ent_field_dofs = dat.getFieldDofs();
755 auto &ent_field_data = dat.getFieldData();
757 const int brother_side = side_ptr->brother_side_number;
758 if (brother_side != -1)
759 brother_ents_vec.emplace_back(e);
761 dat.getBase() = e->getApproxBase();
762 dat.getSpace() = e->getSpace();
763 const int ent_order = e->getMaxOrder();
765 dat.getOrder() > ent_order ? dat.getOrder() : ent_order;
767 auto ent_data = e->getEntFieldData();
768 ent_field_data.resize(ent_data.size(),
false);
769 noalias(ent_field_data) = ent_data;
770 ent_field_dofs.resize(ent_data.size(),
false);
771 std::fill(ent_field_dofs.begin(), ent_field_dofs.end(),
nullptr);
772 ent_field.resize(1,
false);
773 ent_field[0] = e.get();
774 if (
auto cache = e->entityCacheDataDofs.lock()) {
775 for (
auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit) {
776 ent_field_dofs[(*dit)->getEntDofIdx()] =
783 for (
auto &it : brother_ents_vec) {
784 if (
const auto e = it.lock()) {
785 const EntityType type = e->getEntType();
786 const int side = e->getSideNumberPtr()->side_number;
787 const int brother_side = e->getSideNumberPtr()->brother_side_number;
790 dat_brother.getBase() = dat.getBase();
791 dat_brother.getSpace() = dat.getSpace();
792 dat_brother.getOrder() = dat.getOrder();
793 dat_brother.getFieldData() = dat.getFieldData();
794 dat_brother.getFieldDofs() = dat.getFieldDofs();
795 dat_brother.getFieldEntities() = dat.getFieldEntities();
804template <
typename EXTRACTOR>
807 const int bit_number,
808 EXTRACTOR &&extractor)
const {
812 std::array<FieldEntity_vector_view, MBMAXTYPE> field_ents_by_type;
814 if (
auto e = it.lock())
815 if (e->getBitNumber() == bit_number) {
816 field_ents_by_type[e->getEntType()].emplace_back(e);
819 auto set_entity_data = [&](
auto &data_on_element) {
823 for (EntityType
t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
825 data.resize(field_ents_by_type[
t].size());
829 for (EntityType
t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
831 for (
auto &d : data) {
832 d.getEntDataBitRefLevel().clear();
836 d.getFieldData().resize(0,
false);
837 d.getFieldDofs().resize(0,
false);
838 d.getFieldEntities().resize(0,
false);
839 d.getIndices().resize(0,
false);
840 d.getLocalIndices().resize(0,
false);
845 for (EntityType
t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
847 for (
auto it : field_ents_by_type[
t]) {
848 if (
auto e = it.lock()) {
850 data.getEntDataBitRefLevel().resize(1,
false);
851 data.getEntDataBitRefLevel()[0] = e->getBitRefLevel();
858 for (EntityType
t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
860 for (
auto it : field_ents_by_type[
t]) {
861 if (
auto e = it.lock()) {
863 data.getBase() = e->getApproxBase();
864 data.getSpace() = e->getSpace();
865 data.getFieldData() = e->getEntFieldData();
866 data.getFieldEntities().resize(1,
false);
867 data.getFieldEntities()[0] = e.get();
868 auto &ent_field_dofs = data.getFieldDofs();
869 ent_field_dofs.resize(data.getFieldData().size(),
false);
870 std::fill(ent_field_dofs.begin(), ent_field_dofs.end(),
nullptr);
871 if (
auto cache = e->entityCacheDataDofs.lock()) {
872 for (
auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit) {
873 ent_field_dofs[(*dit)->getEntDofIdx()] =
883 for (EntityType
t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
885 for (
auto it : field_ents_by_type[
t]) {
886 if (
auto e = it.lock()) {
888 auto &indices = data.getIndices();
889 auto &local_indices = data.getLocalIndices();
890 indices.resize(data.getFieldData().size(),
false);
891 local_indices.resize(data.getFieldData().size(),
false);
892 std::fill(indices.begin(), indices.end(), -1);
893 std::fill(local_indices.begin(), local_indices.end(), -1);
895 if (
auto cache = extractor(e).lock()) {
896 for (
auto dit = cache->loHi[0]; dit != cache->loHi[1]; ++dit) {
897 indices[(*dit)->getEntDofIdx()] = (*dit)->getPetscGlobalDofIdx();
898 local_indices[(*dit)->getEntDofIdx()] =
899 (*dit)->getPetscLocalDofIdx();
910 CHKERR set_entity_data(data);
926 const auto nb_faces = CN::NumSubEntities(type, 2);
930 auto side_ptr_it = side_table.get<1>().lower_bound(
931 boost::make_tuple(CN::TypeDimensionMap[2].first, 0));
932 auto hi_side_ptr_it = side_table.get<1>().upper_bound(boost::make_tuple(
933 CN::TypeDimensionMap[2].second, std::numeric_limits<signed char>::max()));
935 for (; side_ptr_it != hi_side_ptr_it; ++side_ptr_it) {
936 const auto side = (*side_ptr_it)->side_number;
939 const auto sense = (*side_ptr_it)->sense;
940 const auto offset = (*side_ptr_it)->offset;
942 EntityType face_type;
945 CN::SubEntityVertexIndices(type, 2, side, face_type, nb_nodes_face);
946 face_nodes.resize(nb_faces, nb_nodes_face);
947 face_nodes_order.resize(nb_faces, nb_nodes_face);
950 for (
int n = 0;
n != nb_nodes_face; ++
n)
951 face_nodes_order(side,
n) = (
n + offset) % nb_nodes_face;
953 for (
int n = 0;
n != nb_nodes_face; ++
n)
954 face_nodes_order(side,
n) =
955 (nb_nodes_face - (
n - offset) % nb_nodes_face) % nb_nodes_face;
957 for (
int n = 0;
n != nb_nodes_face; ++
n)
958 face_nodes(side,
n) = face_indices[face_nodes_order(side,
n)];
961 const auto face_ent = (*side_ptr_it)->ent;
967 nb_nodes_face,
true);
968 face_nodes.resize(nb_faces, nb_nodes_face);
969 for (
int nn = 0; nn != nb_nodes_face; ++nn) {
970 if (face_nodes(side, nn) !=
973 std::find(conn_ele, &conn_ele[num_nodes_ele], conn_face[nn]))) {
975 "Wrong face numeration");
995 for (EntityType
t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
1009 if (
auto ptr = e.lock()) {
1011 const EntityType type = ptr->getEntType();
1018 switch (continuity) {
1027 "Continuity not defined");
1030 data.
bAse.set(approx);
1038 "data fields ents not allocated on element");
1040 for (
auto space = 0; space !=
LASTSPACE; ++space)
1043 "Discontinuous and continuous bases on the same space");
1063 auto get_elem_base = [&](
auto base) {
1068 "Functions generating approximation base not defined");
1074 "Functions generating user approximation base not defined");
1079 auto get_ctx = [&](
auto space,
auto base,
auto continuity) {
1080 return boost::make_shared<EntPolynomialBaseCtx>(
1086 return elem_base->getValue(
gaussPts, ctx);
1089 for (
int space =
H1; space !=
LASTSPACE; ++space) {
1095 "Discontinuous and continuous bases on the same space");
1118 dataOnElement[space]->dataOnEntities[MBVERTEX][0].getDiffNSharedPtr(
1140 auto &bb_node_order = data.
dataOnEntities[MBVERTEX][0].getBBNodeOrder();
1143 auto bit_number = field_ptr->getBitNumber();
1146 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
1148 if (lo != field_ents.end()) {
1151 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
1154 for (
auto it = lo; it != hi; ++it)
1155 if (
auto first_e = it->lock()) {
1156 space = first_e->getSpace();
1157 base = first_e->getApproxBase();
1159 bb_node_order.resize(num_nodes,
false);
1160 bb_node_order.clear();
1162 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
1164 for (; it != hi; ++it) {
1165 if (
auto e = it->lock()) {
1166 const auto &sn = e->getSideNumberPtr();
1167 const int side_number = sn->side_number;
1168 const int brother_side_number = sn->brother_side_number;
1169 if (brother_side_number != -1)
1170 brother_ents_vec.emplace_back(e);
1171 bb_node_order[side_number] = e->getMaxOrder();
1175 for (
auto &it : brother_ents_vec) {
1176 if (
const auto e = it.lock()) {
1177 const auto &sn = e->getSideNumberPtr();
1178 const int side_number = sn->side_number;
1179 const int brother_side_number = sn->brother_side_number;
1180 bb_node_order[brother_side_number] = bb_node_order[side_number];
1193 const EntityType type_lo,
1194 const EntityType type_hi) {
1196 for (EntityType
t = MBEDGE;
t != MBPOLYHEDRON; ++
t) {
1201 dat.getFieldData().resize(0,
false);
1202 dat.getFieldDofs().resize(0,
false);
1207 auto bit_number = field_ptr->getBitNumber();
1210 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
1212 if (lo != field_ents.end()) {
1215 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
1217 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
1218 for (; lo != hi; ++lo) {
1219 if (
auto e = lo->lock()) {
1220 if (
auto cache = e->entityCacheDataDofs.lock()) {
1221 if (cache->loHi[0] != cache->loHi[1]) {
1222 if (
const auto side = e->getSideNumberPtr()->side_number;
1224 const EntityType type = e->getEntType();
1226 const int brother_side =
1227 e->getSideNumberPtr()->brother_side_number;
1228 if (brother_side != -1)
1229 brother_ents_vec.emplace_back(e);
1230 dat.getBase() = e->getApproxBase();
1231 dat.getSpace() = e->getSpace();
1232 const auto ent_order = e->getMaxOrder();
1234 dat.getOrder() > ent_order ? dat.getOrder() : ent_order;
1241 for (
auto &ent_ptr : brother_ents_vec) {
1242 if (
auto e = ent_ptr.lock()) {
1243 const EntityType type = e->getEntType();
1244 const int side = e->getSideNumberPtr()->side_number;
1245 const int brother_side = e->getSideNumberPtr()->brother_side_number;
1248 dat_brother.getBase() = dat.getBase();
1249 dat_brother.getSpace() = dat.getSpace();
1250 dat_brother.getOrder() = dat.getOrder();
1258 if (
auto ent_data_ptr = e.lock()) {
1260 auto space = ent_data_ptr->getSpace();
1261 for (EntityType
t = MBVERTEX;
t != MBPOLYHEDRON; ++
t) {
1263 for (
auto &ptr : dat.getBBAlphaIndicesByOrderArray())
1265 for (
auto &ptr : dat.getBBNByOrderArray())
1267 for (
auto &ptr : dat.getBBDiffNByOrderArray())
1275 auto check_space = [&](
const auto space) {
1278 for (
auto t = MBVERTEX;
t <= ele_type; ++
t) {
1284 for (
auto t = MBEDGE;
t <= ele_type; ++
t) {
1290 for (
auto t = MBTRI;
t <= ele_type; ++
t) {
1303 std::set<string> fields_list;
1305 if (
auto ent_data_ptr = e.lock()) {
1308 if (fields_list.find(
field_name) == fields_list.end()) {
1309 auto field_ptr = ent_data_ptr->getFieldRawPtr();
1310 auto space = ent_data_ptr->getSpace();
1314 if (check_space(space)) {
1316 if (ent_data_ptr->getContinuity() !=
CONTINUOUS)
1318 "Broken space not implemented");
1322 boost::make_shared<EntPolynomialBaseCtx>(
1340 for (
int space =
H1; space !=
LASTSPACE; ++space) {
1348#define LOG_FUNCTION_NAME_WITH_OP_NAME(OP, CHANNEL, SEV) \
1349 MOFEM_LOG(CHANNEL, SEV) \
1350 << "(Calling user data operator " \
1351 << boost::typeindex::type_id_runtime(OP).pretty_name() << " rowField " \
1352 << (OP).rowFieldName << " colField " << (OP).colFieldName << ") "
1354#define CATCH_OP_ERRORS(OP) \
1355 catch (MoFEMExceptionInitial const &ex) { \
1356 LOG_FUNCTION_NAME_WITH_OP_NAME(OP, "SELF", Sev::error) \
1357 << "in " << PETSC_FUNCTION_NAME; \
1358 return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
1359 ex.errorCode, PETSC_ERROR_INITIAL, "%s", ex.what()); \
1361 catch (MoFEMExceptionRepeat const &ex) { \
1362 LOG_FUNCTION_NAME_WITH_OP_NAME(OP, "SELF", Sev::error) \
1363 << "in " << PETSC_FUNCTION_NAME; \
1364 return PetscError(PETSC_COMM_SELF, ex.lINE, PETSC_FUNCTION_NAME, __FILE__, \
1365 ex.errorCode, PETSC_ERROR_REPEAT, " "); \
1367 catch (MoFEMException const &ex) { \
1368 LOG_FUNCTION_NAME_WITH_OP_NAME(OP, "SELF", Sev::error) \
1369 << "in " << PETSC_FUNCTION_NAME; \
1370 SETERRQ(PETSC_COMM_SELF, ex.errorCode, "%s", ex.errorMessage); \
1372 catch (std::exception const &ex) { \
1373 LOG_FUNCTION_NAME_WITH_OP_NAME(OP, "SELF", Sev::error) \
1374 << "\nError: " << ex.what() << " at " << __LINE__ << " : " __FILE__ \
1375 << " in " << PETSC_FUNCTION_NAME; \
1376 SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, "%s", \
1377 "std::exception"); \
1381 #define LOG_OP(OP) \
1382 LOG_FUNCTION_NAME_WITH_OP_NAME(OP, "WORLD", Sev::noisy) \
1383 << "\nLocation: at " << __LINE__ << " : " __FILE__ << " in " \
1384 << PETSC_FUNCTION_NAME;
1395 std::array<const Field *, 3> field_struture;
1398 std::array<FieldSpace, 2> space;
1399 std::array<FieldApproximationBase, 2> base;
1401 constexpr std::array<UDO::OpType, 2> types = {UDO::OPROW, UDO::OPCOL};
1402 std::array<int, 2> last_eval_field_id = {0, 0};
1404 std::array<boost::shared_ptr<EntitiesFieldData>, 2> op_data;
1406 auto swap_bases = [&](
auto &op) {
1408 for (
size_t ss = 0; ss != 2; ++ss) {
1409 if (op.getOpType() & types[ss] || op.getOpType() & UDO::OPROWCOL) {
1426 auto evaluate_op_space = [&](
auto &op) {
1431 std::fill(last_eval_field_id.begin(), last_eval_field_id.end(), 0);
1451 for (EntityType
t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
1453 e.getSpace() = op.sPace;
1470 auto set_op_entities_data = [&](
auto ss,
auto &op) {
1474 if ((op.getNumeredEntFiniteElementPtr()->getBitFieldIdData() &
1478 "no data field < %s > on finite element < %s >",
1486 for (
auto &data : op_data[ss]->dataOnEntities[MBENTITYSET]) {
1487 CHKERR data.resetFieldDependentData();
1490 auto get_data_for_nodes = [&]() {
1501 auto get_data_for_entities = [&]() {
1511 auto get_data_for_meshset = [&]() {
1517 boost::weak_ptr<EntityCacheNumeredDofs>
1518 operator()(boost::shared_ptr<FieldEntity> &e) {
1519 return e->entityCacheRowDofs;
1528 boost::weak_ptr<EntityCacheNumeredDofs>
1529 operator()(boost::shared_ptr<FieldEntity> &e) {
1530 return e->entityCacheColDofs;
1541 switch (space[ss]) {
1543 CHKERR get_data_for_nodes();
1546 CHKERR get_data_for_entities();
1551 CHKERR get_data_for_nodes();
1554 CHKERR get_data_for_entities();
1558 CHKERR get_data_for_meshset();
1562 "not implemented for this space < %s >",
1569 auto evaluate_op_for_fields = [&](
auto &op) {
1572 if (op.getOpType() & UDO::OPROW) {
1575 CHKERR op.opRhs(*op_data[0],
false);
1580 if (op.getOpType() & UDO::OPCOL) {
1583 CHKERR op.opRhs(*op_data[1],
false);
1588 if (op.getOpType() & UDO::OPROWCOL) {
1591 CHKERR op.opLhs(*op_data[0], *op_data[1]);
1605 for (; oit != hi_oit; oit++) {
1610 CHKERR oit->setPtrFE(
this);
1612 if ((oit->opType & UDO::OPSPACE) == UDO::OPSPACE) {
1616 CHKERR evaluate_op_space(*oit);
1620 (oit->opType & (UDO::OPROW | UDO::OPCOL | UDO::OPROWCOL)) ==
1628 for (
size_t ss = 0; ss != 2; ss++) {
1633 "Not set Field name in operator %ld (0-row, 1-column) in "
1636 (boost::typeindex::type_id_runtime(*oit).pretty_name())
1643 space[ss] = field_struture[ss]->getSpace();
1644 base[ss] = field_struture[ss]->getApproxBase();
1649 for (
size_t ss = 0; ss != 2; ss++) {
1651 if (oit->getOpType() & types[ss] ||
1652 oit->getOpType() & UDO::OPROWCOL) {
1653 if (last_eval_field_id[ss] != field_id[ss]) {
1654 CHKERR set_op_entities_data(ss, *oit);
1655 last_eval_field_id[ss] = field_id[ss];
1663 CHKERR evaluate_op_for_fields(*oit);
1669 for (
int i = 0;
i != 5; ++
i)
1670 if (oit->opType & (1 <<
i))
1671 MOFEM_LOG(
"SELF", Sev::error) << UDO::OpTypeNames[
i];
1673 "Impossible operator type");
1681const char *
const ForcesAndSourcesCore::UserDataOperator::OpTypeNames[] = {
1682 "OPROW",
" OPCOL",
"OPROWCOL",
"OPSPACE",
"OPLAST"};
1685 const std::string
field_name,
const EntityType type,
const int side,
1702 const std::string
field_name,
const EntityType type,
const int side,
1734 const EntityHandle ent_for_side, boost::shared_ptr<Range> fe_range,
1738 const auto *problem_ptr = getFEMethod()->problemPtr;
1740 problem_ptr->numeredFiniteElementsPtr->get<
Unique_mi_tag>();
1742 auto fe_miit = ptrFE->mField.get_finite_elements()
1745 if (fe_miit != ptrFE->mField.get_finite_elements()
1751 side_fe->
feName = fe_name;
1764 std::vector<boost::weak_ptr<NumeredEntFiniteElement>> fe_vec;
1765 auto get_numered_fe_ptr = [&](
auto &fe_uid,
Range &&adjacent_ents)
1766 -> std::vector<boost::weak_ptr<NumeredEntFiniteElement>> & {
1767 fe_vec.reserve(adjacent_ents.size());
1768 for (
auto fe_ent : adjacent_ents) {
1769 auto miit = numered_fe.find(
1771 if (miit != numered_fe.end()) {
1772 fe_vec.emplace_back(*miit);
1778 auto get_bit_entity_adjacency = [&]() {
1779 Range adjacent_ents;
1782 ent, side_dim, adjacent_ents),
1783 "getAdjacenciesAny failed");
1784 return adjacent_ents;
1787 auto get_bit_meshset_entities = [&]() {
1788 auto &
bit = getFEMethod()->numeredEntFiniteElementPtr->getBitRefLevel();
1789 Range ents = *fe_range;
1793 "filterEntitiesByRefLevel failed");
1797 auto get_adj = [&](
auto &fe_uid,
auto get_adj_fun)
1798 -> std::vector<boost::weak_ptr<NumeredEntFiniteElement>> & {
1801 return (*adj_cache).at(ent);
1802 }
catch (
const std::out_of_range &) {
1803 return (*adj_cache)[ent] = get_numered_fe_ptr(fe_uid, get_adj_fun());
1806 return get_numered_fe_ptr(fe_uid, get_adj_fun());
1813 "No range of finite elements");
1815 auto adj = (!fe_range)
1816 ? get_adj((*fe_miit)->getFEUId(), get_bit_entity_adjacency)
1817 : get_adj((*fe_miit)->getFEUId(), get_bit_meshset_entities);
1819 if (verb >=
VERBOSE && !adj.empty())
1820 MOFEM_LOG(
"SELF", sev) <<
"Number of side finite elements " << adj.size();
1824 for (
auto fe_weak_ptr : adj) {
1825 if (
auto fe_ptr = fe_weak_ptr.lock()) {
1828 <<
"Side finite element " <<
"(" << nn <<
"): " << *fe_ptr;
1851 auto fe_miit = fes.find(fe_name);
1852 if (fe_miit != fes.end()) {
1854 this_fe->
feName = fe_name;
1874 <<
"This finite element: " << *getNumeredEntFiniteElementPtr();
1880 auto get_numered_fe_ptr = [&](
auto &fe_uid,
auto fe_ent) {
1883 ->problemPtr->numeredFiniteElementsPtr->get<
Unique_mi_tag>();
1884 auto it = numered_fe.find(
1886 boost::shared_ptr<const NumeredEntFiniteElement> this_numered_fe_ptr;
1887 if (it != numered_fe.end()) {
1888 this_numered_fe_ptr = *it;
1890 return this_numered_fe_ptr;
1893 auto this_numered_fe_ptr = get_numered_fe_ptr(
1894 (*fe_miit)->getFEUId(), getNumeredEntFiniteElementPtr()->getEnt());
1895 if (this_numered_fe_ptr) {
1899 <<
"This finite element: " << *this_numered_fe_ptr;
1918 auto fe_miit = fes.find(fe_name);
1919 if (fe_miit != fes.end()) {
1921 const auto *problem_ptr = getFEMethod()->problemPtr;
1923 problem_ptr->numeredFiniteElementsPtr->get<
Unique_mi_tag>();
1925 parent_fe->
feName = fe_name;
1935 const auto parent_ent = getNumeredEntFiniteElementPtr()->getParentEnt();
1937 parent_ent, (*fe_miit)->getFEUId()));
1938 if (miit != numered_fe.end()) {
1940 MOFEM_LOG(
"SELF", sev) <<
"Parent finite element: " << **miit;
1949 MOFEM_LOG(
"SELF", sev) <<
"Parent finite element: no parent";
1965 auto fe_miit = ptrFE->mField.get_finite_elements()
1968 if (fe_miit != ptrFE->mField.get_finite_elements()
1972 const auto *problem_ptr = getFEMethod()->problemPtr;
1973 auto &ref_ents = *getPtrFE()->mField.get_ref_ents();
1975 problem_ptr->numeredFiniteElementsPtr->get<
Unique_mi_tag>();
1977 const auto parent_ent = getNumeredEntFiniteElementPtr()->getEnt();
1978 const auto parent_type = getNumeredEntFiniteElementPtr()->getEntType();
1981 boost::make_tuple(parent_type, parent_ent));
1983 if (
auto size = std::distance(range.first, range.second)) {
1985 std::vector<EntityHandle> childs_vec;
1986 childs_vec.reserve(size);
1987 for (; range.first != range.second; ++range.first)
1988 childs_vec.emplace_back((*range.first)->getEnt());
1992 if ((childs_vec.back() - childs_vec.front() + 1) == size)
1993 childs =
Range(childs_vec.front(), childs_vec.back());
1995 childs.insert_list(childs_vec.begin(), childs_vec.end());
1997 child_fe->
feName = fe_name;
2013 for (
auto p = childs.pair_begin(); p != childs.pair_end(); ++p) {
2017 p->first, (*fe_miit)->getFEUId()));
2020 p->second, (*fe_miit)->getFEUId()));
2022 for (; miit != hi_miit; ++miit) {
2026 <<
"Child finite element " <<
"(" << nn <<
"): " << **miit;
2043 boost::shared_ptr<Range> fe_range,
const int verb,
2049 auto fe_miit = fes.find(fe_name);
2050 if (fe_miit != fes.end()) {
2052 const auto *problem_ptr = getFEMethod()->problemPtr;
2054 problem_ptr->numeredFiniteElementsPtr->get<
Unique_mi_tag>();
2056 range_fe->
feName = fe_name;
2066 auto get_numered_fe_ptr = [&](
auto &fe_uid,
auto fe_range,
auto execute) {
2070 for (
auto p = fe_range->pair_begin(); p != fe_range->pair_end(); ++p) {
2071 auto first = p->first;
2072 auto second = p->second;
2073 auto lo = numered_fe.lower_bound(
2075 auto hi = numered_fe.upper_bound(
2077 for (; lo != hi; ++lo) {
2078 CHKERR execute(lo, nn++);
2085 auto execute = [&](
auto lo,
auto nn) {
2088 MOFEM_LOG(
"SELF", sev) <<
"Range finite element: " << **lo;
2097 CHKERR get_numered_fe_ptr((*fe_miit)->getFEUId(), fe_range, execute);
2125ForcesAndSourcesCore::UserDataOperator::UserDataOperator(
const FieldSpace space,
2128 :
DataOperator(symm), opType(type), sPace(space), ptrFE(nullptr) {}
2130ForcesAndSourcesCore::UserDataOperator::UserDataOperator(
2131 const std::string
field_name,
const char type,
const bool symm)
2135ForcesAndSourcesCore::UserDataOperator::UserDataOperator(
2136 const std::string row_field_name,
const std::string col_field_name,
2137 const char type,
const bool symm)
2138 :
DataOperator(symm), opType(type), rowFieldName(row_field_name),
2139 colFieldName(col_field_name), sPace(
LASTSPACE), ptrFE(nullptr) {}
2157 <<
"No method operator() overloaded on element entity on finite "
2159 << boost::typeindex::type_id_runtime(*this).pretty_name() <<
">";
2178 "User operator and finite element do not work together");
#define CATCH_OP_ERRORS(OP)
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
@ USER_BASE
user implemented approximation base
@ AINSWORTH_BERNSTEIN_BEZIER_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
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
@ 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)
static const char *const FieldSpaceNames[]
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
@ 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 THROW_MESSAGE(msg)
Throw MoFEM exception.
multi_index_container< boost::shared_ptr< NumeredDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, UId, &NumeredDofEntity::getLocalUniqueId > >, ordered_non_unique< tag< Part_mi_tag >, member< NumeredDofEntity, unsigned int, &NumeredDofEntity::pArt > >, ordered_non_unique< tag< Idx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::dofIdx > >, ordered_non_unique< tag< PetscGlobalIdx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::petscGloablDofIdx > >, ordered_non_unique< tag< PetscLocalIdx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::petscLocalDofIdx > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, EntityHandle, &NumeredDofEntity::getEnt > > > > NumeredDofEntity_multiIndex
MultiIndex container keeps NumeredDofEntity.
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.
virtual MoFEMErrorCode getAdjacenciesAny(const EntityHandle from_entity, const int to_dimension, Range &adj_entities) const
Get the adjacencies associated with a entity to entities of a specified dimension.
virtual const Field * get_field_structure(const std::string &name, enum MoFEMTypes bh=MF_EXIST) const =0
get field structure
#define MOFEM_LOG(channel, severity)
Log.
SeverityLevel
Severity levels.
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
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< int > VectorInt
implementation of Data Operators for Forces and Sources
auto type_from_handle(const EntityHandle h)
get type from entity handle
static MoFEMErrorCode get_value(MatrixDouble &pts_x, MatrixDouble &pts_t, TYPE *ctx)
static auto cmp_uid_lo(const boost::weak_ptr< FieldEntity > &a, const UId &b)
EntityHandle get_id_for_max_type()
static auto cmp_uid_hi(const UId &b, const boost::weak_ptr< FieldEntity > &a)
EntityHandle get_id_for_min_type()
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
Field_multiIndex::index< FieldName_mi_tag >::type::iterator field_it
ublas::vector< FieldEntity *, FieldEntAllocator > VectorFieldEntities
ublas::vector< FEDofEntity *, DofsAllocator > VectorDofs
static int getMaxOrder(const ENTMULTIINDEX &multi_index)
constexpr double t
plate stiffness
constexpr auto field_name
int loopSize
local number oe methods to process
MoFEMErrorCode copyBasicMethod(const BasicMethod &basic)
Copy data from other base method to this base method.
int getLoopSize() const
get loop size
boost::function< MoFEMErrorCode()> preProcessHook
Hook function for pre-processing.
const Field_multiIndex * fieldsPtr
raw pointer to fields container
int nInTheLoop
number currently of processed method
const Problem * problemPtr
raw pointer to problem
boost::function< MoFEMErrorCode()> operatorHook
Hook function for operator.
boost::weak_ptr< CacheTuple > cacheWeakPtr
int getNinTheLoop() const
get number of evaluated element in the loop
boost::function< MoFEMErrorCode()> postProcessHook
Hook function for post-processing.
MoFEMErrorCode filterEntitiesByRefLevel(const BitRefLevel bit, const BitRefLevel mask, Range &ents, int verb=QUIET) const
filter entities by bit ref level
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
virtual moab::Interface & get_moab()=0
virtual BitFieldId get_field_id(const std::string &name) const =0
Get field Id.
base operator to do operations at Gauss Pt. level
static bool getDefTypeMap(const EntityType fe_type, const EntityType ent_type)
Deprecated interface functions.
this class derive data form other data structure
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.
Data on single entity (This is passed as argument to DataOperator::doWork)
data structure for finite element entity
MatrixInt facesNodes
nodes on finite element faces
std::array< std::bitset< LASTSPACE >, MBMAXTYPE > spacesOnEntities
spaces on entity types
std::bitset< LASTBASE > bAse
bases on element
std::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
std::array< std::bitset< LASTBASE >, LASTSPACE > basesOnSpaces
base on spaces
std::array< std::bitset< LASTBASE >, LASTSPACE > brokenBasesOnSpaces
base on spaces
MatrixInt facesNodesOrder
order of face nodes on element
std::array< std::bitset< LASTBASE >, MBMAXTYPE > basesOnEntities
bases on entity types
keeps information about indexed dofs for the finite element
std::string feName
Name of finite element.
auto & getRowFieldEnts() const
auto getFEName() const
get finite element name
const FieldEntity_vector_view & getDataFieldEnts() const
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const
EntityHandle getFEEntityHandle() const
auto getNumberOfNodes() const
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
auto & getColFieldEnts() const
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
static UId getLoLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
static UId getHiLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
Provide data structure for (tensor) field approximation.
FieldCoefficientsNumber getNbOfCoeffs() const
Get number of field coefficients.
FieldSpace getSpace() const
Get field approximation space.
FieldBitNumber getBitNumber() const
Get number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set for giv...
std::map< EntityHandle, std::vector< boost::weak_ptr< NumeredEntFiniteElement > > > AdjCache
ForcesAndSourcesCore * ptrFE
structure to get information form mofem into EntitiesFieldData
MoFEMErrorCode loopOverOperators()
Iterate user data operators.
MoFEMErrorCode getProblemNodesRowIndices(const std::string &field_name, VectorInt &nodes_indices) const
MoFEMErrorCode getEntityIndices(EntitiesFieldData &data, const int bit_number, FieldEntity_vector_view &ents_field, const EntityType type_lo, const EntityType type_hi, EXTRACTOR &&extractor) const
MoFEMErrorCode getEntityRowIndices(EntitiesFieldData &data, const int bit_number, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
MoFEMErrorCode getRowNodesIndices(EntitiesFieldData &data, const int bit_number) const
get row node indices from FENumeredDofEntity_multiIndex
int getMaxRowOrder() const
Get max order of approximation for field in rows.
auto & getUserPolynomialBase()
Get the User Polynomial Base object.
MoFEMErrorCode getSpacesAndBaseOnEntities(EntitiesFieldData &data) const
Get field approximation space and base on entities.
MoFEMErrorCode getProblemTypeColIndices(const std::string &field_name, EntityType type, int side_number, VectorInt &indices) const
virtual MoFEMErrorCode operator()()
function is run for every finite element
MoFEMErrorCode getFaceNodes(EntitiesFieldData &data) const
Get nodes on faces.
const std::array< boost::shared_ptr< EntitiesFieldData >, LASTSPACE > derivedDataOnElement
Entity data on element entity columns fields.
virtual MoFEMErrorCode setGaussPts(int order_row, int order_col, int order_data)
set user specific integration rule
MoFEMErrorCode getNodesIndices(const int bit_number, FieldEntity_vector_view &ents_field, VectorInt &nodes_indices, VectorInt &local_nodes_indices, EXTRACTOR &&extractor) const
get node indices
MoFEMErrorCode getEntityFieldData(EntitiesFieldData &data, const int bit_number, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
MoFEMErrorCode setRefineFEPtr(const ForcesAndSourcesCore *refine_fe_ptr)
Set the pointer to face element refined.
auto & getElementPolynomialBase()
Get the Entity Polynomial Base object.
ForcesAndSourcesCore * sidePtrFE
Element to integrate on the sides.
ForcesAndSourcesCore(Interface &m_field)
virtual int getRule(int order_row, int order_col, int order_data)
another variant of getRule
boost::ptr_deque< UserDataOperator > opPtrVector
Vector of finite element users data operators.
MoFEMErrorCode getEntitySense(const EntityType type, boost::ptr_vector< EntitiesFieldData::EntData > &data) const
get sense (orientation) of entity
const std::array< boost::shared_ptr< EntitiesFieldData >, LASTSPACE > dataOnElement
Entity data on element entity rows fields.
MoFEMErrorCode getProblemNodesColIndices(const std::string &field_name, VectorInt &nodes_indices) const
MoFEMErrorCode getNoFieldEntityFieldData(EntitiesFieldData &data, const int bit_number, EXTRACTOR &&extractor) const
Get field data on entities where no field is defined.
MoFEMErrorCode calHierarchicalBaseFunctionsOnElement()
Calculate base functions.
MatrixDouble gaussPts
Matrix of integration points.
MoFEMErrorCode calBernsteinBezierBaseFunctionsOnElement()
Calculate Bernstein-Bezier base.
friend class UserDataOperator
virtual MoFEMErrorCode preProcess()
function is run at the beginning of loop
MoFEMErrorCode getColNodesIndices(EntitiesFieldData &data, const int bit_number) const
get col node indices from FENumeredDofEntity_multiIndex
MoFEMErrorCode setSideFEPtr(const ForcesAndSourcesCore *side_fe_ptr)
Set the pointer to face element on the side.
int getMaxColOrder() const
Get max order of approximation for field in columns.
MoFEMErrorCode getProblemNodesIndices(const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
get indices of nodal indices which are declared for problem but not this particular element
GaussHookFun setRuleHook
Set function to calculate integration rule.
MoFEMErrorCode getBitRefLevelOnData()
MoFEMErrorCode getNodesFieldData(EntitiesFieldData &data, const int bit_number) const
Get data on nodes.
MoFEMErrorCode getEntityColIndices(EntitiesFieldData &data, const int bit_number, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
MoFEMErrorCode getEntityDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< EntitiesFieldData::EntData > &data) const
Get the entity data order.
ForcesAndSourcesCore * refinePtrFE
Element to integrate parent or child.
int getMaxDataOrder() const
Get max order of approximation for data fields.
MoFEMErrorCode getProblemTypeRowIndices(const std::string &field_name, EntityType type, int side_number, VectorInt &indices) const
MoFEMErrorCode getProblemTypeIndices(const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices) const
get indices by type (generic function) which are declared for problem but not this particular element
RuleHookFun getRuleHook
Hook to get rule.
MoFEMErrorCode createDataOnElement(EntityType type)
Create a entity data on element object.
virtual MoFEMErrorCode postProcess()
function is run at the end of loop
MoFEMErrorCode copyKsp(const KspMethod &ksp)
copy data form another method
MoFEMErrorCode copyPetscData(const PetscData &petsc_data)
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredRowDofsPtr
store DOFs on rows for this problem
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredColDofsPtr
store DOFs on columns for this problem
MoFEMErrorCode copySnes(const SnesMethod &snes)
Copy snes data.
MoFEMErrorCode copyTs(const TSMethod &ts)
Copy TS solver data.