v0.8.15
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 694 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetContravariantPiolaTransformOnTriangle()

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

Definition at line 699 of file DataOperators.hpp.

702  :
703  nOrmal(normal),
704  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 1394 of file DataOperators.cpp.

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

Member Data Documentation

◆ nOrmal

const VectorDouble& MoFEM::OpSetContravariantPiolaTransformOnTriangle::nOrmal

Definition at line 696 of file DataOperators.hpp.

◆ normalsAtGaussPts

const MatrixDouble& MoFEM::OpSetContravariantPiolaTransformOnTriangle::normalsAtGaussPts

Definition at line 697 of file DataOperators.hpp.


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