16 boost::shared_ptr<BaseFunctionCtx> ctx_ptr) {
21 int nb_gauss_pts = pts.size2();
28 "Wrong dimension of pts, should be at least 3 rows with coordinates");
35 data.
dataOnEntities[MBVERTEX][0].getN(base).resize(nb_gauss_pts, 2,
39 &pts(0, 0), nb_gauss_pts);
45 (
unsigned int)nb_gauss_pts)
47 "Base functions or nodes has wrong number of integration points "
51 data.
dataOnEntities[MBVERTEX][0].getDiffN(base).resize(nb_gauss_pts, 2 * 1,
53 for (
auto gg = 0; gg != nb_gauss_pts; ++gg)
106 const int nb_gauss_pts = pts.size2();
109 auto &ptr = data.getBBAlphaIndicesSharedPtr(
field_name);
123 auto &ptr = data.getBBDiffNSharedPtr(
field_name);
130 auto &get_diff_n = get_diff_base(data.
dataOnEntities[MBVERTEX][0]);
131 get_n.resize(nb_gauss_pts, 2,
false);
132 get_diff_n.resize(nb_gauss_pts, 2,
false);
137 (
unsigned int)nb_gauss_pts)
139 "Base functions or nodes has wrong number of integration points "
145 vertex_alpha.resize(2, 2,
false);
146 vertex_alpha(0, 0) = data.
dataOnEntities[MBVERTEX][0].getBBNodeOrder()[0];
147 vertex_alpha(0, 1) = 0;
148 vertex_alpha(1, 0) = 0;
149 vertex_alpha(1, 1) = data.
dataOnEntities[MBVERTEX][0].getBBNodeOrder()[1];
152 1, nb_gauss_pts, vertex_alpha.size1(), &vertex_alpha(0, 0), &
lambda(0, 0),
154 std::array<double, 2>
f = {
155 boost::math::factorial<double>(
157 boost::math::factorial<double>(
160 for (
int g = 0;
g != nb_gauss_pts; ++
g)
161 for (
int n = 0;
n != 2; ++
n) {
163 get_diff_n(
g,
n) *=
f[
n];
169 "Wrong size ent of ent data");
176 get_n.resize(nb_gauss_pts, nb_dofs,
false);
177 get_diff_n.resize(nb_gauss_pts, nb_dofs,
false);
181 edge_alpha.resize(nb_dofs, 2);
184 order, nb_gauss_pts, edge_alpha.size1(), &edge_alpha(0, 0),
189 get_n.resize(nb_gauss_pts, 0,
false);
190 get_diff_n.resize(nb_gauss_pts, 0,
false);
201 PetscErrorCode (*base_polynomials)(
int p,
double s,
double *diff_s,
double *
L,
202 double *
diffL,
const int dim) =
205 int nb_gauss_pts = pts.size2();
207 const int side_number = 0;
224 for (
int gg = 0; gg != nb_gauss_pts; gg++) {
226 double s = 2 * pts(0, gg) - 1;
234 &*
L.data().begin(), &*
diffL.data().begin(), 1);
236 for (
unsigned int pp = 0;
266 int nb_gauss_pts = pts.size2();
268 const int side_number = 0;
279 double diff_shape[] = {-1, 1};
283 for (
int gg = 0; gg != nb_gauss_pts; gg++) {
284 const double mu0 = 1.0 - pts(0, gg);
285 const double mu1 = pts(0, gg);
291 order, &*shape.data().begin(), diff_shape,
292 &*data.
dataOnEntities[MBEDGE][side_number].getN(base).data().begin(),
327 PetscErrorCode (*base_polynomials)(
int p,
double s,
double *diff_s,
double *
L,
328 double *
diffL,
const int dim) =
334 int nb_gauss_pts = pts.size2();
336 constexpr
int side_number = 0;
345 &*data.
dataOnEntities[MBEDGE][side_number].getN(base).data().begin();
347 &*data.
dataOnEntities[MBEDGE][side_number].getDiffN(base).data().begin();
354 for (
int gg = 0; gg != nb_gauss_pts; gg++) {
355 double mu = 2 * pts(0, gg) - 1;
359 fun_n[qd_shift +
n] =
l[
n];
360 diff_fun_n[qd_shift +
n] = diff_l[
n];
375 "Make no sense, unless problem is 2d (2d not implemented yet)");
385 PetscErrorCode (*base_polynomials)(
int p,
double s,
double *diff_s,
double *
L,
386 double *
diffL,
const int dim) =
389 int nb_gauss_pts = pts.size2();
399 data.
dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 3 * nb_dofs,
401 data.
dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
407 &*data.
dataOnEntities[MBEDGE][0].getN(base).data().begin(),
nullptr,
408 nb_gauss_pts, base_polynomials);
411 data.
dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 0,
false);
412 data.
dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
426 int nb_gauss_pts = pts.size2();
431 "No data structure to store base functions");
437 data.
dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 3 * nb_dofs,
439 data.
dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,
450 data.
dataOnEntities[MBEDGE][0].getN(base).resize(nb_gauss_pts, 0,
false);
451 data.
dataOnEntities[MBEDGE][0].getDiffN(base).resize(nb_gauss_pts, 0,