v0.8.19
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetContravariantPiolaTransformOnTriangle Struct Reference

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

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetContravariantPiolaTransformOnTriangle (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 left 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 right 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 663 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetContravariantPiolaTransformOnTriangle()

MoFEM::OpSetContravariantPiolaTransformOnTriangle::OpSetContravariantPiolaTransformOnTriangle ( const VectorDouble normal,
const MatrixDouble normals_at_pts 
)

Definition at line 668 of file DataOperators.hpp.

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

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetContravariantPiolaTransformOnTriangle::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

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

Reimplemented from MoFEM::DataOperator.

Definition at line 1395 of file DataOperators.cpp.

1396  {
1398 
1399  if (type != MBTRI)
1401 
1402  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
1403 
1404  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
1405 
1406  int nb_gauss_pts = data.getN(base).size1();
1407  if (nb_gauss_pts) {
1409  auto t_normal =
1411  const double l02 = t_normal(i) * t_normal(i);
1412  int nb_base_functions = data.getN(base).size2() / 3;
1413  auto t_n = data.getFTensor1N<3>(base);
1414  if (normalsAtGaussPts.size1() == (unsigned int)nb_gauss_pts) {
1415  auto t_ho_normal =
1417  &normalsAtGaussPts(0, 0), &normalsAtGaussPts(0, 1),
1418  &normalsAtGaussPts(0, 2));
1419  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1420  for (int bb = 0; bb != nb_base_functions; ++bb) {
1421  const double v = t_n(0);
1422  const double l2 = t_ho_normal(i) * t_ho_normal(i);
1423  t_n(i) = (v / l2) * t_ho_normal(i);
1424  ++t_n;
1425  }
1426  ++t_ho_normal;
1427  }
1428  } else {
1429  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1430  for (int bb = 0; bb != nb_base_functions; ++bb) {
1431  const double v = t_n(0);
1432  t_n(i) = (v / l02) * t_normal(i);
1433  ++t_n;
1434  }
1435  }
1436  }
1437  }
1438  }
1439 
1441 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
FieldApproximationBase
approximation base
Definition: definitions.h:141
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:143

Member Data Documentation

◆ nOrmal

const VectorDouble& MoFEM::OpSetContravariantPiolaTransformOnTriangle::nOrmal

Definition at line 665 of file DataOperators.hpp.

◆ normalsAtGaussPts

const MatrixDouble& MoFEM::OpSetContravariantPiolaTransformOnTriangle::normalsAtGaussPts

Definition at line 666 of file DataOperators.hpp.


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