42 PetscErrorCode (*base_polynomials)(
int p,
double s,
double *diff_s,
double *
L,
43 double *diffL,
const int dim) =
46 int nb_gauss_pts = pts.size2();
48 int sense[6],
order[6];
54 double *h1_edge_n[6], *diff_h1_egde_n[6];
55 for (
int ee = 0; ee != 6; ++ee) {
58 "data inconsistency");
63 data.
dataOnEntities[MBEDGE][ee].getN(base).resize(nb_gauss_pts, nb_dofs,
65 data.
dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts,
76 h1_edge_n, diff_h1_egde_n, nb_gauss_pts, base_polynomials);
78 for (
int ee = 0; ee != 6; ++ee) {
80 data.
dataOnEntities[MBEDGE][ee].getDiffN(base).resize(0, 0,
false);
89 double *h1_face_n[4], *diff_h1_face_n[4];
90 for (
int ff = 0; ff != 4; ++ff) {
93 "data inconsistency");
97 data.
dataOnEntities[MBTRI][ff].getN(base).resize(nb_gauss_pts, nb_dofs,
116 h1_face_n, diff_h1_face_n, nb_gauss_pts, base_polynomials);
119 for (
int ff = 0; ff != 4; ++ff) {
121 data.
dataOnEntities[MBTRI][ff].getDiffN(base).resize(0, 0,
false);
129 data.
dataOnEntities[MBTET][0].getN(base).resize(nb_gauss_pts, nb_vol_dofs,
132 3 * nb_vol_dofs,
false);
139 nb_gauss_pts, base_polynomials);
154 const int nb_gauss_pts = pts.size2();
157 (
unsigned int)nb_gauss_pts)
159 "Base functions or nodes has wrong number of integration points "
165 auto &ptr = data.getBBAlphaIndicesSharedPtr(
field_name);
179 auto &ptr = data.getBBDiffNSharedPtr(
field_name);
185 auto get_alpha_by_name_ptr =
187 const std::string &
field_name) -> boost::shared_ptr<MatrixInt> & {
188 return data.getBBAlphaIndicesSharedPtr(
field_name);
191 auto get_base_by_name_ptr =
193 const std::string &
field_name) -> boost::shared_ptr<MatrixDouble> & {
197 auto get_diff_base_by_name_ptr =
199 const std::string &
field_name) -> boost::shared_ptr<MatrixDouble> & {
203 auto get_alpha_by_order_ptr =
204 [](
auto &data,
const size_t o) -> boost::shared_ptr<MatrixInt> & {
205 return data.getBBAlphaIndicesByOrderSharedPtr(
o);
208 auto get_base_by_order_ptr =
209 [](
auto &data,
const size_t o) -> boost::shared_ptr<MatrixDouble> & {
210 return data.getBBNByOrderSharedPtr(
o);
213 auto get_diff_base_by_order_ptr =
214 [](
auto &data,
const size_t o) -> boost::shared_ptr<MatrixDouble> & {
215 return data.getBBDiffNByOrderSharedPtr(
o);
219 auto &vertex_alpha = get_alpha(vert_ent_data);
220 vertex_alpha.resize(4, 4,
false);
221 vertex_alpha.clear();
222 for (
int n = 0;
n != 4; ++
n)
225 auto &vert_get_n = get_base(vert_ent_data);
226 auto &vert_get_diff_n = get_diff_base(vert_ent_data);
227 vert_get_n.resize(nb_gauss_pts, 4,
false);
228 vert_get_diff_n.resize(nb_gauss_pts, 12,
false);
230 1,
lambda.size1(), vertex_alpha.size1(), &vertex_alpha(0, 0),
232 &vert_get_diff_n(0, 0));
233 for (
int n = 0;
n != 4; ++
n) {
234 const double f = boost::math::factorial<double>(
236 for (
int g = 0;
g != nb_gauss_pts; ++
g) {
237 vert_get_n(
g,
n) *= f;
238 for (
int d = 0; d != 3; ++d)
239 vert_get_diff_n(
g, 3 *
n + d) *= f;
247 "Wrong size of ent data");
249 constexpr int edges_nodes[6][2] = {{0, 1}, {1, 2}, {2, 0},
250 {0, 3}, {1, 3}, {2, 3}};
251 for (
int ee = 0; ee != 6; ++ee) {
253 const int sense = ent_data.getSense();
256 "Sense of the edge unknown");
257 const int order = ent_data.getOrder();
261 if (get_alpha_by_order_ptr(ent_data,
order)) {
263 get_alpha_by_order_ptr(ent_data,
order);
265 get_base_by_order_ptr(ent_data,
order);
266 get_diff_base_by_name_ptr(ent_data,
field_name) =
267 get_diff_base_by_order_ptr(ent_data,
order);
269 auto &get_n = get_base(ent_data);
270 auto &get_diff_n = get_diff_base(ent_data);
271 get_n.resize(nb_gauss_pts, nb_dofs,
false);
272 get_diff_n.resize(nb_gauss_pts, 3 * nb_dofs,
false);
275 edge_alpha.resize(nb_dofs, 4,
false);
279 for (
int i = 0;
i != edge_alpha.size1(); ++
i) {
280 int a = edge_alpha(
i, edges_nodes[ee][0]);
281 edge_alpha(
i, edges_nodes[ee][0]) =
282 edge_alpha(
i, edges_nodes[ee][1]);
283 edge_alpha(
i, edges_nodes[ee][1]) =
a;
287 order,
lambda.size1(), edge_alpha.size1(), &edge_alpha(0, 0),
291 get_alpha_by_order_ptr(ent_data,
order) =
293 get_base_by_order_ptr(ent_data,
order) =
295 get_diff_base_by_order_ptr(ent_data,
order) =
296 get_diff_base_by_name_ptr(ent_data,
field_name);
301 for (
int ee = 0; ee != 6; ++ee) {
303 ent_data.getBBAlphaIndicesSharedPtr(
field_name).reset();
304 auto &get_n = get_base(ent_data);
305 auto &get_diff_n = get_diff_base(ent_data);
306 get_n.resize(nb_gauss_pts, 0,
false);
307 get_diff_n.resize(nb_gauss_pts, 0,
false);
315 "Wrong size of ent data");
321 for (
int ff = 0; ff != 4; ++ff) {
323 const int order = ent_data.getOrder();
327 if (get_alpha_by_order_ptr(ent_data,
order)) {
329 get_alpha_by_order_ptr(ent_data,
order);
331 get_base_by_order_ptr(ent_data,
order);
332 get_diff_base_by_name_ptr(ent_data,
field_name) =
333 get_diff_base_by_order_ptr(ent_data,
order);
336 auto &get_n = get_base(ent_data);
337 auto &get_diff_n = get_diff_base(ent_data);
338 get_n.resize(nb_gauss_pts, nb_dofs,
false);
339 get_diff_n.resize(nb_gauss_pts, 3 * nb_dofs,
false);
341 auto &face_alpha = get_alpha(ent_data);
342 face_alpha.resize(nb_dofs, 4,
false);
346 senseFaceAlpha.resize(face_alpha.size1(), face_alpha.size2(),
false);
348 constexpr int tri_nodes[4][3] = {
349 {0, 1, 3}, {1, 2, 3}, {0, 2, 3}, {0, 1, 2}};
350 for (
int d = 0; d != nb_dofs; ++d)
351 for (
int n = 0;
n != 3; ++
n)
353 face_alpha(d, tri_nodes[ff][
n]);
356 order,
lambda.size1(), face_alpha.size1(), &face_alpha(0, 0),
360 get_alpha_by_order_ptr(ent_data,
order) =
362 get_base_by_order_ptr(ent_data,
order) =
364 get_diff_base_by_order_ptr(ent_data,
order) =
365 get_diff_base_by_name_ptr(ent_data,
field_name);
370 for (
int ff = 0; ff != 4; ++ff) {
372 ent_data.getBBAlphaIndicesSharedPtr(
field_name).reset();
373 auto &get_n = get_base(ent_data);
374 auto &get_diff_n = get_diff_base(ent_data);
375 get_n.resize(nb_gauss_pts, 0,
false);
376 get_diff_n.resize(nb_gauss_pts, 0,
false);
383 "Wrong size ent of ent data");
386 const int order = ent_data.getOrder();
388 if (get_alpha_by_order_ptr(ent_data,
order)) {
390 get_alpha_by_order_ptr(ent_data,
order);
392 get_base_by_order_ptr(ent_data,
order);
393 get_diff_base_by_name_ptr(ent_data,
field_name) =
394 get_diff_base_by_order_ptr(ent_data,
order);
397 auto &get_n = get_base(ent_data);
398 auto &get_diff_n = get_diff_base(ent_data);
399 get_n.resize(nb_gauss_pts, nb_dofs,
false);
400 get_diff_n.resize(nb_gauss_pts, 3 * nb_dofs,
false);
402 auto &tet_alpha = get_alpha(ent_data);
403 tet_alpha.resize(nb_dofs, 4,
false);
407 order,
lambda.size1(), tet_alpha.size1(), &tet_alpha(0, 0),
411 get_alpha_by_order_ptr(ent_data,
order) =
413 get_base_by_order_ptr(ent_data,
order) =
415 get_diff_base_by_order_ptr(ent_data,
order) =
416 get_diff_base_by_name_ptr(ent_data,
field_name);
421 ent_data.getBBAlphaIndicesSharedPtr(
field_name).reset();
422 auto &get_n = get_base(ent_data);
423 auto &get_diff_n = get_diff_base(ent_data);
424 get_n.resize(nb_gauss_pts, 0,
false);
425 get_diff_n.resize(nb_gauss_pts, 0,
false);
454 PetscErrorCode (*base_polynomials)(
int p,
double s,
double *diff_s,
double *
L,
455 double *diffL,
const int dim) =
458 int nb_gauss_pts = pts.size2();
473 nb_gauss_pts, base_polynomials);
484 const int nb_gauss_pts = pts.size2();
487 (
unsigned int)nb_gauss_pts)
489 "Base functions or nodes has wrong number of integration points "
495 auto &ptr = data.getBBAlphaIndicesSharedPtr(
field_name);
509 auto &ptr = data.getBBDiffNSharedPtr(
field_name);
515 auto get_alpha_by_name_ptr =
517 const std::string &
field_name) -> boost::shared_ptr<MatrixInt> & {
518 return data.getBBAlphaIndicesSharedPtr(
field_name);
521 auto get_base_by_name_ptr =
523 const std::string &
field_name) -> boost::shared_ptr<MatrixDouble> & {
527 auto get_diff_base_by_name_ptr =
529 const std::string &
field_name) -> boost::shared_ptr<MatrixDouble> & {
533 auto get_alpha_by_order_ptr =
534 [](
auto &data,
const size_t o) -> boost::shared_ptr<MatrixInt> & {
535 return data.getBBAlphaIndicesByOrderSharedPtr(
o);
538 auto get_base_by_order_ptr =
539 [](
auto &data,
const size_t o) -> boost::shared_ptr<MatrixDouble> & {
540 return data.getBBNByOrderSharedPtr(
o);
543 auto get_diff_base_by_order_ptr =
544 [](
auto &data,
const size_t o) -> boost::shared_ptr<MatrixDouble> & {
545 return data.getBBDiffNByOrderSharedPtr(
o);
551 "Wrong size ent of ent data");
554 const int order = ent_data.getOrder();
557 if (get_alpha_by_order_ptr(ent_data,
order)) {
559 get_alpha_by_order_ptr(ent_data,
order);
561 get_base_by_order_ptr(ent_data,
order);
562 get_diff_base_by_name_ptr(ent_data,
field_name) =
563 get_diff_base_by_order_ptr(ent_data,
order);
566 auto &get_n = get_base(ent_data);
567 auto &get_diff_n = get_diff_base(ent_data);
568 get_n.resize(nb_gauss_pts, nb_dofs,
false);
569 get_diff_n.resize(nb_gauss_pts, 3 * nb_dofs,
false);
577 "Inconsistent number of DOFs");
579 auto &tri_alpha = get_alpha(ent_data);
590 "Inconsistent number of DOFs");
592 auto &tet_alpha = get_alpha(ent_data);
593 tet_alpha.resize(nb_dofs, 4,
false);
599 std::array<int *, 6> tet_edge_ptr{
607 tet_edge_ptr.data());
610 std::array<int *, 6> tet_face_ptr{
620 face_n.data(), tet_face_ptr.data());
630 order,
lambda.size1(), tet_alpha.size1(), &tet_alpha(0, 0),
634 get_alpha_by_order_ptr(ent_data,
order) =
636 get_base_by_order_ptr(ent_data,
order) =
638 get_diff_base_by_order_ptr(ent_data,
order) =
639 get_diff_base_by_name_ptr(ent_data,
field_name);
645 ent_data.getBBAlphaIndicesSharedPtr(
field_name).reset();
646 auto &get_n = get_base(ent_data);
647 auto &get_diff_n = get_diff_base(ent_data);
648 get_n.resize(nb_gauss_pts, 0,
false);
649 get_diff_n.resize(nb_gauss_pts, 0,
false);
660 PetscErrorCode (*base_polynomials)(
int p,
double s,
double *diff_s,
double *
L,
661 double *diffL,
const int dim) =
664 int nb_gauss_pts = pts.size2();
668 double *phi_f_e[4][3];
670 double *diff_phi_f_e[4][3];
671 double *diff_phi_f[4];
679 for (
int ff = 0; ff != 4; ++ff) {
685 for (
int ee = 0; ee < 3; ee++) {
692 phi_f_e[ff][ee] = &*
N_face_edge(ff, ee).data().begin();
708 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(), phi_f_e,
709 diff_phi_f_e, nb_gauss_pts, base_polynomials);
714 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(), phi_f,
715 diff_phi_f, nb_gauss_pts, base_polynomials);
722 double *diff_phi_v_e[6];
723 double *diff_phi_v_f[4];
730 for (
int ee = 0; ee != 6; ++ee) {
741 diff_phi_v_e, nb_gauss_pts, base_polynomials);
745 for (
int ff = 0; ff != 4; ++ff) {
756 diff_phi_v_f, nb_gauss_pts, base_polynomials);
766 &data.
dataOnEntities[MBVERTEX][0].getDiffN(base)(0, 0), phi_v, diff_phi_v,
767 nb_gauss_pts, base_polynomials);
781 for (
int ff = 0; ff != 4; ff++) {
792 &base_ptr[
HVEC2], 3);
793 double *diff_base_ptr =
802 boost::shared_ptr<FTensor::Tensor1<double *, 3>> t_base_f;
803 boost::shared_ptr<FTensor::Tensor2<double *, 3, 3>> t_diff_base_f;
805 base_ptr = phi_f[ff];
806 t_base_f = boost::shared_ptr<FTensor::Tensor1<double *, 3>>(
808 &base_ptr[
HVEC2], 3));
809 diff_base_ptr = diff_phi_f[ff];
810 t_diff_base_f = boost::shared_ptr<FTensor::Tensor2<double *, 3, 3>>(
819 base_ptr = phi_f_e[ff][0];
821 &base_ptr[
HVEC2], 3);
822 diff_base_ptr = diff_phi_f_e[ff][0];
829 base_ptr = phi_f_e[ff][1];
831 &base_ptr[
HVEC2], 3);
832 diff_base_ptr = diff_phi_f_e[ff][1];
839 base_ptr = phi_f_e[ff][2];
841 &base_ptr[
HVEC2], 3);
842 diff_base_ptr = diff_phi_f_e[ff][2];
849 for (
int gg = 0; gg != nb_gauss_pts; gg++) {
850 for (
int oo = 0; oo != faces_order[ff]; oo++) {
853 t_base(
i) = t_base_f_e0(
i);
856 t_diff_base(
i,
j) = t_diff_base_f_e0(
i,
j);
859 t_base(
i) = t_base_f_e1(
i);
862 t_diff_base(
i,
j) = t_diff_base_f_e1(
i,
j);
865 t_base(
i) = t_base_f_e2(
i);
868 t_diff_base(
i,
j) = t_diff_base_f_e2(
i,
j);
874 t_base(
i) = (*t_base_f)(
i);
877 t_diff_base(
i,
j) = (*t_diff_base_f)(
i,
j);
894 &base_ptr[
HVEC2], 3);
895 double *diff_base_ptr =
904 std::vector<FTensor::Tensor1<double *, 3>> t_base_v_e;
905 t_base_v_e.reserve(6);
906 std::vector<FTensor::Tensor2<double *, 3, 3>> t_diff_base_v_e;
907 t_diff_base_v_e.reserve(6);
908 for (
int ee = 0; ee != 6; ee++) {
909 base_ptr = phi_v_e[ee];
910 diff_base_ptr = diff_phi_v_e[ee];
912 base_ptr, &base_ptr[
HVEC1], &base_ptr[
HVEC2], 3));
921 std::vector<FTensor::Tensor1<double *, 3>> t_base_v_f;
922 t_base_v_f.reserve(4);
923 std::vector<FTensor::Tensor2<double *, 3, 3>> t_diff_base_v_f;
924 t_diff_base_v_f.reserve(4);
926 for (
int ff = 0; ff != 4; ff++) {
927 base_ptr = phi_v_f[ff];
928 diff_base_ptr = diff_phi_v_f[ff];
930 base_ptr, &base_ptr[
HVEC1], &base_ptr[
HVEC2], 3));
939 boost::shared_ptr<FTensor::Tensor1<double *, 3>> t_base_v;
940 boost::shared_ptr<FTensor::Tensor2<double *, 3, 3>> t_diff_base_v;
943 t_base_v = boost::shared_ptr<FTensor::Tensor1<double *, 3>>(
945 &base_ptr[
HVEC2], 3));
946 diff_base_ptr = diff_phi_v;
947 t_diff_base_v = boost::shared_ptr<FTensor::Tensor2<double *, 3, 3>>(
955 for (
int gg = 0; gg != nb_gauss_pts; gg++) {
956 for (
int oo = 0; oo < volume_order; oo++) {
959 for (
int ee = 0; ee < 6; ee++) {
960 t_base(
i) = t_base_v_e[ee](
i);
963 t_diff_base(
i,
j) = t_diff_base_v_e[ee](
i,
j);
965 ++t_diff_base_v_e[ee];
970 for (
int ff = 0; ff < 4; ff++) {
971 t_base(
i) = t_base_v_f[ff](
i);
974 t_diff_base(
i,
j) = t_diff_base_v_f[ff](
i,
j);
976 ++t_diff_base_v_f[ff];
981 t_base(
i) = (*t_base_v)(
i);
984 t_diff_base(
i,
j) = (*t_diff_base_v)(
i,
j);
1002 "This should be used only with DEMKOWICZ_JACOBI_BASE "
1006 int nb_gauss_pts = pts.size2();
1012 double *diff_phi_f[4];
1015 for (
int ff = 0; ff != 4; ff++) {
1017 int order = volume_order > face_order ? volume_order : face_order;
1023 phi_f[ff] = &*data.
dataOnEntities[MBTRI][ff].getN(base).data().begin();
1031 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
1032 phi_f[ff], diff_phi_f[ff], nb_gauss_pts, 4);
1041 double *phi_v = &*data.
dataOnEntities[MBTET][0].getN(base).data().begin();
1042 double *diff_phi_v =
1045 volume_order, &data.
dataOnEntities[MBVERTEX][0].getN(base)(0, 0),
1046 &data.
dataOnEntities[MBVERTEX][0].getDiffN(base)(0, 0), p_f, phi_f,
1047 diff_phi_f, phi_v, diff_phi_v, nb_gauss_pts);
1051 for (
int ff = 0; ff != 4; ff++) {
1084 PetscErrorCode (*base_polynomials)(
int p,
double s,
double *diff_s,
double *
L,
1085 double *diffL,
const int dim) =
1088 int nb_gauss_pts = pts.size2();
1092 int sense[6],
order[6];
1096 double *hcurl_edge_n[6], *diff_hcurl_edge_n[6];
1097 for (
int ee = 0; ee != 6; ee++) {
1100 "data inconsistency");
1107 3 * nb_dofs,
false);
1108 data.
dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts,
1109 9 * nb_dofs,
false);
1112 diff_hcurl_edge_n[ee] =
1118 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
1119 hcurl_edge_n, diff_hcurl_edge_n, nb_gauss_pts, base_polynomials);
1121 for (
int ee = 0; ee != 6; ee++) {
1122 data.
dataOnEntities[MBEDGE][ee].getN(base).resize(nb_gauss_pts, 0,
false);
1123 data.
dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts, 0,
1135 double *hcurl_base_n[4], *diff_hcurl_base_n[4];
1136 for (
int ff = 0; ff != 4; ff++) {
1139 "data inconsistency");
1144 3 * nb_dofs,
false);
1145 data.
dataOnEntities[MBTRI][ff].getDiffN(base).resize(nb_gauss_pts,
1146 9 * nb_dofs,
false);
1149 diff_hcurl_base_n[ff] =
1161 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
1162 hcurl_base_n, diff_hcurl_base_n, nb_gauss_pts, base_polynomials);
1164 for (
int ff = 0; ff != 4; ff++) {
1165 data.
dataOnEntities[MBTRI][ff].getN(base).resize(nb_gauss_pts, 0,
false);
1166 data.
dataOnEntities[MBTRI][ff].getDiffN(base).resize(nb_gauss_pts, 0,
1177 3 * nb_vol_dofs,
false);
1178 data.
dataOnEntities[MBTET][0].getDiffN(base).resize(nb_gauss_pts,
1179 9 * nb_vol_dofs,
false);
1183 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
1186 nb_gauss_pts, base_polynomials);
1189 data.
dataOnEntities[MBTET][0].getN(base).resize(nb_gauss_pts, 0,
false);
1190 data.
dataOnEntities[MBTET][0].getDiffN(base).resize(nb_gauss_pts, 0,
false);
1204 "This should be used only with DEMKOWICZ_JACOBI_BASE "
1209 int nb_gauss_pts = pts.size2();
1213 int sense[6],
order[6];
1216 "wrong size of data structure, expected space for six edges "
1220 double *hcurl_edge_n[6], *diff_hcurl_edge_n[6];
1221 for (
int ee = 0; ee != 6; ee++) {
1224 "orintation of edges is not set");
1231 3 * nb_dofs,
false);
1232 data.
dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts,
1233 9 * nb_dofs,
false);
1236 diff_hcurl_edge_n[ee] =
1242 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
1243 hcurl_edge_n, diff_hcurl_edge_n, nb_gauss_pts);
1247 for (
int ee = 0; ee != 6; ee++) {
1248 data.
dataOnEntities[MBEDGE][ee].getN(base).resize(nb_gauss_pts, 0,
false);
1249 data.
dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts, 0,
1260 "data structure for storing face h-curl base have wrong size "
1261 "should be four but is %d",
1264 double *hcurl_base_n[4], *diff_hcurl_base_n[4];
1265 for (
int ff = 0; ff != 4; ff++) {
1268 "orintation of face is not set");
1273 3 * nb_dofs,
false);
1274 data.
dataOnEntities[MBTRI][ff].getDiffN(base).resize(nb_gauss_pts,
1275 9 * nb_dofs,
false);
1278 diff_hcurl_base_n[ff] =
1283 "data inconsistency, should be four faces");
1287 "data inconsistency, should be three nodes on face");
1292 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
1293 hcurl_base_n, diff_hcurl_base_n, nb_gauss_pts);
1297 for (
int ff = 0; ff != 4; ff++) {
1298 data.
dataOnEntities[MBTRI][ff].getN(base).resize(nb_gauss_pts, 0,
false);
1299 data.
dataOnEntities[MBTRI][ff].getDiffN(base).resize(nb_gauss_pts, 0,
1309 3 * nb_vol_dofs,
false);
1310 data.
dataOnEntities[MBTET][0].getDiffN(base).resize(nb_gauss_pts,
1311 9 * nb_vol_dofs,
false);
1315 &*data.
dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin(),
1322 data.
dataOnEntities[MBTET][0].getN(base).resize(nb_gauss_pts, 0,
false);
1323 data.
dataOnEntities[MBTET][0].getDiffN(base).resize(nb_gauss_pts, 0,
false);
1349 boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
1354 int nb_gauss_pts = pts.size2();
1358 if (pts.size1() < 3)
1361 "Wrong dimension of pts, should be at least 3 rows with coordinates");
1367 data.
dataOnEntities[MBVERTEX][0].getN(base).resize(nb_gauss_pts, 4,
1371 &pts(0, 0), &pts(1, 0), &pts(2, 0), nb_gauss_pts);
1377 (
unsigned int)nb_gauss_pts) {
1379 "Base functions or nodes has wrong number of integration points "
1383 data.
dataOnEntities[MBVERTEX][0].getDiffN(base).resize(4, 3,
false);
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ L2
field with C-1 continuity
@ HCURL
field with continuous tangents
@ HDIV
field with continuous normal traction
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
static const char *const ApproximationBaseNames[]
#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 ...
FTensor::Index< 'n', SPACE_DIM > n
constexpr double lambda
surface tension
#define NBVOLUMETET_AINSWORTH_EDGE_HDIV(P)
#define NBEDGE_DEMKOWICZ_HCURL(P)
#define NBVOLUMETET_H1(P)
Number of base functions on tetrahedron for H1 space.
#define NBVOLUMETET_AINSWORTH_HDIV(P)
#define NBVOLUMETET_AINSWORTH_HCURL(P)
#define NBFACETRI_AINSWORTH_HCURL(P)
#define NBVOLUMETET_DEMKOWICZ_HDIV(P)
PetscErrorCode H1_EdgeShapeFunctions_MBTET(int *sense, int *p, double *N, double *diffN, double *edgeN[], double *diff_edgeN[], int GDIM, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
#define NBVOLUMETET_AINSWORTH_FACE_HDIV(P)
#define NBEDGE_H1(P)
Numer of base function on edge for H1 space.
#define NBFACETRI_DEMKOWICZ_HDIV(P)
PetscErrorCode L2_Ainsworth_ShapeFunctions_MBTET(int p, double *N, double *diffN, double *L2N, double *diff_L2N, int GDIM, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Get base functions on tetrahedron for L2 space.
#define NBVOLUMETET_DEMKOWICZ_HCURL(P)
#define NBFACETRI_DEMKOWICZ_HCURL(P)
#define NBFACETRI_AINSWORTH_FACE_HDIV(P)
#define NBVOLUMETET_AINSWORTH_VOLUME_HDIV(P)
#define NBFACETRI_AINSWORTH_EDGE_HDIV(P)
PetscErrorCode H1_VolumeShapeFunctions_MBTET(int p, double *N, double *diffN, double *volumeN, double *diff_volumeN, int GDIM, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
#define NBEDGE_AINSWORTH_HCURL(P)
PetscErrorCode H1_FaceShapeFunctions_MBTET(int *faces_nodes, int *p, double *N, double *diffN, double *faceN[], double *diff_faceN[], int GDIM, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
#define NBFACETRI_H1(P)
Number of base function on triangle for H1 space.
#define NBFACETRI_AINSWORTH_HDIV(P)
#define NBVOLUMETET_L2(P)
Number of base functions on tetrahedron for L2 space.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
UBlasMatrix< int > MatrixInt
implementation of Data Operators for Forces and Sources
MoFEMErrorCode Hdiv_Ainsworth_FaceBubbleShapeFunctions(int *faces_nodes, int *p, double *N, double *diffN, double *phi_f[], double *diff_phi_f[], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face bubble functions by Ainsworth .
MoFEMErrorCode Hdiv_Demkowicz_Face_MBTET_ON_FACE(int *faces_nodes, int p, double *N, double *diffN, double *phi_f, double *diff_phi_f, int gdim, int nb)
MoFEMErrorCode Hdiv_Ainsworth_EdgeFaceShapeFunctions_MBTET(int *faces_nodes, int *p, double *N, double *diffN, double *phi_f_e[4][3], double *diff_phi_f_e[4][3], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Hdiv base functions, Edge-based face functions by Ainsworth .
MoFEMErrorCode Hdiv_Demkowicz_Interior_MBTET(int p, double *N, double *diffN, int p_face[], double *phi_f[4], double *diff_phi_f[4], double *phi_v, double *diff_phi_v, int gdim)
MoFEMErrorCode Hcurl_Ainsworth_VolumeFunctions_MBTET(int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
H-curl volume base functions.
MoFEMErrorCode Hdiv_Ainsworth_FaceBasedVolumeShapeFunctions_MBTET(int p, double *N, double *diffN, double *phi_v_f[], double *diff_phi_v_f[], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
MoFEMErrorCode Hcurl_Ainsworth_EdgeBaseFunctions_MBTET(int *sense, int *p, double *N, double *diffN, double *edgeN[], double *diff_edgeN[], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Edge based H-curl base functions on tetrahedral.
MoFEMErrorCode Hcurl_Demkowicz_FaceBaseFunctions_MBTET(int *faces_nodes, int *p, double *n, double *diff_n, double *phi[], double *diff_phi[], int nb_integration_pts)
Face base interior function.
MoFEMErrorCode Hdiv_Ainsworth_EdgeBasedVolumeShapeFunctions_MBTET(int p, double *N, double *diffN, double *phi_v_e[6], double *diff_phi_v_e[6], int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Hdiv base function, Edge-based interior (volume) functions by Ainsworth .
MoFEMErrorCode Hcurl_Demkowicz_VolumeBaseFunctions_MBTET(int p, double *n, double *diff_n, double *phi, double *diff_phi, int nb_integration_pts)
Volume base interior function.
MoFEMErrorCode Hcurl_Demkowicz_EdgeBaseFunctions_MBTET(int *sense, int *p, double *n, double *diff_n, double *phi[], double *diff_phi[], int nb_integration_pts)
Edge based H-curl base functions on tetrahedral.
MoFEMErrorCode Hcurl_Ainsworth_FaceFunctions_MBTET(int *face_nodes, int *p, double *N, double *diffN, double *phi_f[4], double *diff_phi_f[4], int nb_integration_pts, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Face H-curl functions.
MoFEMErrorCode Hdiv_Ainsworth_VolumeBubbleShapeFunctions_MBTET(int p, double *N, double *diffN, double *phi_v, double *diff_phi_v, int gdim, PetscErrorCode(*base_polynomials)(int p, double s, double *diff_s, double *L, double *diffL, const int dim))
Interior bubble functions by Ainsworth .
constexpr auto field_name
static MoFEMErrorCode generateIndicesTriTet(const int N[], int *alpha[])
static MoFEMErrorCode baseFunctionsTet(const int N, const int gdim, const int n_alpha, const int *alpha, const double *lambda, const double *grad_lambda, double *base, double *grad_base)
static MoFEMErrorCode generateIndicesEdgeTet(const int N[], int *alpha[])
static MoFEMErrorCode generateIndicesVertexTet(const int N, int *alpha)
static MoFEMErrorCode generateIndicesTetTet(const int N, int *alpha)
Class used to pass element data to calculate base functions on tet,triangle,edge.
const FieldApproximationBase copyNodeBase
const std::string fieldName
PetscErrorCode(* basePolynomialsType0)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
const FieldApproximationBase bAse
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::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
Calculate base functions on tetrahedral.
ublas::matrix< MatrixDouble > diffN_face_edge
EntPolynomialBaseCtx * cTx
MatrixDouble N_volume_bubble
MoFEMErrorCode getValueH1AinsworthBase(MatrixDouble &pts)
ublas::vector< MatrixDouble > diffN_volume_face
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode getValueL2BernsteinBezierBase(MatrixDouble &pts)
MoFEMErrorCode getValueHcurlDemkowiczBase(MatrixDouble &pts)
MoFEMErrorCode getValueHcurl(MatrixDouble &pts)
Get base functions for Hcurl space.
MoFEMErrorCode getValueH1BernsteinBezierBase(MatrixDouble &pts)
MoFEMErrorCode getValueH1(MatrixDouble &pts)
Get base functions for H1 space.
ublas::vector< MatrixDouble > diffN_face_bubble
ublas::vector< MatrixDouble > N_volume_edge
ublas::vector< MatrixDouble > N_volume_face
MoFEMErrorCode getValueHdiv(MatrixDouble &pts)
Get base functions for Hdiv space.
MoFEMErrorCode getValueHdivAinsworthBase(MatrixDouble &pts)
MoFEMErrorCode getValueL2AinsworthBase(MatrixDouble &pts)
ublas::vector< MatrixDouble > N_face_bubble
ublas::matrix< MatrixDouble > N_face_edge
MoFEMErrorCode getValueL2(MatrixDouble &pts)
Get base functions for L2 space.
MatrixDouble diffN_volume_bubble
MoFEMErrorCode getValueHdivDemkowiczBase(MatrixDouble &pts)
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
ublas::vector< MatrixDouble > diffN_volume_edge
MoFEMErrorCode getValueHcurlAinsworthBase(MatrixDouble &pts)
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.