27static char help[] =
"Tag values at integration points\n\n";
35constexpr const char *PROBLEM =
"FROM_TAGS";
43 std::string feName()
const {
return "FE_" +
name; }
44 std::string skinFeName()
const {
return "FE_SKIN_" +
name; }
45 std::string scalarField()
const {
return "U_" +
name; }
46 std::string vectorField()
const {
return "V_" +
name; }
50double scalarAt(
const double *x) {
51 return 0.3 + 1.1 * x[0] - 0.7 * x[1] + 0.4 * x[2];
54double vectorAt(
const int k,
const double *x) {
55 return 1. +
k + (0.5 +
k) * x[0] - (1. - 0.2 *
k) * x[1] + 0.3 *
k * x[2];
58double fullAt(
const int i,
const int j,
const double *x) {
59 return 1. +
i - 2. *
j + (
i ==
j ? 3. : 0.) + 0.1 * (
i + 1) * x[0] -
60 0.3 * (
j + 1) * x[1] + 0.05 * (
i + 2 *
j) * x[2];
63double symmetricAt(
const int i,
const int j,
const double *x) {
64 return 0.5 * (fullAt(
i,
j, x) + fullAt(
j,
i, x));
68double entityAt(
const EntityHandle ent,
const int k) {
78 std::function<std::vector<double>(
const double *)>
components;
81std::vector<TensorTag> tensorTags() {
84 return {{
"SYM2_FTENSOR", 3,
86 return std::vector<double>{S(0, 0, x), S(0, 1, x), S(1, 1, x)};
90 return std::vector<double>{S(0, 0, x), S(1, 1, x), S(0, 1, x)};
94 return std::vector<double>{S(0, 0, x), S(0, 1, x), S(0, 2, x),
95 S(1, 1, x), S(1, 2, x), S(2, 2, x)};
99 return std::vector<double>{S(0, 0, x), S(1, 1, x), S(2, 2, x),
100 S(0, 1, x), S(0, 2, x), S(1, 2, x)};
104 return std::vector<double>{T(0, 0, x), T(0, 1, x), T(1, 0, x),
109 return std::vector<double>{T(0, 0, x), T(1, 1, x), T(0, 1, x),
114 return std::vector<double>{T(0, 0, x), T(0, 1, x), T(0, 2, x),
115 T(1, 0, x), T(1, 1, x), T(1, 2, x),
116 T(2, 0, x), T(2, 1, x), T(2, 2, x)};
120 return std::vector<double>{T(0, 0, x), T(1, 1, x), T(2, 2, x),
121 T(0, 1, x), T(1, 0, x), T(0, 2, x),
122 T(2, 0, x), T(1, 2, x), T(2, 1, x)};
124 {
"FULL32_FTENSOR", 6, [=](
auto x) {
125 return std::vector<double>{T(0, 0, x), T(0, 1, x), T(1, 0, x),
126 T(1, 1, x), T(2, 0, x), T(2, 1, x)};
131std::vector<double> paddedVoigtAt(
const double *x) {
132 auto S = symmetricAt;
133 return {S(0, 0, x), S(1, 1, x), S(2, 2, x), S(0, 1, x), S(0, 2, x),
134 S(1, 2, x), 1e6, 1e6, 1e6};
137MoFEMErrorCode createParts(moab::Interface &moab, std::vector<Part> &parts) {
140 auto add_part = [&](EntityType
type,
const std::string &
name,
141 const std::vector<double> &coords,
142 const std::vector<std::vector<int>> &conn) {
144 std::vector<EntityHandle> verts(coords.size() / 3);
145 for (
size_t v = 0;
v != verts.size(); ++
v)
146 CHKERR moab.create_vertex(&coords[3 *
v], verts[
v]);
148 for (
auto &
c : conn) {
149 std::vector<EntityHandle> nodes;
151 nodes.push_back(verts[
v]);
153 CHKERR moab.create_element(
type, nodes.data(), nodes.size(), ent);
154 part.elements.insert(ent);
157 for (
int d = 1;
d < part.dim; ++
d) {
159 CHKERR moab.get_adjacencies(part.elements,
d,
true, adj,
160 moab::Interface::UNION);
162 parts.push_back(part);
166 CHKERR add_part(MBEDGE,
"edge", {0, 0, 0, 1, 0.2, 0.1, 2.1, 0.5, 0.4},
168 CHKERR add_part(MBTRI,
"tri", {0, 0, 5, 1, 0, 5.1, 1.1, 1, 5.2, 0, 1.2, 5},
169 {{0, 1, 2}, {0, 2, 3}});
170 CHKERR add_part(MBQUAD,
"quad",
171 {0, 0, 10, 1.2, 0.1, 10, 1.0, 1.1, 10, 0.1, 0.9, 10, 2.3, 0.3,
173 {{0, 1, 2, 3}, {1, 4, 5, 2}});
174 CHKERR add_part(MBTET,
"tet",
175 {0, 0, 15, 1, 0, 15, 0, 1, 15, 0, 0, 16, 1, 1, 16},
176 {{0, 1, 2, 3}, {1, 2, 3, 4}});
177 CHKERR add_part(MBHEX,
"hex",
178 {0, 0, 20, 1, 0, 20.05, 1.1, 1, 20,
179 0, 0.9, 20.1, 0.05, 0, 21, 1, 0.1, 21.1,
180 1.2, 1.1, 21, -0.1, 1, 20.9, 2, 0, 20,
181 2.1, 1.2, 20.1, 2.2, -0.1, 21, 2, 1, 21.2},
182 {{0, 1, 2, 3, 4, 5, 6, 7}, {1, 8, 9, 2, 5, 10, 11, 6}});
188 const std::vector<Part> &parts) {
192 CHKERR moab.get_entities_by_type(0, MBVERTEX, verts);
193 std::vector<double> coords(3 * verts.size());
194 CHKERR moab.get_coords(verts, coords.data());
196 auto create = [&](
const std::string &
name,
const int length,
197 const unsigned flags = MB_TAG_DENSE) {
200 MB_TAG_CREAT |
flags),
205 auto set_vertex_tag = [&](
const std::string &
name,
const int length,
209 std::vector<double> data(
length * verts.size());
210 for (
size_t v = 0;
v != verts.size(); ++
v) {
214 CHKERR moab.tag_set_data(
th, verts, data.data());
219 "S_VERTEX", 1, [](
auto x) {
return std::vector<double>{scalarAt(x)}; });
220 CHKERR set_vertex_tag(
"V_VERTEX", 3, [](
auto x) {
221 return std::vector<double>{vectorAt(0, x), vectorAt(1, x), vectorAt(2, x)};
223 for (
auto &
t : tensorTags())
224 CHKERR set_vertex_tag(
t.name,
t.length,
t.components);
226 auto th_s = create(
"S_ENTITY", 1);
227 auto th_v = create(
"V_ENTITY", 3);
228 auto th_p = create(
"SYM3_VOIGT_PADDED", 9);
229 for (
auto &part : parts) {
230 for (
auto ent : part.elements) {
231 const double s = entityAt(ent, 0);
232 CHKERR moab.tag_set_data(th_s, &ent, 1, &
s);
233 const double v[] = {entityAt(ent, 0), entityAt(ent, 1), entityAt(ent, 2)};
234 CHKERR moab.tag_set_data(th_v, &ent, 1,
v);
235 const EntityHandle *conn;
237 CHKERR moab.get_connectivity(ent, conn, nb_conn,
true);
239 CHKERR moab.get_coords(conn, 1, x);
240 const auto p = paddedVoigtAt(x);
241 CHKERR moab.tag_set_data(th_p, &ent, 1, p.data());
246 CHKERR moab.tag_set_data(create(
"BAD_LENGTH", 2), verts,
247 std::vector<double>(2 * verts.size(), 1.).data());
249 CHKERR moab.tag_get_handle(
"BAD_TYPE", 1, MB_TYPE_INTEGER, th_int,
250 MB_TAG_CREAT | MB_TAG_DENSE);
251 CHKERR moab.tag_set_data(th_int, verts,
252 std::vector<int>(verts.size(), 1).data());
254 CHKERR moab.tag_get_handle(
"BAD_VARLEN", 0, MB_TYPE_DOUBLE, th_varlen,
255 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE);
256 auto th_sparse = create(
"SPARSE_PARTIAL", 1, MB_TAG_SPARSE);
257 const double one = 1;
258 const EntityHandle first_vertex = verts.front();
259 CHKERR moab.tag_set_data(th_sparse, &first_vertex, 1, &one);
265 std::vector<Part> &parts) {
270 for (
auto &part : parts)
271 elements.merge(part.elements);
278 auto add_fe = [&](
const std::string &fe_name,
const Part &part,
279 const Range &ents,
const int dim) {
282 for (
auto field : {part.scalarField(), part.vectorField()}) {
292 for (
auto &part : parts) {
297 Range ents = part.elements;
298 for (
int d = 0;
d != part.dim; ++
d)
299 CHKERR moab.get_adjacencies(part.elements,
d,
false, ents,
300 moab::Interface::UNION);
301 for (
auto [
field,
nb] : {std::make_pair(part.scalarField(), 1),
302 std::make_pair(part.vectorField(), 3)}) {
307 CHKERR add_fe(part.feName(), part, part.elements, part.dim);
311 CHKERR skin.find_skin(0, part.elements,
false, skin_faces);
312 CHKERR add_fe(part.skinFeName(), part, skin_faces, 2);
322 CHKERR problems->partitionSimpleProblem(PROBLEM);
323 CHKERR problems->partitionFiniteElements(PROBLEM);
324 CHKERR problems->partitionGhostDofs(PROBLEM);
328 for (
auto &part : parts) {
331 const double c[] = {*x, *y, *z};
332 data[0] = scalarAt(
c);
336 CHKERR blas->setVertexDofs(
338 const double c[] = {*x, *y, *z};
339 for (
int k = 0;
k != 3; ++
k)
340 data[
k] = vectorAt(
k,
c);
349boost::shared_ptr<ForcesAndSourcesCore> makeElement(
MoFEM::Interface &m_field,
351 boost::shared_ptr<ForcesAndSourcesCore> fe;
354 fe = boost::make_shared<EdgeElementForcesAndSourcesCore>(m_field);
357 fe = boost::make_shared<FaceElementForcesAndSourcesCore>(m_field);
360 fe = boost::make_shared<VolumeElementForcesAndSourcesCore>(m_field);
362 fe->getRuleHook = [](int, int, int) {
return 3; };
366UDO *makeCheck(CheckFun
fun) {
367 auto op =
new UDO(
NOSPACE, UDO::OPSPACE);
370 return fun(
static_cast<UDO *
>(op_ptr));
377 std::vector<std::string> names;
378 std::map<std::string, double> max;
379 void add(
const std::string &
name,
const double error) {
380 if (!max.count(
name)) {
381 names.push_back(
name);
384 max[
name] = std::isfinite(error) ? std::max(max[
name], std::abs(error))
385 : std::numeric_limits<double>::infinity();
389 for (
auto &
name : names)
399 std::vector<Part> &parts)
413 std::vector<Part> &parts;
419 MoFEMErrorCode loopParts(
const std::string &test, PushOps push_ops) {
421 for (
auto &part : parts) {
422 auto fe = makeElement(
mField, part.dim);
424 CHKERR push_ops(part, fe->getOpPtrVector());
425 fe->getOpPtrVector().push_back(makeCheck([&](UDO *) {
431 test +
" " + part.name +
" elements", nb_elements,
432 part.elements.size(), {0., 0.});
441 CHKERR loopParts(
"entity", [&](Part &part,
auto &pip) {
443 auto s_ptr = boost::make_shared<VectorDouble>();
444 auto v_ptr = boost::make_shared<MatrixDouble>();
445 auto p_ptr = boost::make_shared<MatrixDouble>();
449 "V_ENTITY", v_ptr, TagSpace::ENTITY));
451 "SYM3_VOIGT_PADDED", p_ptr, TagSpace::ENTITY, TagNotation::VOIGT,
453 pip.push_back(makeCheck([&, s_ptr, v_ptr, p_ptr](UDO *op) {
455 const auto ent = op->getFEEntityHandle();
456 const int nb_gauss = op->getGaussPts().size2();
457 const EntityHandle *conn;
462 if (
static_cast<int>(s_ptr->size()) != nb_gauss || nb_gauss == 0)
464 "Wrong number of values");
465 auto t_v = getFTensor1FromMat<3>(*v_ptr);
466 auto t_p = getFTensor2SymmetricFromMat<3>(*p_ptr);
467 for (
int gg = 0; gg != nb_gauss; ++gg) {
468 errors.add(part.name +
" scalar entity",
469 (*s_ptr)[gg] - entityAt(ent, 0));
470 for (
int k = 0;
k != 3; ++
k)
471 errors.add(part.name +
" vector entity", t_v(
k) - entityAt(ent,
k));
472 for (
int i = 0;
i != 3; ++
i)
473 for (
int j = 0;
j != 3; ++
j)
474 errors.add(part.name +
" padded voigt entity",
475 t_p(
i,
j) - symmetricAt(
i,
j, x));
490 CHKERR loopParts(
"vertex", [&](Part &part,
auto &pip) {
492 auto s_ptr = boost::make_shared<VectorDouble>();
493 auto v_ptr = boost::make_shared<MatrixDouble>();
497 "V_VERTEX", v_ptr, TagSpace::VERTEX));
498 pip.push_back(makeCheck([&, s_ptr, v_ptr](UDO *op) {
500 auto &coords = op->getCoordsAtGaussPts();
501 const int nb_gauss = op->getGaussPts().size2();
502 if (
static_cast<int>(s_ptr->size()) != nb_gauss || nb_gauss == 0)
504 "Wrong number of values");
505 auto t_v = getFTensor1FromMat<3>(*v_ptr);
506 for (
int gg = 0; gg != nb_gauss; ++gg) {
507 const double *x = &coords(gg, 0);
508 errors.add(part.name +
" scalar vertex", (*s_ptr)[gg] - scalarAt(x));
509 for (
int k = 0;
k != 3; ++
k)
510 errors.add(part.name +
" vector vertex", t_v(
k) - vectorAt(
k, x));
524 CHKERR loopParts(
"h1", [&](Part &part,
auto &pip) {
526 auto s_ptr = boost::make_shared<VectorDouble>();
527 auto v_ptr = boost::make_shared<MatrixDouble>();
528 auto u_ptr = boost::make_shared<VectorDouble>();
529 auto w_ptr = boost::make_shared<MatrixDouble>();
533 "V_VERTEX", v_ptr, TagSpace::VERTEX));
537 pip.push_back(makeCheck([&, s_ptr, v_ptr, u_ptr, w_ptr](UDO *op) {
539 const int nb_gauss = op->getGaussPts().size2();
540 if (
static_cast<int>(u_ptr->size()) != nb_gauss || nb_gauss == 0)
542 "Wrong number of values");
543 auto t_v = getFTensor1FromMat<3>(*v_ptr);
544 auto t_w = getFTensor1FromMat<3>(*w_ptr);
545 for (
int gg = 0; gg != nb_gauss; ++gg) {
546 errors.add(part.name +
" scalar h1", (*s_ptr)[gg] - (*u_ptr)[gg]);
547 for (
int k = 0;
k != 3; ++
k)
548 errors.add(part.name +
" vector h1", t_v(
k) - t_w(
k));
563 CHKERR loopParts(
"notation", [&](Part &part,
auto &pip) {
565 std::map<std::string, boost::shared_ptr<MatrixDouble>> ptr;
566 for (
auto &
t : tensorTags())
567 ptr[
t.name] = boost::make_shared<MatrixDouble>();
568 for (
auto [
name, notation] :
569 {std::make_pair(
"FTENSOR", TagNotation::FTENSOR),
570 std::make_pair(
"VOIGT", TagNotation::VOIGT)}) {
571 const std::string
n =
name;
573 "SYM2_" +
n, ptr[
"SYM2_" +
n], TagSpace::VERTEX, notation));
575 "SYM3_" +
n, ptr[
"SYM3_" +
n], TagSpace::VERTEX, notation));
577 "FULL2_" +
n, ptr[
"FULL2_" +
n], TagSpace::VERTEX, notation));
579 "FULL3_" +
n, ptr[
"FULL3_" +
n], TagSpace::VERTEX, notation));
582 "FULL32_FTENSOR", ptr[
"FULL32_FTENSOR"], TagSpace::VERTEX));
584 pip.push_back(makeCheck([&, ptr](UDO *op) {
586 auto &coords = op->getCoordsAtGaussPts();
587 const int nb_gauss = op->getGaussPts().size2();
590 "No integration points");
591 for (
auto n : {
"FTENSOR",
"VOIGT"}) {
592 const std::string
name =
n;
593 auto t_s2 = getFTensor2SymmetricFromMat<2>(*ptr.at(
"SYM2_" +
name));
594 auto t_s3 = getFTensor2SymmetricFromMat<3>(*ptr.at(
"SYM3_" +
name));
595 auto t_f2 = getFTensor2FromMat<2, 2>(*ptr.at(
"FULL2_" +
name));
596 auto t_f3 = getFTensor2FromMat<3, 3>(*ptr.at(
"FULL3_" +
name));
597 for (
int gg = 0; gg != nb_gauss; ++gg) {
598 const double *x = &coords(gg, 0);
599 for (
int i = 0;
i != 3; ++
i) {
600 for (
int j = 0;
j != 3; ++
j) {
601 if (
i < 2 &&
j < 2) {
602 errors.add(part.name +
" sym2 " +
name,
603 t_s2(
i,
j) - symmetricAt(
i,
j, x));
604 errors.add(part.name +
" full2 " +
name,
605 t_f2(
i,
j) - fullAt(
i,
j, x));
607 errors.add(part.name +
" sym3 " +
name,
608 t_s3(
i,
j) - symmetricAt(
i,
j, x));
609 errors.add(part.name +
" full3 " +
name,
610 t_f3(
i,
j) - fullAt(
i,
j, x));
619 auto t_f32 = getFTensor2FromMat<3, 2>(*ptr.at(
"FULL32_FTENSOR"));
620 for (
int gg = 0; gg != nb_gauss; ++gg) {
621 const double *x = &coords(gg, 0);
622 for (
int i = 0;
i != 3; ++
i)
623 for (
int j = 0;
j != 2; ++
j)
624 errors.add(part.name +
" full32 FTENSOR",
625 t_f32(
i,
j) - fullAt(
i,
j, x));
639 for (
auto &part : parts) {
642 auto fe = makeElement(
mField, 2);
643 auto face_coords = boost::make_shared<MatrixDouble>();
644 int nb_faces = 0, nb_sides = 0;
645 fe->getOpPtrVector().push_back(makeCheck([&,
face_coords](UDO *op) {
651 mField, part.feName(), 3, Sev::noisy);
652 auto s_ptr = boost::make_shared<VectorDouble>();
653 op_side->getOpPtrVector().push_back(
656 op_side->getOpPtrVector().push_back(
660 if (
static_cast<int>(s_ptr->size()) != nb_gauss || nb_gauss == 0)
662 "Side and face integration points differ");
663 for (
int gg = 0; gg != nb_gauss; ++gg)
664 errors.add(part.name +
" side scalar vertex",
669 fe->getOpPtrVector().push_back(op_side);
672 CHKERR testing.checkValue<TestType::SCALAR>(
"side " + part.name +
" visits",
673 nb_sides, nb_faces, {0., 0.});
683 auto &part = *std::find_if(parts.begin(), parts.end(),
684 [](
auto &p) { return p.type == MBTET; });
686 auto run = [&](UDO *op) {
687 auto fe = makeElement(
mField, part.dim);
688 fe->getOpPtrVector().push_back(op);
692 auto rejects = [&](
const std::string &
name, UDO *op) {
694 CHKERR PetscPushErrorHandler(PetscReturnErrorHandler,
nullptr);
695 const auto error =
run(op);
696 CHKERR PetscPopErrorHandler();
702 auto s_ptr = boost::make_shared<VectorDouble>();
704 "NO_SUCH_TAG", s_ptr, TagSpace::VERTEX));
706 "BAD_LENGTH", s_ptr, TagSpace::VERTEX));
708 "BAD_TYPE", s_ptr, TagSpace::VERTEX));
710 "BAD_VARLEN", s_ptr, TagSpace::VERTEX));
711 CHKERR rejects(
"missing value",
713 "SPARSE_PARTIAL", s_ptr, TagSpace::VERTEX));
714 CHKERR rejects(
"missing entity value",
716 "SPARSE_PARTIAL", s_ptr, TagSpace::ENTITY));
720 "BAD_LENGTH", s_ptr, TagSpace::VERTEX,
true));
726 auto throws = [&](
const std::string &
name,
auto create) {
738 auto mat_ptr = boost::make_shared<MatrixDouble>();
739 CHKERR throws(
"voigt non-square", [&]() {
741 "FULL32_FTENSOR", mat_ptr, TagSpace::VERTEX, TagNotation::VOIGT);
743 CHKERR throws(
"null pointer", [&]() {
747 CHKERR throws(
"unknown space", [&]() {
749 "V_VERTEX", mat_ptr,
static_cast<TagSpace>(7));
751 CHKERR throws(
"unknown notation", [&]() {
753 "SYM3_VOIGT", mat_ptr, TagSpace::VERTEX,
static_cast<TagNotation>(7));
760int main(
int argc,
char *argv[]) {
763 moab::Core mb_instance;
764 moab::Interface &moab = mb_instance;
766 std::vector<Part> parts;
767 CHKERR createParts(moab, parts);
768 CHKERR createTags(moab, parts);
772 CHKERR setUpProblem(m_field, parts);
774 std::unique_ptr<TestingInterface>
testing(
776 FromTagsTest test(m_field, *
testing, parts);
778 [&]() {
return test.testEntity(); });
780 [&]() {
return test.testVertex(); });
782 [&]() {
return test.testH1(); });
784 [&]() {
return test.testNotation(); });
786 [&]() {
return test.testSide(); });
788 [&]() {
return test.testErrors(); });
790 [&]() {
return test.testFactory(); });
MoFEM::Interface & mField
Vec t
Removal: the ring edge.
int components
Inferred from the source tag length.
SmartPetscObj< Vec > values
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_ATOM_TEST_INVALID
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
static const double face_coords[4][9]
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode add_ents_to_field_by_dim(const Range &ents, const int dim, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
TagSpace
Where tag values live and how they are evaluated.
ForcesAndSourcesCore::UserDataOperator * createOpCalculateScalarFieldValuesFromTags(const std::string tag_name, boost::shared_ptr< VectorDouble > data_ptr, const TagSpace space, const bool allow_longer_tag)
Create operator evaluating a scalar tag at integration points.
TagNotation
Component order of a tensor stored on a tag.
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
MoFEMErrorCode buildProblem(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
VectorShallowArrayAdaptor< double > VectorAdaptor
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
auto type_from_handle(const EntityHandle h)
get type from entity handle
auto id_from_handle(const EntityHandle h)
TestingInterface * createInterface< TestingInterface >(const Core &core)
template ForcesAndSourcesCore::UserDataOperator * createOpCalculateTensor2FieldValuesFromTags< 2, 2 >(const std::string, boost::shared_ptr< MatrixDouble >, const TagSpace, const TagNotation, const bool)
template ForcesAndSourcesCore::UserDataOperator * createOpCalculateTensor2SymmetricFieldValuesFromTags< 3 >(const std::string, boost::shared_ptr< MatrixDouble >, const TagSpace, const TagNotation, const bool)
template ForcesAndSourcesCore::UserDataOperator * createOpCalculateTensor2SymmetricFieldValuesFromTags< 2 >(const std::string, boost::shared_ptr< MatrixDouble >, const TagSpace, const TagNotation, const bool)
template ForcesAndSourcesCore::UserDataOperator * createOpCalculateTensor2FieldValuesFromTags< 3, 2 >(const std::string, boost::shared_ptr< MatrixDouble >, const TagSpace, const TagNotation, const bool)
template ForcesAndSourcesCore::UserDataOperator * createOpCalculateVectorFieldValuesFromTags< 3 >(const std::string, boost::shared_ptr< MatrixDouble >, const TagSpace, const bool)
template ForcesAndSourcesCore::UserDataOperator * createOpCalculateTensor2FieldValuesFromTags< 3, 3 >(const std::string, boost::shared_ptr< MatrixDouble >, const TagSpace, const TagNotation, const bool)
MoFEMErrorCode run(MoFEM::Interface &m_field)
virtual moab::Interface & get_moab()=0
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode add_field(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
base operator to do operations at Gauss Pt. level
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
MoFEMErrorCode setVertexDofs(VertexCoordsFunction lambda, const std::string field_name, Range *verts=nullptr)
Set DOFs on vertices using user function.
Specialization for double precision scalar field values calculation.
Specialization for MatrixDouble vector field values calculation.
Element used to execute operators on side of the element.
Problem manager is used to build and partition problems.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.