v0.8.13
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 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 VectorDoubletAngent
 
const MatrixDoubletangentAtGaussPt
 
- 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 Hcurl base fluxes from reference element to physical edge

Definition at line 767 of file DataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetCovariantPiolaTransformOnEdge()

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

Definition at line 772 of file DataOperators.hpp.

775  :
776  tAngent(tangent),
777  tangentAtGaussPt(tangent_at_pts)
778  {}

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 left hand side.

Reimplemented from MoFEM::DataOperator.

Definition at line 1618 of file DataOperators.cpp.

1619  {
1621 
1622  if (type != MBEDGE)
1624 
1627  &tAngent[0], &tAngent[1], &tAngent[2]);
1628  const double l0 = t_m(i) * t_m(i);
1629  std::vector<double> l1;
1630  {
1631  int nb_gauss_pts = tangentAtGaussPt.size1();
1632  if (nb_gauss_pts) {
1633  l1.resize(nb_gauss_pts);
1635  &tangentAtGaussPt(0, 0), &tangentAtGaussPt(0, 1),
1636  &tangentAtGaussPt(0, 2));
1637  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
1638  l1[gg] = t_m_at_pts(i) * t_m_at_pts(i);
1639  ++t_m_at_pts;
1640  }
1641  }
1642  }
1643 
1644  for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
1645 
1646  FieldApproximationBase base = ApproximationBaseArray[b];
1647  int nb_gauss_pts = data.getHcurlN(base).size1();
1648  int nb_dofs = data.getHcurlN(base).size2() / 3;
1649  if (nb_gauss_pts > 0 && nb_dofs > 0) {
1651  &data.getHcurlN(base)(0, HCURL0), &data.getHcurlN(base)(0, HCURL1),
1652  &data.getHcurlN(base)(0, HCURL2));
1653  int cc = 0;
1654  if (tangentAtGaussPt.size1() == (unsigned int)nb_gauss_pts) {
1656  &tangentAtGaussPt(0, 0), &tangentAtGaussPt(0, 1),
1657  &tangentAtGaussPt(0, 2));
1658  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
1659  const double l0 = l1[gg];
1660  for (int ll = 0; ll != nb_dofs; ll++) {
1661  const double val = t_h_curl(0);
1662  const double a = val / l0;
1663  t_h_curl(i) = t_m_at_pts(i) * a;
1664  ++t_h_curl;
1665  ++cc;
1666  }
1667  ++t_m_at_pts;
1668  }
1669  } else {
1670  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
1671  for (int ll = 0; ll != nb_dofs; ll++) {
1672  const double val = t_h_curl(0);
1673  const double a = val / l0;
1674  t_h_curl(i) = t_m(i) * a;
1675  ++t_h_curl;
1676  ++cc;
1677  }
1678  }
1679  }
1680  if (cc != nb_gauss_pts * nb_dofs) {
1681  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE, "Data inconsistency");
1682  }
1683  }
1684  }
1685 
1687 }
user implemented approximation base
Definition: definitions.h:151
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:519
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
FieldApproximationBase
approximation base
Definition: definitions.h:140
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142

Member Data Documentation

◆ tAngent

const VectorDouble& MoFEM::OpSetCovariantPiolaTransformOnEdge::tAngent

Definition at line 769 of file DataOperators.hpp.

◆ tangentAtGaussPt

const MatrixDouble& MoFEM::OpSetCovariantPiolaTransformOnEdge::tangentAtGaussPt

Definition at line 770 of file DataOperators.hpp.


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