v0.8.13
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 1424 of file DataOperators.cpp.

1425  {
1427 
1428  if (type != MBTRI)
1430 
1431  // FieldApproximationBase base = data.getBase();
1432 
1433  for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
1434 
1435  FieldApproximationBase base = ApproximationBaseArray[b];
1436  // data.getBase() = ApproximationBaseArray[b];
1437 
1438  double l0 = cblas_dnrm2(3, &nOrmal[0], 1);
1439  int nb_gauss_pts = data.getHdivN(base).size1();
1440  int nb_dofs = data.getHdivN(base).size2() / 3;
1441  int gg = 0;
1442  for (; gg < nb_gauss_pts; ++gg) {
1443  int dd = 0;
1444  for (; dd < nb_dofs; dd++) {
1445  double val = data.getHdivN(base)(gg, 3 * dd);
1446  if (normalsAtGaussPts.size1() == (unsigned int)nb_gauss_pts) {
1447  double l = cblas_dnrm2(3, &normalsAtGaussPts(gg, 0), 1);
1448  cblas_dcopy(3, &normalsAtGaussPts(gg, 0), 1,
1449  &data.getHdivN(base)(gg, 3 * dd), 1);
1450  cblas_dscal(3, val / pow(l, 2), &data.getHdivN(base)(gg, 3 * dd), 1);
1451  } else {
1452  cblas_dcopy(3, &nOrmal[0], 1, &data.getHdivN(base)(gg, 3 * dd), 1);
1453  cblas_dscal(3, val / pow(l0, 2), &data.getHdivN(base)(gg, 3 * dd), 1);
1454  }
1455  }
1456  }
1457  }
1458 
1459  // data.getBase() = base;
1460 
1462 }
user implemented approximation base
Definition: definitions.h:151
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T *> &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
void cblas_dcopy(const int N, const double *X, const int incX, double *Y, const int incY)
Definition: cblas_dcopy.c:11
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
double cblas_dnrm2(const int N, const double *X, const int incX)
Definition: cblas_dnrm2.c:12
void cblas_dscal(const int N, const double alpha, double *X, const int incX)
Definition: cblas_dscal.c:11
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: