v0.9.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MoFEM::FatPrismPolynomialBase Struct Reference

Calculate base functions on tetrahedralFIXME: Need moab and mofem finite element structure to work (that not perfect) More...

#include <src/approximation/FatPrismPolynomialBase.hpp>

Inheritance diagram for MoFEM::FatPrismPolynomialBase:
[legend]
Collaboration diagram for MoFEM::FatPrismPolynomialBase:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (const MOFEMuuid &uuid, BaseFunctionUnknownInterface **iface) const
 
 FatPrismPolynomialBase ()
 
 ~FatPrismPolynomialBase ()
 
MoFEMErrorCode getValue (MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
 
- Public Member Functions inherited from MoFEM::BaseFunction
 BaseFunction ()
 
virtual MoFEMErrorCode getValue (MatrixDouble &pts_x, MatrixDouble &pts_t, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
 
- Public Member Functions inherited from MoFEM::BaseFunctionUnknownInterface
virtual ~BaseFunctionUnknownInterface ()=default
 

Private Member Functions

MoFEMErrorCode getValueH1TrianglesOnly ()
 
MoFEMErrorCode getValueH1ThroughThickness ()
 
MoFEMErrorCode getValueH1 (MatrixDouble &pts)
 
MoFEMErrorCode getValueL2 (MatrixDouble &pts)
 
MoFEMErrorCode getValueHdiv (MatrixDouble &pts)
 
MoFEMErrorCode getValueHcurl (MatrixDouble &pts)
 

Private Attributes

FatPrismPolynomialBaseCtxcTx
 
MatrixDouble N
 
MatrixDouble diffN
 

Detailed Description

Calculate base functions on tetrahedral

FIXME: Need moab and mofem finite element structure to work (that not perfect)

Definition at line 71 of file FatPrismPolynomialBase.hpp.

Constructor & Destructor Documentation

◆ FatPrismPolynomialBase()

FatPrismPolynomialBase::FatPrismPolynomialBase ( )

Definition at line 78 of file FatPrismPolynomialBase.cpp.

78 {}

◆ ~FatPrismPolynomialBase()

FatPrismPolynomialBase::~FatPrismPolynomialBase ( )

Definition at line 77 of file FatPrismPolynomialBase.cpp.

77 {}

Member Function Documentation

◆ getValue()

MoFEMErrorCode FatPrismPolynomialBase::getValue ( MatrixDouble pts,
boost::shared_ptr< BaseFunctionCtx ctx_ptr 
)
virtual

Reimplemented from MoFEM::BaseFunction.

Definition at line 81 of file FatPrismPolynomialBase.cpp.

82  {
83 
85 
87  CHKERR ctx_ptr->query_interface(IDD_FATPRISM_BASE_FUNCTION, &iface);
88  cTx = reinterpret_cast<FatPrismPolynomialBaseCtx *>(iface);
89  if (!cTx->fePtr)
90  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
91  "Pointer to element should be given "
92  "when EntPolynomialBaseCtx is constructed "
93  "(use different constructor)");
94 
95  int nb_gauss_pts = pts.size2();
96  if (!nb_gauss_pts)
98 
99  if (pts.size1() < 3)
100  SETERRQ(
101  PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
102  "Wrong dimension of pts, should be at least 3 rows with coordinates");
103 
104  const FieldApproximationBase base = cTx->bAse;
106 
107  if (cTx->copyNodeBase == LASTBASE)
108  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
109  "It is assumed that base for vertices is calculated");
110  else
111  data.dataOnEntities[MBVERTEX][0].getNSharedPtr(base) =
112  data.dataOnEntities[MBVERTEX][0].getNSharedPtr(cTx->copyNodeBase);
113 
114  data.dataOnEntities[MBVERTEX][0].getN(base).resize(nb_gauss_pts, 6, false);
115  data.dataOnEntities[MBVERTEX][0].getDiffN(base).resize(nb_gauss_pts, 12,
116  false);
117  if (data.dataOnEntities[MBVERTEX][0].getN(base).size1() !=
118  (unsigned int)nb_gauss_pts)
119  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
120  "Base functions or nodes has wrong number of integration points "
121  "for base %s",
122  ApproximationBaseNames[base]);
123 
124  if (cTx->gaussPtsTrianglesOnly.size2() *
125  cTx->gaussPtsThroughThickness.size2() !=
126  pts.size2())
127  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
128 
129  switch (cTx->sPace) {
130  case H1:
133  CHKERR getValueH1(pts);
134  break;
135  case HDIV:
136  CHKERR getValueHdiv(pts);
137  break;
138  case HCURL:
139  CHKERR getValueHcurl(pts);
140  break;
141  case L2:
142  CHKERR getValueL2(pts);
143  break;
144  default:
145  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
146  }
147 
149 }
FatPrismPolynomialBaseCtx * cTx
field with continuous normal traction
Definition: definitions.h:173
data structure for finite element entityIt keeps that about indices of degrees of freedom,...
std::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
const FieldApproximationBase bAse
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
const FieldApproximationBase copyNodeBase
MoFEMErrorCode getValueHdiv(MatrixDouble &pts)
static const char *const ApproximationBaseNames[]
Definition: definitions.h:158
FieldApproximationBase
approximation base
Definition: definitions.h:144
MoFEMErrorCode getValueHcurl(MatrixDouble &pts)
DataForcesAndSourcesCore & dAta
field with continuous tangents
Definition: definitions.h:172
#define CHKERR
Inline error check.
Definition: definitions.h:596
const NumeredEntFiniteElement * fePtr
static const MOFEMuuid IDD_FATPRISM_BASE_FUNCTION
MoFEMErrorCode getValueH1(MatrixDouble &pts)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
continuous field
Definition: definitions.h:171
MoFEMErrorCode getValueL2(MatrixDouble &pts)
field with C-1 continuity
Definition: definitions.h:174

◆ getValueH1()

MoFEMErrorCode FatPrismPolynomialBase::getValueH1 ( MatrixDouble pts)
private

Definition at line 202 of file FatPrismPolynomialBase.cpp.

202  {
204 
206  const FieldApproximationBase base = cTx->bAse;
207 
208  PetscErrorCode (*base_polynomials)(int p, double s, double *diff_s, double *L,
209  double *diffL, const int dim) =
211 
212  int nb_gauss_pts = pts.size2();
213  int nb_gauss_pts_on_faces = cTx->gaussPtsTrianglesOnly.size2();
214  int nb_gauss_pts_through_thickness = cTx->gaussPtsThroughThickness.size2();
215 
216  // nodes
217  // linear for xi, eta and zeta
218  auto &vert_dat = data.dataOnEntities[MBVERTEX][0];
219  vert_dat.getN(base).resize(nb_gauss_pts, 6, false);
220  vert_dat.getDiffN(base).resize(nb_gauss_pts, 18);
221  noalias(vert_dat.getN(base)) = data.dataOnEntities[MBVERTEX][0].getN(NOBASE);
222  noalias(vert_dat.getDiffN(base)) =
223  data.dataOnEntities[MBVERTEX][0].getDiffN(NOBASE);
224 
225  auto &vert_n = vert_dat.getN(base);
226  auto &vert_diff_n = vert_dat.getDiffN(base);
227 
228  constexpr int prism_edge_map[9][2] = {{0, 1}, {1, 2}, {2, 0}, {0, 3}, {1, 4},
229  {2, 5}, {3, 4}, {4, 5}, {5, 3}};
230 
231  auto edge_through_thickness = [&](const int ee) {
233  // through thickness ho approximation
234  // linear xi,eta, ho terms for zeta
235 
236  auto &thickness_ent = cTx->dataTroughThickness.dataOnEntities[MBEDGE][ee];
237  auto &prism_ent = data.dataOnEntities[MBEDGE][ee];
238 
239  int order = thickness_ent.getDataOrder();
240  int nb_dofs = NBEDGE_H1(order);
241  if ((unsigned int)nb_dofs != thickness_ent.getN(base).size2())
242  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
243  "nb_dofs != nb_dofs %d != %d", nb_dofs,
244  thickness_ent.getN(base).size2());
245  prism_ent.getN(base).resize(nb_gauss_pts, nb_dofs, false);
246  prism_ent.getDiffN(base).resize(nb_gauss_pts, 3 * nb_dofs, false);
247  if (nb_dofs == 0)
249 
250 
251  int gg = 0;
252  for (int ggf = 0; ggf < nb_gauss_pts_on_faces; ggf++) {
253 
254  for (int ggt = 0; ggt < nb_gauss_pts_through_thickness; ggt++, gg++) {
255  double extrude = vert_n(gg, prism_edge_map[ee][0]) +
256  vert_n(gg, prism_edge_map[ee][1]);
257 
258  double diff_extrude[3];
259  for (auto d : {0, 1, 2})
260  diff_extrude[d] = vert_diff_n(gg, 3 * prism_edge_map[ee][0] + d) +
261  vert_diff_n(gg, 3 * prism_edge_map[ee][1] + d);
262 
263  double n0 = vert_n(gg, 0) + vert_n(gg, 1) + vert_n(gg, 2);
264  double n1 = vert_n(gg, 3) + vert_n(gg, 4) + vert_n(gg, 5);
265 
266  // Calculate base through thickness directly from shape fuctions. I
267  // leave that bit of the code, could be useful for integration on the
268  // skeleton.
269 
270  // double l[order + 1], diff_l[3 * (order + 1)];
271  // double ksi = n1 - n0;
272  // double diff_ksi[3];
273  // for (auto d : {0, 1, 2})
274  // diff_ksi[d] =
275  // vert_diff_n(gg, 3 * 3 + d) + vert_diff_n(gg, 3 * 4 + d) +
276  // vert_diff_n(gg, 3 * 5 + d) - vert_diff_n(gg, 3 * 0 + d) -
277  // vert_diff_n(gg, 3 * 1 + d) - vert_diff_n(gg, 3 * 2 + d);
278  // if(sense == -1) {
279  // ksi *= -1;
280  // for (auto d : {0, 1, 2})
281  // diff_ksi[d] *= -1;
282  // }
283  // CHKERR base_polynomials(order - 2, ksi, diff_ksi, l, diff_l, 3);
284 
285  double *l = &(thickness_ent.getN(base)(ggt, 0));
286  double *diff_l_1d = &(thickness_ent.getDiffN(base)(ggt, 0));
287 
288  double bubble = n0 * n1;
289  double diff_bubble[3];
290  for (auto d : {0, 1, 2})
291  diff_bubble[d] =
292  n0 * (vert_diff_n(gg, 3 * 3 + d) + vert_diff_n(gg, 3 * 4 + d) +
293  vert_diff_n(gg, 3 * 5 + d)) +
294 
295  n1 * (vert_diff_n(gg, 3 * 0 + d) + vert_diff_n(gg, 3 * 1 + d) +
296  vert_diff_n(gg, 3 * 2 + d));
297 
298  for (int dd = 0; dd != nb_dofs; dd++) {
299 
300  prism_ent.getN(base)(gg, dd) = extrude * bubble * l[dd];
301  for (auto d : {0, 1, 2})
302  prism_ent.getDiffN(base)(gg, 3 * dd + d) =
303  diff_extrude[d] * bubble * l[dd] +
304  extrude * diff_bubble[d] * l[dd];
305 
306  prism_ent.getDiffN(base)(gg, 3 * dd + 2) +=
307  extrude * bubble * 2 * diff_l_1d[dd];
308 
309  }
310  }
311  }
313  };
314 
315  auto edge_on_the_triangle = [&](const int ee) {
317  // on triangles ho approximation
318  // ho terms on edges, linear zeta
319  int nb_dofs =
320  cTx->dataTrianglesOnly.dataOnEntities[MBEDGE][ee].getN(base).size2();
321  data.dataOnEntities[MBEDGE][ee].getN(base).resize(nb_gauss_pts, nb_dofs,
322  false);
323  data.dataOnEntities[MBEDGE][ee].getDiffN(base).resize(nb_gauss_pts,
324  3 * nb_dofs, false);
325  for (int dd = 0; dd < nb_dofs; dd++) {
326  int gg = 0;
327  for (int ggf = 0; ggf < nb_gauss_pts_on_faces; ggf++) {
328  double tri_n = cTx->dataTrianglesOnly.dataOnEntities[MBEDGE][ee].getN(
329  base)(ggf, dd);
330  double dksi_tri_n =
331  cTx->dataTrianglesOnly.dataOnEntities[MBEDGE][ee].getDiffN(base)(
332  ggf, 2 * dd + 0);
333  double deta_tri_n =
334  cTx->dataTrianglesOnly.dataOnEntities[MBEDGE][ee].getDiffN(base)(
335  ggf, 2 * dd + 1);
336  for (int ggt = 0; ggt < nb_gauss_pts_through_thickness; ggt++, gg++) {
337  double zeta = cTx->gaussPtsThroughThickness(0, ggt);
338  double dzeta, edge_shape;
339  if (ee < 3) {
340  dzeta = diffN_MBEDGE0;
341  edge_shape = N_MBEDGE0(zeta);
342  } else {
343  dzeta = diffN_MBEDGE1;
344  edge_shape = N_MBEDGE1(zeta);
345  }
346  data.dataOnEntities[MBEDGE][ee].getN(base)(gg, dd) =
347  tri_n * edge_shape;
348  data.dataOnEntities[MBEDGE][ee].getDiffN(base)(gg, 3 * dd + 0) =
349  dksi_tri_n * edge_shape;
350  data.dataOnEntities[MBEDGE][ee].getDiffN(base)(gg, 3 * dd + 1) =
351  deta_tri_n * edge_shape;
352  data.dataOnEntities[MBEDGE][ee].getDiffN(base)(gg, 3 * dd + 2) =
353  tri_n * dzeta;
354  }
355  }
356  }
358  };
359 
360  auto trinagle_through_thickness = [&](const int ff) {
362  int nb_dofs;
363  nb_dofs =
364  cTx->dataTrianglesOnly.dataOnEntities[MBTRI][ff].getN(base).size2();
365  data.dataOnEntities[MBTRI][ff].getN(base).resize(nb_gauss_pts, nb_dofs,
366  false);
367  data.dataOnEntities[MBTRI][ff].getDiffN(base).resize(nb_gauss_pts,
368  3 * nb_dofs, false);
369  for (int dd = 0; dd < nb_dofs; dd++) {
370  int gg = 0;
371  for (int ggf = 0; ggf < nb_gauss_pts_on_faces; ggf++) {
372  double tri_n = cTx->dataTrianglesOnly.dataOnEntities[MBTRI][ff].getN(
373  base)(ggf, dd);
374  double dksi_tri_n[2];
375  for (int kk = 0; kk < 2; kk++) {
376  dksi_tri_n[kk] =
377  cTx->dataTrianglesOnly.dataOnEntities[MBTRI][ff].getDiffN(base)(
378  ggf, 2 * dd + kk);
379  }
380  for (int ggt = 0; ggt < nb_gauss_pts_through_thickness; ggt++, gg++) {
381  double zeta = cTx->gaussPtsThroughThickness(0, ggt);
382  double dzeta, edge_shape;
383  if (ff == 3) {
384  dzeta = diffN_MBEDGE0;
385  edge_shape = N_MBEDGE0(zeta);
386  } else {
387  dzeta = diffN_MBEDGE1;
388  edge_shape = N_MBEDGE1(zeta);
389  }
390  data.dataOnEntities[MBTRI][ff].getN(base)(gg, dd) =
391  tri_n * edge_shape;
392  for (auto kk : {0, 1})
393  data.dataOnEntities[MBTRI][ff].getDiffN(base)(gg, 3 * dd + kk) =
394  dksi_tri_n[kk] * edge_shape;
395  data.dataOnEntities[MBTRI][ff].getDiffN(base)(gg, 3 * dd + 2) =
396  tri_n * dzeta;
397  }
398  }
399  }
401  };
402 
403  auto quads_base = [&]() {
405  int quads_nodes[3 * 4];
406  int quad_order[3] = {0, 0, 0};
407  double *quad_n[3], *diff_quad_n[3];
408  SideNumber_multiIndex &side_table =
409  const_cast<SideNumber_multiIndex &>(cTx->fePtr->getSideNumberTable());
410  SideNumber_multiIndex::nth_index<1>::type::iterator siit;
411  siit = side_table.get<1>().lower_bound(boost::make_tuple(MBQUAD, 0));
412  SideNumber_multiIndex::nth_index<1>::type::iterator hi_siit;
413  hi_siit = side_table.get<1>().upper_bound(boost::make_tuple(MBQUAD, 3));
414  if (std::distance(siit, hi_siit) != 3)
415  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
416  "Expected three quads on prisms");
417  EntityHandle ent = cTx->fePtr->getEnt();
418  int num_nodes;
419  const EntityHandle *conn;
420  CHKERR cTx->mOab.get_connectivity(ent, conn, num_nodes, true);
421  for (; siit != hi_siit; ++siit) {
422  int side = siit->get()->side_number;
423  if(side < 0 && side > 2)
424  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
425  "Side in range 0,1,2 expected");
426  int num_nodes_quad;
427  const EntityHandle *conn_quad;
428  EntityHandle quad = siit->get()->ent;
429  CHKERR cTx->mOab.get_connectivity(quad, conn_quad, num_nodes_quad, true);
430  for (int nn = 0; nn < num_nodes_quad; nn++) {
431  quads_nodes[4 * side + nn] =
432  std::distance(conn, std::find(conn, conn + 6, conn_quad[nn]));
433  }
434  int order = data.dataOnEntities[MBQUAD][side].getDataOrder();
435  quad_order[side] = order;
436  data.dataOnEntities[MBQUAD][side].getN(base).resize(
437  nb_gauss_pts, NBFACEQUAD_H1(order), false);
438  data.dataOnEntities[MBQUAD][side].getDiffN(base).resize(
439  nb_gauss_pts, 3 * NBFACEQUAD_H1(order), false);
440  if (data.dataOnEntities[MBQUAD][side].getN(base).size2() > 0) {
441  quad_n[side] =
442  &*data.dataOnEntities[MBQUAD][side].getN(base).data().begin();
443  diff_quad_n[side] =
444  &*data.dataOnEntities[MBQUAD][side].getDiffN(base).data().begin();
445  } else {
446  quad_n[side] = NULL;
447  diff_quad_n[side] = NULL;
448  }
449  }
450  if (quad_order[0] > 0 || quad_order[1] > 0 || quad_order[2] > 0) {
451  double *vertex_n =
452  &*data.dataOnEntities[MBVERTEX][0].getN(base).data().begin();
453  double *diff_vertex_n =
454  &*data.dataOnEntities[MBVERTEX][0].getDiffN(base).data().begin();
455  CHKERR H1_QuadShapeFunctions_MBPRISM(quads_nodes, quad_order, vertex_n,
456  diff_vertex_n, quad_n, diff_quad_n,
457  nb_gauss_pts, base_polynomials);
458  }
460  };
461 
462  auto prim_base = [&]() {
464  int order = data.dataOnEntities[MBPRISM][0].getDataOrder();
465  double *vertex_n = &data.dataOnEntities[MBVERTEX][0].getN(base)(0, 0);
466  double *diff_vertex_n =
467  &data.dataOnEntities[MBVERTEX][0].getDiffN(base)(0, 0);
468  data.dataOnEntities[MBPRISM][0].getN(base).resize(
469  nb_gauss_pts, NBVOLUMEPRISM_H1(order), false);
470  data.dataOnEntities[MBPRISM][0].getDiffN(base).resize(
471  nb_gauss_pts, 3 * NBVOLUMEPRISM_H1(order), false);
472  if (NBVOLUMEPRISM_H1(order) > 0) {
474  order, vertex_n, diff_vertex_n,
475  &data.dataOnEntities[MBPRISM][0].getN(base)(0, 0),
476  &data.dataOnEntities[MBPRISM][0].getDiffN(base)(0, 0), nb_gauss_pts,
477  base_polynomials);
478  }
480  };
481 
482  // edges on triangles
483  int ee = 0;
484  for (; ee <= 2; ++ee)
485  CHKERR edge_on_the_triangle(ee);
486  for (; ee <= 5; ++ee)
487  CHKERR edge_through_thickness(ee);
488  for (; ee <= 8; ++ee)
489  CHKERR edge_on_the_triangle(ee);
490 
491  // triangles
492  // ho on triangles, linear zeta
493  for (int ff = 3; ff <= 4; ++ff)
494  CHKERR trinagle_through_thickness(ff);
495 
496  // quads
497  // higher order edges and zeta
498  CHKERR quads_base();
499 
500  // prism
501  CHKERR prim_base();
502 
504 }
FatPrismPolynomialBaseCtx * cTx
#define NBEDGE_H1(P)
Numer of base function on edge for H1 space.
PetscErrorCode(* basePolynomialsType0)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
data structure for finite element entityIt keeps that about indices of degrees of freedom,...
std::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
DataForcesAndSourcesCore & dataTroughThickness
const FieldApproximationBase bAse
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define N_MBEDGE1(x)
edge shape function
Definition: fem_tools.h:80
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
#define diffN_MBEDGE1
derivative of edge shape function
Definition: fem_tools.h:82
DataForcesAndSourcesCore & dataTrianglesOnly
#define N_MBEDGE0(x)
edge shape function
Definition: fem_tools.h:79
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
FieldApproximationBase
approximation base
Definition: definitions.h:144
PetscErrorCode H1_QuadShapeFunctions_MBPRISM(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))
Definition: h1.c:586
#define NBFACEQUAD_H1(P)
Number of base functions on quad for H1 space.
DataForcesAndSourcesCore & dAta
PetscErrorCode H1_VolumeShapeFunctions_MBPRISM(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))
Definition: h1.c:707
#define diffN_MBEDGE0
derivative of edge shape function
Definition: fem_tools.h:81
SideNumber_multiIndex & getSideNumberTable() const
#define CHKERR
Inline error check.
Definition: definitions.h:596
const NumeredEntFiniteElement * fePtr
#define NBVOLUMEPRISM_H1(P)
Number of base functions on prism for H1 space.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
EntityHandle getEnt() const
Get element entity.

◆ getValueH1ThroughThickness()

MoFEMErrorCode FatPrismPolynomialBase::getValueH1ThroughThickness ( )
private

Definition at line 161 of file FatPrismPolynomialBase.cpp.

161  {
163 
164  // DataForcesAndSourcesCore& data = cTx->dAta;
165  const FieldApproximationBase base = cTx->bAse;
166  PetscErrorCode (*base_polynomials)(int p, double s, double *diff_s, double *L,
167  double *diffL, const int dim) =
169 
170  int nb_gauss_pts_through_thickness = cTx->gaussPtsThroughThickness.size2();
171  // Calculate Legendre approx. on edges
172  for (unsigned int ee = 3; ee <= 5; ee++) {
173  auto &ent_data = cTx->dataTroughThickness.dataOnEntities[MBEDGE][ee];
174  int sense = ent_data.getSense();
175  int order = ent_data.getDataOrder();
176  int nb_dofs = NBEDGE_H1(order);
177  ent_data.getN(base).resize(nb_gauss_pts_through_thickness, nb_dofs, false);
178  ent_data.getDiffN(base).resize(nb_gauss_pts_through_thickness, nb_dofs,
179  false);
180 
181  if (nb_dofs > 0) {
182  double diff_s = 1.; // s = s(xi), ds/dxi = 2., because change of basis
183  for (int gg = 0; gg < nb_gauss_pts_through_thickness; gg++) {
184  double s =
185  2 * cTx->gaussPtsThroughThickness(0, gg) - 1; // makes form -1..1
186  if (sense == -1) {
187  s *= -2;
188  diff_s *= -2;
189  }
190  // calculate Legendre polynomials at integration points on edges
191  // thorough thickness
192  CHKERR base_polynomials(order - 2, s, &diff_s,
193  &ent_data.getN(base)(gg, 0),
194  &ent_data.getDiffN(base)(gg, 0), 1);
195  }
196  }
197  }
198 
200 }
FatPrismPolynomialBaseCtx * cTx
#define NBEDGE_H1(P)
Numer of base function on edge for H1 space.
PetscErrorCode(* basePolynomialsType0)(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
std::array< boost::ptr_vector< EntData >, MBMAXTYPE > dataOnEntities
DataForcesAndSourcesCore & dataTroughThickness
const FieldApproximationBase bAse
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
FieldApproximationBase
approximation base
Definition: definitions.h:144
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getValueH1TrianglesOnly()

MoFEMErrorCode FatPrismPolynomialBase::getValueH1TrianglesOnly ( )
private

Definition at line 151 of file FatPrismPolynomialBase.cpp.

151  {
153  const FieldApproximationBase base = cTx->bAse;
156  boost::shared_ptr<BaseFunctionCtx>(new FlatPrismPolynomialBaseCtx(
157  cTx->dataTrianglesOnly, cTx->mOab, cTx->fePtr, H1, base, NOBASE)));
159 }
FatPrismPolynomialBaseCtx * cTx
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
const FieldApproximationBase bAse
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
Calculate base functions on tetrahedralFIXME: Need moab and mofem finite element structure to work (t...
DataForcesAndSourcesCore & dataTrianglesOnly
FieldApproximationBase
approximation base
Definition: definitions.h:144
Class used to pass element data to calculate base functions on flat prism.
#define CHKERR
Inline error check.
Definition: definitions.h:596
const NumeredEntFiniteElement * fePtr
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
continuous field
Definition: definitions.h:171

◆ getValueHcurl()

MoFEMErrorCode FatPrismPolynomialBase::getValueHcurl ( MatrixDouble pts)
private

Definition at line 516 of file FatPrismPolynomialBase.cpp.

516  {
517  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
518 }

◆ getValueHdiv()

MoFEMErrorCode FatPrismPolynomialBase::getValueHdiv ( MatrixDouble pts)
private

Definition at line 512 of file FatPrismPolynomialBase.cpp.

512  {
513  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
514 }

◆ getValueL2()

MoFEMErrorCode FatPrismPolynomialBase::getValueL2 ( MatrixDouble pts)
private

Definition at line 506 of file FatPrismPolynomialBase.cpp.

506  {
508  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
510 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ query_interface()

MoFEMErrorCode FatPrismPolynomialBase::query_interface ( const MOFEMuuid uuid,
BaseFunctionUnknownInterface **  iface 
) const
virtual

Reimplemented from MoFEM::BaseFunction.

Definition at line 62 of file FatPrismPolynomialBase.cpp.

63  {
65  *iface = NULL;
66  if (uuid == IDD_FATPRISM_BASE_FUNCTION) {
67  *iface = const_cast<FatPrismPolynomialBase *>(this);
69  } else {
70  SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY, "wrong interference");
71  }
72  ierr = BaseFunction::query_interface(uuid, iface);
73  CHKERRG(ierr);
75 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
MoFEMErrorCode query_interface(const MOFEMuuid &uuid, MoFEM::BaseFunctionUnknownInterface **iface) const
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
static const MOFEMuuid IDD_FATPRISM_BASE_FUNCTION

Member Data Documentation

◆ cTx

FatPrismPolynomialBaseCtx* MoFEM::FatPrismPolynomialBase::cTx
private

Definition at line 83 of file FatPrismPolynomialBase.hpp.

◆ diffN

MatrixDouble MoFEM::FatPrismPolynomialBase::diffN
private

Definition at line 99 of file FatPrismPolynomialBase.hpp.

◆ N

MatrixDouble MoFEM::FatPrismPolynomialBase::N
private

Definition at line 98 of file FatPrismPolynomialBase.hpp.


The documentation for this struct was generated from the following files: