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

#include <src/finite_elements/UserDataOperators.hpp>

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

Public Member Functions

 OpSetContrariantPiolaTransformOnEdge ()
 
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::EdgeElementForcesAndSourcesCoreBase::UserDataOperator
const EntityHandlegetConn ()
 get element connectivity More...
 
double getLength ()
 get edge length More...
 
double getMeasure ()
 get measure of element More...
 
VectorDoublegetDirection ()
 get edge direction More...
 
VectorDoublegetCoords ()
 get edge node coordinates More...
 
MatrixDoublegetCoordsAtGaussPts ()
 get coordinate at integration point More...
 
auto getFTensor1CoordsAtGaussPts ()
 get coordinates at Gauss pts. More...
 
MatrixDoublegetTangetAtGaussPts ()
 get tangent vector to edge curve at integration points More...
 
const EdgeElementForcesAndSourcesCoreBasegetEdgeFE ()
 get pointer to this finite element More...
 
FTensor::Tensor1< double, 3 > getFTensor1Direction ()
 
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getTensor1Coords ()
 get get coords at gauss points More...
 
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1TangentAtGaussPts ()
 
template<int SWITCH>
MoFEMErrorCode loopSideFaces (const string &fe_name, FaceElementForcesAndSourcesCoreOnSideSwitch< SWITCH > &fe_side)
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPLAST, const bool symm=true)
 
 UserDataOperator (const std::string &field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string &row_field_name, const std::string &col_field_name, const char type, const bool symm=true)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement. More...
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle. More...
 
boost::weak_ptr< SideNumber > getSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer. More...
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity. More...
 
int getNumberOfNodesOnElement ()
 Get the number of nodes on finite element. More...
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices. More...
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices. More...
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object. More...
 
int getOpType () const
 Get operator types. More...
 
void setOpType (const OpType type)
 Set operator type. More...
 
void addOpType (const OpType type)
 Add operator type. More...
 
int getNinTheLoop () const
 get number of finite element in the loop More...
 
int getLoopSize () const
 get size of elements in the loop More...
 
const std::string & getFEName () const
 Get name of the element. More...
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
DEPRECATED Vec getSnesF () const
 
DEPRECATED Vec getSnesX () const
 
DEPRECATED Mat getSnesA () const
 
DEPRECATED Mat getSnesB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTSa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
DEPRECATED MoFEMErrorCode getPorblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 
- 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...
 

Additional Inherited Members

- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType { OPROW = 1 << 0, OPCOL = 1 << 1, OPROWCOL = 1 << 2, OPLAST = 1 << 3 }
 Controls loop over entities on element. More...
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- 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...
 
- Protected Member Functions inherited from MoFEM::EdgeElementForcesAndSourcesCoreBase::UserDataOperator
MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

Examples
hcurl_divergence_operator_2d.cpp, and lesson8_contact.cpp.

Definition at line 1831 of file UserDataOperators.hpp.

Constructor & Destructor Documentation

◆ OpSetContrariantPiolaTransformOnEdge()

MoFEM::OpSetContrariantPiolaTransformOnEdge::OpSetContrariantPiolaTransformOnEdge ( )

Definition at line 1834 of file UserDataOperators.hpp.

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpSetContrariantPiolaTransformOnEdge::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 446 of file UserDataOperators.cpp.

447  {
449 
450  if (type != MBEDGE)
452 
453  const auto &edge_direction = getDirection();
454 
456  FTensor::Tensor1<double, 3> t_m(-edge_direction[1], edge_direction[0],
457  edge_direction[2]);
458  const double l0 = t_m(i) * t_m(i);
459 
460  std::vector<double> l1;
461  {
462  int nb_gauss_pts = getTangetAtGaussPts().size1();
463  if (nb_gauss_pts) {
464  l1.resize(nb_gauss_pts);
465  const auto &edge_direction = getTangetAtGaussPts();
467  &edge_direction(0, 0), &edge_direction(0, 1), &edge_direction(0, 2));
468  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
469  l1[gg] = t_m_at_pts(i) * t_m_at_pts(i);
470  ++t_m_at_pts;
471  }
472  }
473  }
474 
475  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
476 
477  FieldApproximationBase base = static_cast<FieldApproximationBase>(b);
478  size_t nb_gauss_pts = data.getN(base).size1();
479  size_t nb_dofs = data.getN(base).size2() / 3;
480  if (nb_gauss_pts > 0 && nb_dofs > 0) {
481 
482  auto t_h_div = data.getFTensor1N<3>(base);
483 
484  size_t cc = 0;
485  const auto &edge_direction_at_gauss_pts = getTangetAtGaussPts();
486  if (edge_direction_at_gauss_pts.size1() == nb_gauss_pts) {
487 
489  &edge_direction_at_gauss_pts(0, 1),
490  &edge_direction_at_gauss_pts(0, 0),
491  &edge_direction_at_gauss_pts(0, 2));
492 
493  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
494  const double l0 = l1[gg];
495  for (int ll = 0; ll != nb_dofs; ++ll) {
496  const double val = t_h_div(0);
497  const double a = val / l0;
498  t_h_div(i) = t_m_at_pts(i) * a;
499  t_h_div(0) *= -1;
500  ++t_h_div;
501  ++cc;
502  }
503  ++t_m_at_pts;
504  }
505 
506  } else {
507 
508  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
509  for (int ll = 0; ll != nb_dofs; ll++) {
510  const double val = t_h_div(0);
511  const double a = val / l0;
512  t_h_div(i) = t_m(i) * a;
513  ++t_h_div;
514  ++cc;
515  }
516  }
517  }
518 
519  if (cc != nb_gauss_pts * nb_dofs)
520  SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE, "Data inconsistency");
521  }
522  }
523 
525 }
#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
MatrixDouble & getTangetAtGaussPts()
get tangent vector to edge curve at integration points

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