v0.10.0
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetContravariantPiolaTransformOnFace Struct Reference

transform Hdiv base fluxes from reference element to physical triangle More...

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetContravariantPiolaTransformOnFace (const VectorDouble &normal, const MatrixDouble &normals_at_pts, const int normal_shift=0)
 
 OpSetContravariantPiolaTransformOnFace (const VectorDouble *normal_raw_ptr=nullptr, const MatrixDouble *normals_at_pts_ptr=nullptr, const int normal_shift=0)
 
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

const VectorDoublenormalRawPtr
 
const MatrixDoublenormalsAtGaussPtsRawPtr
 
int normalShift
 Shift in vector for linear geometry. More...
 
- 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

transform Hdiv base fluxes from reference element to physical triangle

Definition at line 506 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetContravariantPiolaTransformOnFace() [1/2]

MoFEM::OpSetContravariantPiolaTransformOnFace::OpSetContravariantPiolaTransformOnFace ( const VectorDouble normal,
const MatrixDouble normals_at_pts,
const int  normal_shift = 0 
)

Definition at line 523 of file DataOperators.hpp.

526  : normalRawPtr(&normal), normalsAtGaussPtsRawPtr(&normals_at_pts),
527  normalShift(normal_shift) {}
FTensor::Tensor1< double, 2 > normal(FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, 2 > &t_disp)
Definition: ContactOps.hpp:137
int normalShift
Shift in vector for linear geometry.

◆ OpSetContravariantPiolaTransformOnFace() [2/2]

MoFEM::OpSetContravariantPiolaTransformOnFace::OpSetContravariantPiolaTransformOnFace ( const VectorDouble normal_raw_ptr = nullptr,
const MatrixDouble normals_at_pts_ptr = nullptr,
const int  normal_shift = 0 
)

Definition at line 529 of file DataOperators.hpp.

533  : normalRawPtr(normal_raw_ptr),
534  normalsAtGaussPtsRawPtr(normals_at_pts_ptr), normalShift(normal_shift) {
535  }
int normalShift
Shift in vector for linear geometry.

Member Function Documentation

◆ doWork()

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

897  {
900 
901  if (type != MBTRI)
903 
904  if (normalRawPtr == nullptr && normalsAtGaussPtsRawPtr == nullptr)
905  SETERRQ(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
906  "Pointer to normal/normals not set");
907 
908  bool normal_is_at_gauss_pts = (normalsAtGaussPtsRawPtr != nullptr);
909  if (normal_is_at_gauss_pts)
910  normal_is_at_gauss_pts = (normalsAtGaussPtsRawPtr->size1() != 0);
911 
912  auto apply_transform_linear_geometry = [&](auto base, auto nb_gauss_pts,
913  auto nb_base_functions) {
915  const auto &normal = *normalRawPtr;
916  auto t_normal = FTensor::Tensor1<double, 3>{normal[normalShift + 0],
917  normal[normalShift + 1],
918  normal[normalShift + 2]};
919  const auto l02 = t_normal(i) * t_normal(i);
920  auto t_base = data.getFTensor1N<3>(base);
921  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
922  for (int bb = 0; bb != nb_base_functions; ++bb) {
923  const auto v = t_base(0);
924  t_base(i) = (v / l02) * t_normal(i);
925  ++t_base;
926  }
927  }
929  };
930 
931  auto apply_transform_nonlinear_geometry = [&](auto base, auto nb_gauss_pts,
932  auto nb_base_functions) {
934  const MatrixDouble &normals_at_pts = *normalsAtGaussPtsRawPtr;
936  &normals_at_pts(0, 0), &normals_at_pts(0, 1), &normals_at_pts(0, 2));
937  auto t_base = data.getFTensor1N<3>(base);
938  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
939  for (int bb = 0; bb != nb_base_functions; ++bb) {
940  const auto v = t_base(0);
941  const auto l2 = t_normal(i) * t_normal(i);
942  t_base(i) = (v / l2) * t_normal(i);
943  ++t_base;
944  }
945  ++t_normal;
946  }
948  };
949 
950  if (normal_is_at_gauss_pts) {
951  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
952 
953  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
954  const auto &base_functions = data.getN(base);
955  const auto nb_gauss_pts = base_functions.size1();
956 
957  if (nb_gauss_pts) {
958 
959  if (normalsAtGaussPtsRawPtr->size1() != nb_gauss_pts)
960  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
961  "normalsAtGaussPtsRawPtr has inconsistent number of "
962  "integration "
963  "points");
964 
965  const auto nb_base_functions = base_functions.size2() / 3;
966  CHKERR apply_transform_nonlinear_geometry(base, nb_gauss_pts,
967  nb_base_functions);
968  }
969  }
970  } else {
971  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
972 
973  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
974  const auto &base_functions = data.getN(base);
975  const auto nb_gauss_pts = base_functions.size1();
976 
977  if (nb_gauss_pts) {
978  const auto nb_base_functions = base_functions.size2() / 3;
979  CHKERR apply_transform_linear_geometry(base, nb_gauss_pts,
980  nb_base_functions);
981  }
982  }
983  }
984 
986 }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:76
FTensor::Tensor1< double, 2 > normal(FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, 2 > &t_disp)
Definition: ContactOps.hpp:137
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
int normalShift
Shift in vector for linear geometry.
static Index< 'i', 3 > i
FieldApproximationBase
approximation base
Definition: definitions.h:150
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:152
#define CHKERR
Inline error check.
Definition: definitions.h:604
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

Member Data Documentation

◆ normalRawPtr

const VectorDouble* MoFEM::OpSetContravariantPiolaTransformOnFace::normalRawPtr

Definition at line 509 of file DataOperators.hpp.

◆ normalsAtGaussPtsRawPtr

const MatrixDouble* MoFEM::OpSetContravariantPiolaTransformOnFace::normalsAtGaussPtsRawPtr

Definition at line 510 of file DataOperators.hpp.

◆ normalShift

int MoFEM::OpSetContravariantPiolaTransformOnFace::normalShift

Shift in vector for linear geometry.

Normal can have size larger than three, for example normal for contact prism and flat prims element have six comonents, for top and bottom triangle of the prims.

Definition at line 521 of file DataOperators.hpp.


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