v0.8.23
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)
 
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 
)
virtual

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

Reimplemented from MoFEM::DataOperator.

Definition at line 1360 of file DataOperators.cpp.

1361  {
1363 
1364  if (type != MBTRI)
1366 
1367  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
1368 
1369  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
1370 
1371  int nb_gauss_pts = data.getN(base).size1();
1372  if (nb_gauss_pts) {
1374  auto t_normal =
1376  const double l02 = t_normal(i) * t_normal(i);
1377  int nb_base_functions = data.getN(base).size2() / 3;
1378  auto t_n = data.getFTensor1N<3>(base);
1379  if (normalsAtGaussPts.size1() == (unsigned int)nb_gauss_pts) {
1380  auto t_ho_normal =
1382  &normalsAtGaussPts(0, 0), &normalsAtGaussPts(0, 1),
1383  &normalsAtGaussPts(0, 2));
1384  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1385  for (int bb = 0; bb != nb_base_functions; ++bb) {
1386  const double v = t_n(0);
1387  const double l2 = t_ho_normal(i) * t_ho_normal(i);
1388  t_n(i) = (v / l2) * t_ho_normal(i);
1389  ++t_n;
1390  }
1391  ++t_ho_normal;
1392  }
1393  } else {
1394  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1395  for (int bb = 0; bb != nb_base_functions; ++bb) {
1396  const double v = t_n(0);
1397  t_n(i) = (v / l02) * t_normal(i);
1398  ++t_n;
1399  }
1400  }
1401  }
1402  }
1403  }
1404 
1406 }
#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
FieldApproximationBase
approximation base
Definition: definitions.h:143
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:145

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: