v0.10.0
Public Member Functions | Public Attributes | List of all members
MoFEM::OpSetCovariantPiolaTransformOnEdge Struct Reference

transform Hcurl base fluxes from reference element to physical edge More...

#include <src/finite_elements/DataOperators.hpp>

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

Public Member Functions

 OpSetCovariantPiolaTransformOnEdge (const VectorDouble &tangent, const MatrixDouble &tangent_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)
 
virtual ~DataOperator ()=default
 
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)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=false)
 
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 VectorDoubletAngent
 
const MatrixDoubletangentAtGaussPt
 
- Public Attributes inherited from MoFEM::DataOperator
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 

Detailed Description

transform Hcurl base fluxes from reference element to physical edge

Definition at line 583 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetCovariantPiolaTransformOnEdge()

MoFEM::OpSetCovariantPiolaTransformOnEdge::OpSetCovariantPiolaTransformOnEdge ( const VectorDouble tangent,
const MatrixDouble tangent_at_pts 
)

Definition at line 588 of file DataOperators.hpp.

590  : tAngent(tangent), tangentAtGaussPt(tangent_at_pts) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetCovariantPiolaTransformOnEdge::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 1137 of file DataOperators.cpp.

1138  {
1140 
1141  if (type != MBEDGE)
1143 
1146  &tAngent[0], &tAngent[1], &tAngent[2]);
1147  const double l0 = t_m(i) * t_m(i);
1148 
1149  auto get_base_at_pts = [&](auto base) {
1151  &data.getN(base)(0, HVEC0), &data.getN(base)(0, HVEC1),
1152  &data.getN(base)(0, HVEC2));
1153  return t_h_curl;
1154  };
1155 
1156  auto get_tangent_at_pts = [&]() {
1158  &tangentAtGaussPt(0, 0), &tangentAtGaussPt(0, 1),
1159  &tangentAtGaussPt(0, 2));
1160  return t_m_at_pts;
1161  };
1162 
1163  auto calculate_squared_edge_length = [&]() {
1164  std::vector<double> l1;
1165  int nb_gauss_pts = tangentAtGaussPt.size1();
1166  if (nb_gauss_pts) {
1167  l1.resize(nb_gauss_pts);
1168  auto t_m_at_pts = get_tangent_at_pts();
1169  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
1170  l1[gg] = t_m_at_pts(i) * t_m_at_pts(i);
1171  ++t_m_at_pts;
1172  }
1173  }
1174  return l1;
1175  };
1176 
1177  auto l1 = calculate_squared_edge_length();
1178 
1179  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
1180 
1181  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
1182  const size_t nb_gauss_pts = data.getN(base).size1();
1183  const size_t nb_dofs = data.getN(base).size2() / 3;
1184  if (nb_gauss_pts && nb_dofs) {
1185  auto t_h_curl = get_base_at_pts(base);
1186  int cc = 0;
1187  if (tangentAtGaussPt.size1() == nb_gauss_pts) {
1188  auto t_m_at_pts = get_tangent_at_pts();
1189  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1190  const double l0 = l1[gg];
1191  for (int ll = 0; ll != nb_dofs; ll++) {
1192  const double val = t_h_curl(0);
1193  const double a = val / l0;
1194  t_h_curl(i) = t_m_at_pts(i) * a;
1195  ++t_h_curl;
1196  ++cc;
1197  }
1198  ++t_m_at_pts;
1199  }
1200  } else {
1201  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1202  for (int ll = 0; ll != nb_dofs; ll++) {
1203  const double val = t_h_curl(0);
1204  const double a = val / l0;
1205  t_h_curl(i) = t_m(i) * a;
1206  ++t_h_curl;
1207  ++cc;
1208  }
1209  }
1210  }
1211 
1212  if (cc != nb_gauss_pts * nb_dofs)
1213  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE, "Data inconsistency");
1214  }
1215  }
1216 
1218 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
static Index< 'i', 3 > i
FieldApproximationBase
approximation base
Definition: definitions.h:150
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:152

Member Data Documentation

◆ tAngent

const VectorDouble& MoFEM::OpSetCovariantPiolaTransformOnEdge::tAngent

Definition at line 585 of file DataOperators.hpp.

◆ tangentAtGaussPt

const MatrixDouble& MoFEM::OpSetCovariantPiolaTransformOnEdge::tangentAtGaussPt

Definition at line 586 of file DataOperators.hpp.


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