v0.13.1
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetContravariantPiolaTransform Struct Reference

apply contravariant (Piola) transfer to Hdiv space More...

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetContravariantPiolaTransform (double &volume, MatrixDouble3by3 &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

doublevOlume
 
FTensor::Tensor2< double *, 3, 3 > tJac
 
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 contravariant (Piola) transfer to Hdiv 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 183 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetContravariantPiolaTransform()

MoFEM::OpSetContravariantPiolaTransform::OpSetContravariantPiolaTransform ( double volume,
MatrixDouble3by3 jac 
)

Definition at line 192 of file DataOperators.hpp.

193 : vOlume(volume),
194 // jAc(jac),
195 tJac(&jac(0, 0), &jac(0, 1), &jac(0, 2), &jac(1, 0), &jac(1, 1),
196 &jac(1, 2), &jac(2, 0), &jac(2, 1), &jac(2, 2)) {}
FTensor::Tensor2< double *, 3, 3 > tJac

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetContravariantPiolaTransform::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 266 of file DataOperators.cpp.

267 {
269
270 if (CN::Dimension(type) > 1) {
271
272 for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
273
275
276 const unsigned int nb_base_functions = data.getN(base).size2() / 3;
277 if (!nb_base_functions)
278 continue;
279
280 const unsigned int nb_gauss_pts = data.getN(base).size1();
281 double const a = 1. / vOlume;
282
283 piolaN.resize(nb_gauss_pts, data.getN(base).size2(), false);
284 if (data.getN(base).size2() > 0) {
285 auto t_n = data.getFTensor1N<3>(base);
286 double *t_transformed_n_ptr = &*piolaN.data().begin();
288 t_transformed_n_ptr, // HVEC0
289 &t_transformed_n_ptr[HVEC1], &t_transformed_n_ptr[HVEC2]);
290 for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
291 for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
292 t_transformed_n(i) = a * (tJac(i, k) * t_n(k));
293 ++t_n;
294 ++t_transformed_n;
295 }
296 }
297 data.getN(base).swap(piolaN);
298 }
299
300 piolaDiffN.resize(nb_gauss_pts, data.getDiffN(base).size2(), false);
301 if (data.getDiffN(base).size2() > 0) {
302 auto t_diff_n = data.getFTensor2DiffN<3, 3>(base);
303 double *t_transformed_diff_n_ptr = &*piolaDiffN.data().begin();
305 t_transformed_diff_n(t_transformed_diff_n_ptr,
306 &t_transformed_diff_n_ptr[HVEC0_1],
307 &t_transformed_diff_n_ptr[HVEC0_2],
308 &t_transformed_diff_n_ptr[HVEC1_0],
309 &t_transformed_diff_n_ptr[HVEC1_1],
310 &t_transformed_diff_n_ptr[HVEC1_2],
311 &t_transformed_diff_n_ptr[HVEC2_0],
312 &t_transformed_diff_n_ptr[HVEC2_1],
313 &t_transformed_diff_n_ptr[HVEC2_2]);
314 for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
315 for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
316 t_transformed_diff_n(i, k) = a * tJac(i, j) * t_diff_n(j, k);
317 ++t_diff_n;
318 ++t_transformed_diff_n;
319 }
320 }
321 data.getDiffN(base).swap(piolaDiffN);
322 }
323 }
324 }
325
327}
constexpr double a
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 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::OpSetContravariantPiolaTransform::i

Definition at line 188 of file DataOperators.hpp.

◆ j

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

Definition at line 189 of file DataOperators.hpp.

◆ k

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

Definition at line 190 of file DataOperators.hpp.

◆ piolaDiffN

MatrixDouble MoFEM::OpSetContravariantPiolaTransform::piolaDiffN

Definition at line 199 of file DataOperators.hpp.

◆ piolaN

MatrixDouble MoFEM::OpSetContravariantPiolaTransform::piolaN

Definition at line 198 of file DataOperators.hpp.

◆ tJac

FTensor::Tensor2<double *, 3, 3> MoFEM::OpSetContravariantPiolaTransform::tJac

Definition at line 187 of file DataOperators.hpp.

◆ vOlume

double& MoFEM::OpSetContravariantPiolaTransform::vOlume

Definition at line 185 of file DataOperators.hpp.


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