Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetHoContravariantPiolaTransform Struct Reference

Apply contravariant (Piola) transfer to Hdiv space for HO geometr. More...

#include <src/finite_elements/DataOperators.hpp>

Inheritance diagram for MoFEM::OpSetHoContravariantPiolaTransform:
Collaboration diagram for MoFEM::OpSetHoContravariantPiolaTransform:

Public Member Functions

 OpSetHoContravariantPiolaTransform (VectorDouble &det_jac, MatrixDouble &jac)
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Operator for linear form, usually to calculate values on left hand side. More...
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true, const bool do_vertices=true, const bool do_edges=true, const bool do_quads=true, const bool do_tris=true, const bool do_tets=true, const bool do_prisms=true)
virtual ~DataOperator ()
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on right hand side. More...
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data, bool symm=true)
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=true)
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
void setSymm ()
 set if operator is executed taking in account symmetry More...
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...

Public Attributes

FTensor::Index< 'i', 3 > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
MatrixDouble piolaN
MatrixDouble piolaDiffN
- Public Attributes inherited from MoFEM::DataOperator
bool sYmm
 If true assume that matrix is symmetric structure. More...
bool doVertices
 If false skip vertices. More...
bool doEdges
 If false skip edges. More...
bool doQuads
bool doTris
bool doTets
bool doPrisms

Detailed Description

Apply contravariant (Piola) transfer to Hdiv space for HO geometr.

Definition at line 391 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetHoContravariantPiolaTransform()

MoFEM::OpSetHoContravariantPiolaTransform::OpSetHoContravariantPiolaTransform ( VectorDouble det_jac,
MatrixDouble jac 

Definition at line 399 of file DataOperators.hpp.

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetHoContravariantPiolaTransform::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 

Operator for linear form, usually to calculate values on left hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 1071 of file DataOperators.cpp.

1072  {
1075  if (type != MBTRI && type != MBTET)
1078  for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
1080  FieldApproximationBase base = ApproximationBaseArray[b];
1082  unsigned int nb_gauss_pts = data.getHdivN(base).size1();
1083  unsigned int nb_base_functions = data.getHdivN(base).size2() / 3;
1084  piolaN.resize(nb_gauss_pts, data.getHdivN(base).size2(), false);
1085  piolaDiffN.resize(nb_gauss_pts, data.getDiffHdivN(base).size2(), false);
1087  auto t_n = data.getFTensor1HdivN<3>(base);
1088  double *t_transformed_n_ptr = &*piolaN.data().begin();
1090  t_transformed_n_ptr, // HDIV0
1091  &t_transformed_n_ptr[HDIV1], &t_transformed_n_ptr[HDIV2]);
1092  auto t_diff_n = data.getFTensor2DiffHdivN<3, 3>(base);
1093  double *t_transformed_diff_n_ptr = &*piolaDiffN.data().begin();
1094  FTensor::Tensor2<double *, 3, 3> t_transformed_diff_n(
1095  t_transformed_diff_n_ptr, &t_transformed_diff_n_ptr[HDIV0_1],
1096  &t_transformed_diff_n_ptr[HDIV0_2], &t_transformed_diff_n_ptr[HDIV1_0],
1097  &t_transformed_diff_n_ptr[HDIV1_1], &t_transformed_diff_n_ptr[HDIV1_2],
1098  &t_transformed_diff_n_ptr[HDIV2_0], &t_transformed_diff_n_ptr[HDIV2_1],
1099  &t_transformed_diff_n_ptr[HDIV2_2], 9);
1101  FTensor::Tensor0<double *> t_det(&*detHoJac.data().begin());
1102  double *t_jac_ptr = &*hoJac.data().begin();
1104  t_jac_ptr, &t_jac_ptr[1], &t_jac_ptr[2], &t_jac_ptr[3], &t_jac_ptr[4],
1105  &t_jac_ptr[5], &t_jac_ptr[6], &t_jac_ptr[7], &t_jac_ptr[8], 9);
1107  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
1108  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
1109  const double a = 1. / t_det;
1110  t_transformed_n(i) = a * t_jac(i, k) * t_n(k);
1111  t_transformed_diff_n(i, k) = a * t_jac(i, j) * t_diff_n(j, k);
1112  ++t_n;
1113  ++t_transformed_n;
1114  ++t_diff_n;
1115  ++t_transformed_diff_n;
1116  }
1117  ++t_det;
1118  ++t_jac;
1119  }
1121  data.getHdivN(base).data().swap(piolaN.data());
1122  data.getDiffHdivN(base).data().swap(piolaDiffN.data());
1123  }
1126 }
user implemented approximation base
Definition: definitions.h:146
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
approximation base
Definition: definitions.h:140
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:443

Member Data Documentation

◆ detHoJac

VectorDouble& MoFEM::OpSetHoContravariantPiolaTransform::detHoJac

Definition at line 393 of file DataOperators.hpp.

◆ hoJac

MatrixDouble& MoFEM::OpSetHoContravariantPiolaTransform::hoJac

Definition at line 394 of file DataOperators.hpp.

◆ i

FTensor::Index<'i',3> MoFEM::OpSetHoContravariantPiolaTransform::i

Definition at line 395 of file DataOperators.hpp.

◆ j

FTensor::Index<'j',3> MoFEM::OpSetHoContravariantPiolaTransform::j

Definition at line 396 of file DataOperators.hpp.

◆ k

FTensor::Index<'k',3> MoFEM::OpSetHoContravariantPiolaTransform::k

Definition at line 397 of file DataOperators.hpp.

◆ piolaDiffN

MatrixDouble MoFEM::OpSetHoContravariantPiolaTransform::piolaDiffN

Definition at line 403 of file DataOperators.hpp.

◆ piolaN

MatrixDouble MoFEM::OpSetHoContravariantPiolaTransform::piolaN

Definition at line 402 of file DataOperators.hpp.

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