v0.8.4
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetHoCovariantPiolaTransform Struct Reference

Apply covariant (Piola) transfer to Hcurl space for HO geometry. More...

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetHoCovariantPiolaTransform (MatrixDouble &inv_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

MatrixDoublehoInvJac
 
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 covariant (Piola) transfer to Hcurl space for HO geometry.

Definition at line 410 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetHoCovariantPiolaTransform()

MoFEM::OpSetHoCovariantPiolaTransform::OpSetHoCovariantPiolaTransform ( MatrixDouble inv_jac)

Definition at line 417 of file DataOperators.hpp.

417  :
418  hoInvJac(inv_jac) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetHoCovariantPiolaTransform::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

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

Reimplemented from MoFEM::DataOperator.

Definition at line 1128 of file DataOperators.cpp.

1129  {
1131 
1132  if (type != MBEDGE && type != MBTRI && type != MBTET)
1134 
1135  for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
1136 
1137  FieldApproximationBase base = ApproximationBaseArray[b];
1138 
1139  unsigned int nb_gauss_pts = data.getHcurlN(base).size1();
1140  unsigned int nb_base_functions = data.getHcurlN(base).size2() / 3;
1141  piolaN.resize(nb_gauss_pts, data.getHcurlN(base).size2(), false);
1142  piolaDiffN.resize(nb_gauss_pts, data.getDiffHcurlN(base).size2(), false);
1143 
1144  auto t_n = data.getFTensor1HcurlN<3>(base);
1145  double *t_transformed_n_ptr = &*piolaN.data().begin();
1147  t_transformed_n_ptr, // HDIV0
1148  &t_transformed_n_ptr[HCURL1], &t_transformed_n_ptr[HCURL2]);
1149  auto t_diff_n = data.getFTensor2DiffHcurlN<3, 3>(base);
1150  double *t_transformed_diff_n_ptr = &*piolaDiffN.data().begin();
1151  FTensor::Tensor2<double *, 3, 3> t_transformed_diff_n(
1152  t_transformed_diff_n_ptr, &t_transformed_diff_n_ptr[HCURL0_1],
1153  &t_transformed_diff_n_ptr[HCURL0_2],
1154  &t_transformed_diff_n_ptr[HCURL1_0],
1155  &t_transformed_diff_n_ptr[HCURL1_1],
1156  &t_transformed_diff_n_ptr[HCURL1_2],
1157  &t_transformed_diff_n_ptr[HCURL2_0],
1158  &t_transformed_diff_n_ptr[HCURL2_1],
1159  &t_transformed_diff_n_ptr[HCURL2_2], 9);
1160 
1161  double *t_inv_jac_ptr = &*hoInvJac.data().begin();
1163  t_inv_jac_ptr, &t_inv_jac_ptr[1], &t_inv_jac_ptr[2], &t_inv_jac_ptr[3],
1164  &t_inv_jac_ptr[4], &t_inv_jac_ptr[5], &t_inv_jac_ptr[6],
1165  &t_inv_jac_ptr[7], &t_inv_jac_ptr[8], 9);
1166 
1167  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
1168  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
1169  t_transformed_n(i) = t_inv_jac(k, i) * t_n(k);
1170  t_transformed_diff_n(i, k) = t_inv_jac(j, i) * t_diff_n(j, k);
1171  ++t_n;
1172  ++t_transformed_n;
1173  ++t_diff_n;
1174  ++t_transformed_diff_n;
1175  }
1176  ++t_inv_jac;
1177  }
1178 
1179  data.getHcurlN(base).data().swap(piolaN.data());
1180  data.getDiffHcurlN(base).data().swap(piolaDiffN.data());
1181  }
1182 
1184 }
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
FieldApproximationBase
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

◆ hoInvJac

MatrixDouble& MoFEM::OpSetHoCovariantPiolaTransform::hoInvJac

Definition at line 412 of file DataOperators.hpp.

◆ i

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

Definition at line 413 of file DataOperators.hpp.

◆ j

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

Definition at line 414 of file DataOperators.hpp.

◆ k

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

Definition at line 415 of file DataOperators.hpp.

◆ piolaDiffN

MatrixDouble MoFEM::OpSetHoCovariantPiolaTransform::piolaDiffN

Definition at line 421 of file DataOperators.hpp.

◆ piolaN

MatrixDouble MoFEM::OpSetHoCovariantPiolaTransform::piolaN

Definition at line 420 of file DataOperators.hpp.


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