v0.9.1
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetHoContravariantPiolaTransform Struct Reference

Apply contravariant (Piola) transfer to Hdiv space for HO geometr. More...

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetHoContravariantPiolaTransform (VectorDouble &det_jac, MatrixDouble &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

VectorDoubledetHoJac
 
MatrixDoublehoJac
 
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 contravariant (Piola) transfer to Hdiv space for HO geometr.

Definition at line 238 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetHoContravariantPiolaTransform()

MoFEM::OpSetHoContravariantPiolaTransform::OpSetHoContravariantPiolaTransform ( VectorDouble det_jac,
MatrixDouble jac 
)

Definition at line 246 of file DataOperators.hpp.

Member Function Documentation

◆ doWork()

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

562  {
564 
565  if (type != MBTRI && type != MBTET)
567 
568  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
569 
570  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
571 
572  unsigned int nb_gauss_pts = data.getN(base).size1();
573  unsigned int nb_base_functions = data.getN(base).size2() / 3;
574  piolaN.resize(nb_gauss_pts, data.getN(base).size2(), false);
575  piolaDiffN.resize(nb_gauss_pts, data.getDiffN(base).size2(), false);
576 
577  auto t_n = data.getFTensor1N<3>(base);
578  double *t_transformed_n_ptr = &*piolaN.data().begin();
580  t_transformed_n_ptr, // HVEC0
581  &t_transformed_n_ptr[HVEC1], &t_transformed_n_ptr[HVEC2]);
582  auto t_diff_n = data.getFTensor2DiffN<3, 3>(base);
583  double *t_transformed_diff_n_ptr = &*piolaDiffN.data().begin();
584  FTensor::Tensor2<FTensor::PackPtr<double *, 9>, 3, 3> t_transformed_diff_n(
585  t_transformed_diff_n_ptr, &t_transformed_diff_n_ptr[HVEC0_1],
586  &t_transformed_diff_n_ptr[HVEC0_2], &t_transformed_diff_n_ptr[HVEC1_0],
587  &t_transformed_diff_n_ptr[HVEC1_1], &t_transformed_diff_n_ptr[HVEC1_2],
588  &t_transformed_diff_n_ptr[HVEC2_0], &t_transformed_diff_n_ptr[HVEC2_1],
589  &t_transformed_diff_n_ptr[HVEC2_2]);
590 
591  FTensor::Tensor0<double *> t_det(&*detHoJac.data().begin());
592  double *t_jac_ptr = &*hoJac.data().begin();
594  t_jac_ptr, &t_jac_ptr[1], &t_jac_ptr[2], &t_jac_ptr[3], &t_jac_ptr[4],
595  &t_jac_ptr[5], &t_jac_ptr[6], &t_jac_ptr[7], &t_jac_ptr[8]);
596 
597  for (unsigned int gg = 0; gg != nb_gauss_pts; ++gg) {
598  for (unsigned int bb = 0; bb != nb_base_functions; ++bb) {
599  const double a = 1. / t_det;
600  t_transformed_n(i) = a * t_jac(i, k) * t_n(k);
601  t_transformed_diff_n(i, k) = a * t_jac(i, j) * t_diff_n(j, k);
602  ++t_n;
603  ++t_transformed_n;
604  ++t_diff_n;
605  ++t_transformed_diff_n;
606  }
607  ++t_det;
608  ++t_jac;
609  }
610 
611  data.getN(base).data().swap(piolaN.data());
612  data.getDiffN(base).data().swap(piolaDiffN.data());
613  }
614 
616 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#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

◆ detHoJac

VectorDouble& MoFEM::OpSetHoContravariantPiolaTransform::detHoJac

Definition at line 240 of file DataOperators.hpp.

◆ hoJac

MatrixDouble& MoFEM::OpSetHoContravariantPiolaTransform::hoJac

Definition at line 241 of file DataOperators.hpp.

◆ i

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

Definition at line 242 of file DataOperators.hpp.

◆ j

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

Definition at line 243 of file DataOperators.hpp.

◆ k

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

Definition at line 244 of file DataOperators.hpp.

◆ piolaDiffN

MatrixDouble MoFEM::OpSetHoContravariantPiolaTransform::piolaDiffN

Definition at line 250 of file DataOperators.hpp.

◆ piolaN

MatrixDouble MoFEM::OpSetHoContravariantPiolaTransform::piolaN

Definition at line 249 of file DataOperators.hpp.


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