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:
Collaboration diagram for MoFEM::OpSetContravariantPiolaTransformOnFace:

Public Member Functions

 OpSetContravariantPiolaTransformOnFace (const VectorDouble &normal, const MatrixDouble &normals_at_pts)
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, const bool do_vertices=true, const bool do_edges=true, const bool do_quads=true, const bool do_tris=true, const bool do_tets=true, const bool do_prisms=true)
virtual ~DataOperator ()
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, bool symm=true)
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=true)
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 VectorDoublenOrmal
const MatrixDoublenormalsAtGaussPts
- Public Attributes inherited from MoFEM::DataOperator
bool sYmm
 If true assume that matrix is symmetric structure. More...
bool doVertices
 If false skip vertices. More...
bool doEdges
 If false skip edges. More...
bool doQuads
bool doTris
bool doTets
bool doPrisms

Detailed Description

transform Hdiv base fluxes from reference element to physical triangle

Definition at line 511 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetContravariantPiolaTransformOnFace()

MoFEM::OpSetContravariantPiolaTransformOnFace::OpSetContravariantPiolaTransformOnFace ( const VectorDouble normal,
const MatrixDouble normals_at_pts 

Definition at line 516 of file DataOperators.hpp.

518  : nOrmal(normal), normalsAtGaussPts(normals_at_pts) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetContravariantPiolaTransformOnFace::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 

Operator for linear form, usually to calculate values on right hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 1352 of file DataOperators.cpp.

1353  {
1356  if (type != MBTRI)
1359  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
1361  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
1363  int nb_gauss_pts = data.getN(base).size1();
1364  if (nb_gauss_pts) {
1366  auto t_normal =
1368  const double l02 = t_normal(i) * t_normal(i);
1369  int nb_base_functions = data.getN(base).size2() / 3;
1370  auto t_n = data.getFTensor1N<3>(base);
1371  if (normalsAtGaussPts.size1() == (unsigned int)nb_gauss_pts) {
1372  auto t_ho_normal =
1374  &normalsAtGaussPts(0, 0), &normalsAtGaussPts(0, 1),
1375  &normalsAtGaussPts(0, 2));
1376  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1377  for (int bb = 0; bb != nb_base_functions; ++bb) {
1378  const double v = t_n(0);
1379  const double l2 = t_ho_normal(i) * t_ho_normal(i);
1380  t_n(i) = (v / l2) * t_ho_normal(i);
1381  ++t_n;
1382  }
1383  ++t_ho_normal;
1384  }
1385  } else {
1386  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1387  for (int bb = 0; bb != nb_base_functions; ++bb) {
1388  const double v = t_n(0);
1389  t_n(i) = (v / l02) * t_normal(i);
1390  ++t_n;
1391  }
1392  }
1393  }
1394  }
1395  }
1398 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
approximation base
Definition: definitions.h:144
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:146

Member Data Documentation

◆ nOrmal

const VectorDouble& MoFEM::OpSetContravariantPiolaTransformOnFace::nOrmal

Definition at line 513 of file DataOperators.hpp.

◆ normalsAtGaussPts

const MatrixDouble& MoFEM::OpSetContravariantPiolaTransformOnFace::normalsAtGaussPts

Definition at line 514 of file DataOperators.hpp.

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