455 const int nb_gauss_pts = pts.size2();
457 auto ©_base_fun = data.dataOnEntities[MBVERTEX][0].getN(copy_base);
458 auto ©_diff_base_fun =
459 data.dataOnEntities[MBVERTEX][0].getDiffN(copy_base);
461 if (nb_gauss_pts != copy_base_fun.size1())
463 "Wrong number of gauss pts");
465 if (nb_gauss_pts != copy_diff_base_fun.size1())
467 "Wrong number of gauss pts");
470 if (data.spacesOnEntities[MBEDGE].test(
HCURL)) {
471 std::array<int, 12> sense;
472 std::array<int, 12>
order;
473 if (data.dataOnEntities[MBEDGE].size() != 12)
475 "Expected 12 edges data structures on Hex");
477 std::array<double *, 12> hcurl_edge_n;
478 std::array<double *, 12> diff_hcurl_edge_n;
479 bool sum_nb_dofs =
false;
481 for (
int ee = 0; ee != 12; ++ee) {
482 if (data.dataOnEntities[MBEDGE][ee].getSense() == 0)
484 "Sense on edge <%d> on Hex not set", ee);
486 sense[ee] = data.dataOnEntities[MBEDGE][ee].getSense();
487 order[ee] = data.dataOnEntities[MBEDGE][ee].getOrder();
489 data.dataOnEntities[MBEDGE][ee].getN(base).resize(nb_gauss_pts,
491 data.dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts,
494 &*data.dataOnEntities[MBEDGE][ee].getN(base).data().begin();
495 diff_hcurl_edge_n[ee] =
496 &*data.dataOnEntities[MBEDGE][ee].getDiffN(base).data().begin();
498 sum_nb_dofs |= (nb_dofs > 0);
503 sense.data(),
order.data(), &*copy_base_fun.data().begin(),
504 &*copy_diff_base_fun.data().begin(), hcurl_edge_n.data(),
505 diff_hcurl_edge_n.data(), nb_gauss_pts);
509 for (
int ee = 0; ee != 12; ee++) {
510 data.dataOnEntities[MBEDGE][ee].getN(base).resize(nb_gauss_pts, 0,
false);
511 data.dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts, 0,
517 if (data.spacesOnEntities[MBQUAD].test(
HCURL)) {
519 if (data.dataOnEntities[MBQUAD].size() != 6)
521 "Expected six data structures on Hex");
523 std::array<int, 6>
order;
524 double *face_family_ptr[6][2];
525 double *diff_face_family_ptr[6][2];
527 bool sum_nb_dofs =
false;
528 for (
int ff = 0; ff != 6; ff++) {
529 if (data.dataOnEntities[MBQUAD][ff].getSense() == 0)
531 "Sense pn quad <%d> not set", ff);
533 order[ff] = data.dataOnEntities[MBQUAD][ff].getOrder();
534 if (data.facesNodes.size1() != 6)
536 "Expected six faces");
537 if (data.facesNodes.size2() != 4)
539 "Expected four nodes on face");
541 const int nb_family_dofs =
543 faceFamily[ff].resize(2, 3 * nb_family_dofs * nb_gauss_pts,
false);
544 diffFaceFamily[ff].resize(2, 9 * nb_family_dofs * nb_gauss_pts,
false);
546 if (nb_family_dofs) {
547 face_family_ptr[ff][0] = &(
faceFamily[ff](0, 0));
548 face_family_ptr[ff][1] = &(
faceFamily[ff](1, 0));
553 sum_nb_dofs |= (nb_family_dofs > 0);
558 &*data.facesNodes.data().begin(),
559 &*data.facesNodesOrder.data().begin(),
order.data(),
560 &*copy_base_fun.data().begin(), &*copy_diff_base_fun.data().begin(),
561 face_family_ptr, diff_face_family_ptr, nb_gauss_pts);
563 for (
int ff = 0; ff != 6; ++ff) {
569 auto &face_n = data.dataOnEntities[MBQUAD][ff].getN(base);
570 auto &diff_face_n = data.dataOnEntities[MBQUAD][ff].getDiffN(base);
571 face_n.resize(nb_gauss_pts, 3 * nb_dofs,
false);
572 diff_face_n.resize(nb_gauss_pts, 9 * nb_dofs,
false);
576 double *ptr = &face_n(0, 0);
578 for (
int j = 0;
j != 3; ++
j) {
583 for (
int j = 0;
j != 3; ++
j) {
592 double *diff_ptr = &diff_face_n(0, 0);
594 for (
int j = 0;
j != 9; ++
j) {
595 *diff_ptr = *diff_ptr_f0;
599 for (
int j = 0;
j != 9; ++
j) {
600 *diff_ptr = *diff_ptr_f1;
608 for (
int ff = 0; ff != 6; ff++) {
609 data.dataOnEntities[MBQUAD][ff].getN(base).resize(nb_gauss_pts, 0,
611 data.dataOnEntities[MBQUAD][ff].getDiffN(base).resize(nb_gauss_pts, 0,
617 for (
int ff = 0; ff != 6; ff++) {
618 data.dataOnEntities[MBQUAD][ff].getN(base).resize(nb_gauss_pts, 0,
false);
619 data.dataOnEntities[MBQUAD][ff].getDiffN(base).resize(nb_gauss_pts, 0,
625 if (data.spacesOnEntities[MBHEX].test(
HCURL)) {
627 const int order = data.dataOnEntities[MBHEX][0].getOrder();
630 volFamily.resize(3, 3 * nb_dofs * nb_gauss_pts);
636 std::array<double *, 3> diff_family_ptr = {
641 p.data(), &*copy_base_fun.data().begin(),
642 &*copy_diff_base_fun.data().begin(), family_ptr.data(),
643 diff_family_ptr.data(), nb_gauss_pts);
646 auto &face_n = data.dataOnEntities[MBHEX][0].getN(base);
647 auto &diff_face_n = data.dataOnEntities[MBHEX][0].getDiffN(base);
648 face_n.resize(nb_gauss_pts, 3 * nb_vol_dofs,
false);
649 diff_face_n.resize(nb_gauss_pts, 9 * nb_vol_dofs,
false);
654 double *ptr = &face_n(0, 0);
656 for (
int j = 0;
j != 3; ++
j) {
661 for (
int j = 0;
j != 3; ++
j) {
666 for (
int j = 0;
j != 3; ++
j) {
676 double *diff_ptr = &diff_face_n(0, 0);
678 for (
int j = 0;
j != 9; ++
j) {
679 *diff_ptr = *diff_ptr_f0;
683 for (
int j = 0;
j != 9; ++
j) {
684 *diff_ptr = *diff_ptr_f1;
688 for (
int j = 0;
j != 9; ++
j) {
689 *diff_ptr = *diff_ptr_f2;
695 data.dataOnEntities[MBHEX][0].getN(base).resize(nb_gauss_pts, 0,
false);
696 data.dataOnEntities[MBHEX][0].getDiffN(base).resize(nb_gauss_pts, 0,
701 data.dataOnEntities[MBHEX][0].getN(base).resize(nb_gauss_pts, 0,
false);
702 data.dataOnEntities[MBHEX][0].getDiffN(base).resize(nb_gauss_pts, 0,
false);