v0.13.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, 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 doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
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)

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)) {}
FTensor::Tensor2< double *, 3, 3 > tInvJac

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 330 of file DataOperators.cpp.

331 {
333
334 if (type == MBVERTEX)
336
337 for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
338
340
341 const unsigned int nb_base_functions = data.getN(base).size2() / 3;
342 if (!nb_base_functions)
343 continue;
344
345 const unsigned int nb_gauss_pts = data.getN(base).size1();
346 piolaN.resize(nb_gauss_pts, data.getN(base).size2(), false);
347 piolaDiffN.resize(nb_gauss_pts, data.getDiffN(base).size2(), false);
348
349 auto t_n = data.getFTensor1N<3>(base);
350 double *t_transformed_n_ptr = &*piolaN.data().begin();
352 t_transformed_n_ptr, &t_transformed_n_ptr[HVEC1],
353 &t_transformed_n_ptr[HVEC2]);
354 auto t_diff_n = data.getFTensor2DiffN<3, 3>(base);
355 double *t_transformed_diff_n_ptr = &*piolaDiffN.data().begin();
356 FTensor::Tensor2<FTensor::PackPtr<double *, 9>, 3, 3> t_transformed_diff_n(
357 t_transformed_diff_n_ptr, &t_transformed_diff_n_ptr[HVEC0_1],
358 &t_transformed_diff_n_ptr[HVEC0_2], &t_transformed_diff_n_ptr[HVEC1_0],
359 &t_transformed_diff_n_ptr[HVEC1_1], &t_transformed_diff_n_ptr[HVEC1_2],
360 &t_transformed_diff_n_ptr[HVEC2_0], &t_transformed_diff_n_ptr[HVEC2_1],
361 &t_transformed_diff_n_ptr[HVEC2_2]);
362
363 for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
364 for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
365 t_transformed_n(i) = tInvJac(k, i) * t_n(k);
366 t_transformed_diff_n(i, k) = tInvJac(j, i) * t_diff_n(j, k);
367 ++t_n;
368 ++t_transformed_n;
369 ++t_diff_n;
370 ++t_transformed_diff_n;
371 }
372 }
373 data.getN(base).swap(piolaN);
374 data.getDiffN(base).swap(piolaDiffN);
375 }
376
377 // data.getBase() = base;
378
380}
FieldApproximationBase
approximation base
Definition: definitions.h:58
@ LASTBASE
Definition: definitions.h:69
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ HVEC1
Definition: definitions.h:186
@ HVEC2
Definition: definitions.h:186
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
@ HVEC1_1
Definition: definitions.h:196
@ HVEC0_1
Definition: definitions.h:195
@ HVEC1_0
Definition: definitions.h:193
@ HVEC2_1
Definition: definitions.h:197
@ HVEC1_2
Definition: definitions.h:199
@ HVEC2_2
Definition: definitions.h:200
@ HVEC2_0
Definition: definitions.h:194
@ HVEC0_2
Definition: definitions.h:198

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: