v0.14.0
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetCovariantPiolaTransform Struct Reference

apply covariant transfer to Hcurl space More...

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetCovariantPiolaTransform (MatrixDouble3by3 &inv_jac)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
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::Tensor2< double *, 3, 3 > tInvJac
 
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
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 

Additional Inherited Members

- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 

Detailed Description

apply covariant transfer to Hcurl space

Contravariant Piola transformation

\[ \psi_i|_t = \frac{1}{\textrm{det}(J)}J_{ij}\hat{\psi}_j\\ \left.\frac{\partial \psi_i}{\partial \xi_j}\right|_t = \frac{1}{\textrm{det}(J)}J_{ik}\frac{\partial \hat{\psi}_k}{\partial \xi_j} \]

Definition at line 218 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetCovariantPiolaTransform()

MoFEM::OpSetCovariantPiolaTransform::OpSetCovariantPiolaTransform ( MatrixDouble3by3 inv_jac)
inline

Definition at line 225 of file DataOperators.hpp.

226  : tInvJac(&inv_jac(0, 0), &inv_jac(0, 1), &inv_jac(0, 2), &inv_jac(1, 0),
227  &inv_jac(1, 1), &inv_jac(1, 2), &inv_jac(2, 0), &inv_jac(2, 1),
228  &inv_jac(2, 2)) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetCovariantPiolaTransform::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
virtual

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

Reimplemented from MoFEM::DataOperator.

Definition at line 329 of file DataOperators.cpp.

330  {
332 
333  if (type == MBVERTEX)
335 
336  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
337 
338  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
339 
340  const unsigned int nb_base_functions = data.getN(base).size2() / 3;
341  if (!nb_base_functions)
342  continue;
343 
344  const unsigned int nb_gauss_pts = data.getN(base).size1();
345  piolaN.resize(nb_gauss_pts, data.getN(base).size2(), false);
346  piolaDiffN.resize(nb_gauss_pts, data.getDiffN(base).size2(), false);
347 
348  auto t_n = data.getFTensor1N<3>(base);
349  double *t_transformed_n_ptr = &*piolaN.data().begin();
351  t_transformed_n_ptr, &t_transformed_n_ptr[HVEC1],
352  &t_transformed_n_ptr[HVEC2]);
353  auto t_diff_n = data.getFTensor2DiffN<3, 3>(base);
354  double *t_transformed_diff_n_ptr = &*piolaDiffN.data().begin();
355  FTensor::Tensor2<FTensor::PackPtr<double *, 9>, 3, 3> t_transformed_diff_n(
356  t_transformed_diff_n_ptr, &t_transformed_diff_n_ptr[HVEC0_1],
357  &t_transformed_diff_n_ptr[HVEC0_2], &t_transformed_diff_n_ptr[HVEC1_0],
358  &t_transformed_diff_n_ptr[HVEC1_1], &t_transformed_diff_n_ptr[HVEC1_2],
359  &t_transformed_diff_n_ptr[HVEC2_0], &t_transformed_diff_n_ptr[HVEC2_1],
360  &t_transformed_diff_n_ptr[HVEC2_2]);
361 
362  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
363  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
364  t_transformed_n(i) = tInvJac(k, i) * t_n(k);
365  ++t_n;
366  ++t_transformed_n;
367  }
368  }
369 
370  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
371  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
372  t_transformed_diff_n(i, k) = tInvJac(j, i) * t_diff_n(j, k);
373  ++t_diff_n;
374  ++t_transformed_diff_n;
375  }
376  }
377 
378  data.getN(base).swap(piolaN);
379  data.getDiffN(base).swap(piolaDiffN);
380  }
381 
382  // data.getBase() = base;
383 
385 }

Member Data Documentation

◆ i

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

Definition at line 221 of file DataOperators.hpp.

◆ j

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

Definition at line 222 of file DataOperators.hpp.

◆ k

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

Definition at line 223 of file DataOperators.hpp.

◆ piolaDiffN

MatrixDouble MoFEM::OpSetCovariantPiolaTransform::piolaDiffN

Definition at line 231 of file DataOperators.hpp.

◆ piolaN

MatrixDouble MoFEM::OpSetCovariantPiolaTransform::piolaN

Definition at line 230 of file DataOperators.hpp.

◆ tInvJac

FTensor::Tensor2<double *, 3, 3> MoFEM::OpSetCovariantPiolaTransform::tInvJac

Definition at line 220 of file DataOperators.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
LASTBASE
@ LASTBASE
Definition: definitions.h:69
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
HVEC0_2
@ HVEC0_2
Definition: definitions.h:211
MoFEM::OpSetCovariantPiolaTransform::k
FTensor::Index< 'k', 3 > k
Definition: DataOperators.hpp:223
HVEC0_1
@ HVEC0_1
Definition: definitions.h:208
MoFEM::OpSetCovariantPiolaTransform::j
FTensor::Index< 'j', 3 > j
Definition: DataOperators.hpp:222
MoFEM::OpSetCovariantPiolaTransform::tInvJac
FTensor::Tensor2< double *, 3, 3 > tInvJac
Definition: DataOperators.hpp:220
HVEC1_1
@ HVEC1_1
Definition: definitions.h:209
HVEC1
@ HVEC1
Definition: definitions.h:199
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
HVEC2_1
@ HVEC2_1
Definition: definitions.h:210
HVEC2_2
@ HVEC2_2
Definition: definitions.h:213
HVEC1_2
@ HVEC1_2
Definition: definitions.h:212
convert.type
type
Definition: convert.py:64
MoFEM::OpSetCovariantPiolaTransform::piolaDiffN
MatrixDouble piolaDiffN
Definition: DataOperators.hpp:231
MoFEM::OpSetCovariantPiolaTransform::i
FTensor::Index< 'i', 3 > i
Definition: DataOperators.hpp:221
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
FieldApproximationBase
FieldApproximationBase
approximation base
Definition: definitions.h:58
HVEC2_0
@ HVEC2_0
Definition: definitions.h:207
HVEC2
@ HVEC2
Definition: definitions.h:199
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
HVEC1_0
@ HVEC1_0
Definition: definitions.h:206
MoFEM::OpSetCovariantPiolaTransform::piolaN
MatrixDouble piolaN
Definition: DataOperators.hpp:230