v0.15.0
Loading...
Searching...
No Matches
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.
 
- 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.
 
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.
 
void setSymm ()
 set if operator is executed taking in account symmetry
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem
 

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.
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity.
 
booldoVertices
 \deprectaed If false skip vertices
 
booldoEdges
 \deprectaed If false skip edges
 
booldoQuads
 \deprectaed
 
booldoTris
 \deprectaed
 
booldoTets
 \deprectaed
 
booldoPrisms
 \deprectaed
 

Additional Inherited Members

- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType
 
using DoWorkRhsHookFunType
 

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)) {}
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 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}
FieldApproximationBase
approximation base
Definition definitions.h:58
@ LASTBASE
Definition definitions.h:69
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
Definition definitions.h:60
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ HVEC1
@ HVEC2
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ HVEC1_1
@ HVEC0_1
@ HVEC1_0
@ HVEC2_1
@ HVEC1_2
@ HVEC2_2
@ HVEC2_0
@ HVEC0_2

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: