v0.13.1
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
MoFEM::OpHOSetContravariantPiolaTransformOnEdge3D Struct Reference

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

#include <src/finite_elements/HODataOperators.hpp>

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

Public Member Functions

 OpHOSetContravariantPiolaTransformOnEdge3D (const FieldSpace space=HCURL, boost::shared_ptr< MatrixDouble > tangent_at_pts=nullptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
- Public Member Functions inherited from MoFEM::EdgeElementForcesAndSourcesCore::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...
 
auto getFTensor1Normal ()
 get edge normal NOTE: it should be used only in 2D analysis More...
 
auto getFTensor1Normal (const FTensor::Tensor1< double, 3 > &vec)
 get ftensor1 edge normal More...
 
VectorDoublegetCoords ()
 get edge node coordinates More...
 
MatrixDoublegetTangentAtGaussPts ()
 get tangent vector to edge curve at integration points More...
 
DEPRECATED MatrixDoublegetTangetAtGaussPts ()
 
const EdgeElementForcesAndSourcesCoregetEdgeFE ()
 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...
 
template<int DIM = 3>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, DIM > getFTensor1TangentAtGaussPts ()
 Get tangent vector at integration points. More...
 
MoFEMErrorCode loopSideFaces (const string fe_name, FaceElementForcesAndSourcesCoreOnSide &fe_side)
 
template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1TangentAtGaussPts ()
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, 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...
 
int getFEDim () const
 Get dimension of finite element. More...
 
EntityType getFEType () const
 Get dimension of finite element. More...
 
boost::weak_ptr< SideNumbergetSideNumberPtr (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 () const
 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...
 
std::string getFEName () const
 Get name of the element. More...
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
ForcesAndSourcesCoregetRefinePtrFE () const
 
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
 
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 getTStimeStep () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3) More...
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry. More...
 
double getMeasure () const
 get measure of element More...
 
doublegetMeasure ()
 get measure of element More...
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over elements on the side of face. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopParent (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. More...
 
MoFEMErrorCode loopChildren (const string &fe_name, ForcesAndSourcesCore *child_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User call this function to loop over parent elements. This function calls finite element with is operator to do calculations. 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, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &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...
 

Private Attributes

boost::shared_ptr< MatrixDoubletangentAtGaussPts
 

Additional Inherited Members

- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType {
  OPROW = 1 << 0 , OPCOL = 1 << 1 , OPROWCOL = 1 << 2 , OPSPACE = 1 << 3 ,
  OPLAST = 1 << 3
}
 Controls loop over entities on element. More...
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
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...
 
- Static Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
static const char *const OpTypeNames []
 
- Protected Member Functions inherited from MoFEM::EdgeElementForcesAndSourcesCore::UserDataOperator
MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

transform Hcurl base fluxes from reference element to physical edge

Examples
continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp.

Definition at line 291 of file HODataOperators.hpp.

Constructor & Destructor Documentation

◆ OpHOSetContravariantPiolaTransformOnEdge3D()

MoFEM::OpHOSetContravariantPiolaTransformOnEdge3D::OpHOSetContravariantPiolaTransformOnEdge3D ( const FieldSpace  space = HCURL,
boost::shared_ptr< MatrixDouble tangent_at_pts = nullptr 
)
inline

Definition at line 294 of file HODataOperators.hpp.

297 : EdgeElementForcesAndSourcesCore::UserDataOperator(space),
298 tangentAtGaussPts(tangent_at_pts) {}
boost::shared_ptr< MatrixDouble > tangentAtGaussPts

Member Function Documentation

◆ doWork()

MoFEMErrorCode MoFEM::OpHOSetContravariantPiolaTransformOnEdge3D::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
virtual

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

Reimplemented from MoFEM::DataOperator.

Definition at line 563 of file HODataOperators.cpp.

564 {
567
568 if (type != MBEDGE)
570
571 const auto nb_gauss_pts = getGaussPts().size2();
572
574 if (tangentAtGaussPts->size1() != nb_gauss_pts)
575 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
576 "Wrong number of integration points %d!=%d",
577 tangentAtGaussPts->size1(), nb_gauss_pts);
578
579 auto get_base_at_pts = [&](auto base) {
581 &data.getN(base)(0, HVEC0), &data.getN(base)(0, HVEC1),
582 &data.getN(base)(0, HVEC2));
583 return t_h_curl;
584 };
585
586 auto get_tangent_ptr = [&]() {
587 if (tangentAtGaussPts) {
588 return &*tangentAtGaussPts->data().begin();
589 } else {
590 return &*getTangentAtGaussPts().data().begin();
591 }
592 };
593
594 auto get_tangent_at_pts = [&]() {
595 auto ptr = get_tangent_ptr();
597 &ptr[0], &ptr[1], &ptr[2]);
598 return t_m_at_pts;
599 };
600
601 auto calculate_squared_edge_length = [&]() {
602 std::vector<double> l1;
603 if (nb_gauss_pts) {
604 l1.resize(nb_gauss_pts);
605 auto t_m_at_pts = get_tangent_at_pts();
606 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
607 l1[gg] = t_m_at_pts(i) * t_m_at_pts(i);
608 ++t_m_at_pts;
609 }
610 }
611 return l1;
612 };
613
614 auto l1 = calculate_squared_edge_length();
615
616 for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
617
619 const auto nb_dofs = data.getN(base).size2() / 3;
620
621 if (nb_gauss_pts && nb_dofs) {
622 auto t_h_curl = get_base_at_pts(base);
623 int cc = 0;
624 auto t_m_at_pts = get_tangent_at_pts();
625 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
626 const double l0 = l1[gg];
627 for (int ll = 0; ll != nb_dofs; ++ll) {
628 const double val = t_h_curl(0);
629 const double a = val / l0;
630 t_h_curl(i) = t_m_at_pts(i) * a;
631 ++t_h_curl;
632 ++cc;
633 }
634 ++t_m_at_pts;
635 }
636
637#ifndef NDEBUG
638 if (cc != nb_gauss_pts * nb_dofs)
639 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSIBLE_CASE, "Data inconsistency");
640#endif
641 }
642 }
643
645}
constexpr double a
FieldApproximationBase
approximation base
Definition: definitions.h:58
@ LASTBASE
Definition: definitions.h:69
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ HVEC0
Definition: definitions.h:186
@ HVEC1
Definition: definitions.h:186
@ HVEC2
Definition: definitions.h:186
@ MOFEM_IMPOSIBLE_CASE
Definition: definitions.h:35
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
FTensor::Index< 'i', SPACE_DIM > i
MatrixDouble & getTangentAtGaussPts()
get tangent vector to edge curve at integration points
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element

Member Data Documentation

◆ tangentAtGaussPts

boost::shared_ptr<MatrixDouble> MoFEM::OpHOSetContravariantPiolaTransformOnEdge3D::tangentAtGaussPts
private

Definition at line 304 of file HODataOperators.hpp.


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