v0.9.1
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, DataForcesAndSourcesCore::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, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &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
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...
 

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 285 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetCovariantPiolaTransform()

MoFEM::OpSetCovariantPiolaTransform::OpSetCovariantPiolaTransform ( MatrixDouble3by3 inv_jac)

Definition at line 292 of file DataOperators.hpp.

293  : tInvJac(&inv_jac(0, 0), &inv_jac(0, 1), &inv_jac(0, 2), &inv_jac(1, 0),
294  &inv_jac(1, 1), &inv_jac(1, 2), &inv_jac(2, 0), &inv_jac(2, 1),
295  &inv_jac(2, 2)) {}
FTensor::Tensor2< double *, 3, 3 > tInvJac

Member Function Documentation

◆ doWork()

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

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

Reimplemented from MoFEM::DataOperator.

Definition at line 380 of file DataOperators.cpp.

381  {
383 
384  if (type != MBEDGE && type != MBTRI && type != MBTET)
386 
387  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
388 
389  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
390 
391  const unsigned int nb_base_functions = data.getN(base).size2() / 3;
392  if (!nb_base_functions)
393  continue;
394 
395  const unsigned int nb_gauss_pts = data.getN(base).size1();
396  piolaN.resize(nb_gauss_pts, data.getN(base).size2(), false);
397  piolaDiffN.resize(nb_gauss_pts, data.getDiffN(base).size2(), false);
398 
399  auto t_n = data.getFTensor1N<3>(base);
400  double *t_transformed_n_ptr = &*piolaN.data().begin();
402  t_transformed_n_ptr, &t_transformed_n_ptr[HVEC1],
403  &t_transformed_n_ptr[HVEC2]);
404  auto t_diff_n = data.getFTensor2DiffN<3, 3>(base);
405  double *t_transformed_diff_n_ptr = &*piolaDiffN.data().begin();
406  FTensor::Tensor2<FTensor::PackPtr<double *, 9>, 3, 3> t_transformed_diff_n(
407  t_transformed_diff_n_ptr, &t_transformed_diff_n_ptr[HVEC0_1],
408  &t_transformed_diff_n_ptr[HVEC0_2], &t_transformed_diff_n_ptr[HVEC1_0],
409  &t_transformed_diff_n_ptr[HVEC1_1], &t_transformed_diff_n_ptr[HVEC1_2],
410  &t_transformed_diff_n_ptr[HVEC2_0], &t_transformed_diff_n_ptr[HVEC2_1],
411  &t_transformed_diff_n_ptr[HVEC2_2]);
412 
413  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
414  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
415  t_transformed_n(i) = tInvJac(k, i) * t_n(k);
416  t_transformed_diff_n(i, k) = tInvJac(j, i) * t_diff_n(j, k);
417  ++t_n;
418  ++t_transformed_n;
419  ++t_diff_n;
420  ++t_transformed_diff_n;
421  }
422  }
423  data.getN(base).data().swap(piolaN.data());
424  data.getDiffN(base).data().swap(piolaDiffN.data());
425  }
426 
427  // data.getBase() = base;
428 
430 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
FTensor::Tensor2< double *, 3, 3 > tInvJac
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
FieldApproximationBase
approximation base
Definition: definitions.h:149
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:151
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

Member Data Documentation

◆ i

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

Definition at line 288 of file DataOperators.hpp.

◆ j

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

Definition at line 289 of file DataOperators.hpp.

◆ k

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

Definition at line 290 of file DataOperators.hpp.

◆ piolaDiffN

MatrixDouble MoFEM::OpSetCovariantPiolaTransform::piolaDiffN

Definition at line 298 of file DataOperators.hpp.

◆ piolaN

MatrixDouble MoFEM::OpSetCovariantPiolaTransform::piolaN

Definition at line 297 of file DataOperators.hpp.

◆ tInvJac

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

Definition at line 287 of file DataOperators.hpp.


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