v0.13.1
Classes | Public Member Functions | Public Attributes | List of all members
SkeletonFE Struct Reference
Inheritance diagram for SkeletonFE:
[legend]
Collaboration diagram for SkeletonFE:
[legend]

Classes

struct  OpFaceSide
 

Public Member Functions

 SkeletonFE (MoFEM::Interface &m_field, CommonData &elem_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
 SkeletonFE (MoFEM::Interface &m_field, CommonData &elem_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
 SkeletonFE (MoFEM::Interface &m_field, CommonData &elem_data)
 
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 EntityHandle * getConn ()
 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 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...
 

Public Attributes

CommonDataelemData
 
FaceEleOnSide faceSideFe
 
- 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...
 

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)>
 
- 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

Examples
continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, and continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp.

Definition at line 28 of file continuity_check_on_skeleton_with_simple_2d_for_h1.cpp.

Constructor & Destructor Documentation

◆ SkeletonFE() [1/3]

SkeletonFE::SkeletonFE ( MoFEM::Interface m_field,
CommonData elem_data 
)

◆ SkeletonFE() [2/3]

SkeletonFE::SkeletonFE ( MoFEM::Interface m_field,
CommonData elem_data 
)

Definition at line 77 of file continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp.

78 : EdgeEle::UserDataOperator("FIELD", UserDataOperator::OPROW),
79 faceSideFe(m_field), elemData(elem_data) {
80 faceSideFe.getOpPtrVector().push_back(
83 }
@ HCURL
field with continuous tangents
Definition: definitions.h:86
transform Hcurl base fluxes from reference element to physical triangle

◆ SkeletonFE() [3/3]

SkeletonFE::SkeletonFE ( MoFEM::Interface m_field,
CommonData elem_data 
)

Definition at line 78 of file continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp.

79 : EdgeEle::UserDataOperator("FIELD", UserDataOperator::OPROW),
80 faceSideFe(m_field), elemData(elem_data) {
81
82 auto jac_ptr = boost::make_shared<MatrixDouble>();
83 faceSideFe.getOpPtrVector().push_back(
84 new OpCalculateHOJacForFace(jac_ptr));
86 faceSideFe.getOpPtrVector().push_back(
88 faceSideFe.getOpPtrVector().push_back(
90
91 }
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
OpSetContravariantPiolaTransformOnFace2DImpl< 2 > OpSetContravariantPiolaTransformOnFace2D
Make Hdiv space from Hcurl space in 2d.

Member Function Documentation

◆ doWork() [1/3]

MoFEMErrorCode SkeletonFE::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.

Examples
continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, and continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp.

Definition at line 91 of file continuity_check_on_skeleton_with_simple_2d_for_h1.cpp.

92 {
93
95 if (type == MBEDGE) {
96
97 const size_t nb_dofs = data.getN().size2();
98 const size_t nb_integration_pts = data.getN().size1();
99
100 MOFEM_LOG("ATOM", Sev::noisy)
101 << "Cords at integration points" << getCoordsAtGaussPts();
102
103 auto t_base = data.getFTensor0N();
104 elemData.dotEdge.resize(nb_integration_pts, nb_dofs, false);
105 elemData.dotEleLeft.resize(nb_integration_pts, 0, false);
106 elemData.dotEleRight.resize(nb_integration_pts, 0, false);
107
108 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
109 for (size_t bb = 0; bb != nb_dofs; ++bb) {
110 elemData.dotEdge(gg, bb) = t_base;
111 ++t_base;
112 }
113 }
114
116
117 auto check_continuity_of_base = [&](auto &vol_dot_data) {
119
120 if (vol_dot_data.size1() != elemData.dotEdge.size1())
121 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
122 "Inconsistent number of integration points");
123
124 if (vol_dot_data.size2() != elemData.dotEdge.size2())
125 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
126 "Inconsistent number of base functions");
127 const double eps = 1e-12;
128 for (size_t gg = 0; gg != vol_dot_data.size1(); ++gg)
129 for (size_t bb = 0; bb != vol_dot_data.size2(); ++bb) {
130 const double error =
131 std::abs(vol_dot_data(gg, bb) - elemData.dotEdge(gg, bb));
132 if (error > eps)
133 SETERRQ4(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
134 "Inconsistency (%d, %d) %3.4e != %3.4e", gg, bb,
135 vol_dot_data(gg, bb), elemData.dotEdge(gg, bb));
136 else
137 MOFEM_LOG("ATOM", Sev::noisy) << "Ok";
138 }
140 };
141
142 if (elemData.dotEleLeft.size2() != 0)
143 CHKERR check_continuity_of_base(elemData.dotEleLeft);
144 else if (elemData.dotEleRight.size2() != 0)
145 CHKERR check_continuity_of_base(elemData.dotEleRight);
146 }
148 }
static const double eps
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:301
MoFEMErrorCode loopSideFaces(const string fe_name, FaceElementForcesAndSourcesCoreOnSide &fe_side)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)

◆ doWork() [2/3]

MoFEMErrorCode SkeletonFE::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 85 of file continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp.

86 {
87
89 if (type == MBEDGE) {
90
91 const size_t nb_dofs = data.getN().size2() / 3;
92 const size_t nb_integration_pts = data.getN().size1();
93
94 auto t_tangent = getFTensor1Direction();
95 auto t_hcurl_base = data.getFTensor1N<3>();
97 elemData.dotEdge.resize(nb_integration_pts, nb_dofs, false);
98 elemData.dotEleLeft.resize(nb_integration_pts, 0, false);
99 elemData.dotEleRight.resize(nb_integration_pts, 0, false);
100
101 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
102 for (size_t bb = 0; bb != nb_dofs; ++bb) {
103 elemData.dotEdge(gg, bb) = t_tangent(i) * t_hcurl_base(i);
104 ++t_hcurl_base;
105 }
106 }
107
109
110 auto check_continuity_of_base = [&](auto &vol_dot_data) {
112
113 if (vol_dot_data.size1() != elemData.dotEdge.size1())
114 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
115 "Inconsistent number of integration points");
116
117 if (vol_dot_data.size2() != elemData.dotEdge.size2())
118 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
119 "Inconsistent number of base functions");
120 const double eps = 1e-12;
121 for (size_t gg = 0; gg != vol_dot_data.size1(); ++gg)
122 for (size_t bb = 0; bb != vol_dot_data.size2(); ++bb) {
123 const double error =
124 std::abs(vol_dot_data(gg, bb) - elemData.dotEdge(gg, bb));
125 if (error > eps)
126 SETERRQ4(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
127 "Inconsistency (%d, %d) %3.4e != %3.4e", gg, bb,
128 vol_dot_data(gg, bb), elemData.dotEdge(gg, bb));
129 else
130 MOFEM_LOG("ATOM", Sev::noisy) << "Ok";
131
132 }
134 };
135
136 if (elemData.dotEleLeft.size2() != 0)
137 CHKERR check_continuity_of_base(elemData.dotEleLeft);
138 else if (elemData.dotEleRight.size2() != 0)
139 CHKERR check_continuity_of_base(elemData.dotEleRight);
140
141 }
143 }
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.

◆ doWork() [3/3]

MoFEMErrorCode SkeletonFE::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 93 of file continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp.

94 {
95
97 if (type == MBEDGE) {
98
99 const size_t nb_dofs = data.getN().size2() / 3;
100 const size_t nb_integration_pts = data.getN().size1();
101
102 auto &dir = getDirection();
103 FTensor::Tensor1<double, 2> t_normal{-dir(1), dir(0)};
104 auto t_hdiv_base = data.getFTensor1N<3>();
106 elemData.dotEdge.resize(nb_integration_pts, nb_dofs, false);
107 elemData.dotEleLeft.resize(nb_integration_pts, 0, false);
108 elemData.dotEleRight.resize(nb_integration_pts, 0, false);
109
110 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
111 for (size_t bb = 0; bb != nb_dofs; ++bb) {
112 elemData.dotEdge(gg, bb) = t_normal(i) * t_hdiv_base(i);
113 ++t_hdiv_base;
114 }
115 }
116
118
119 auto check_continuity_of_base = [&](auto &vol_dot_data) {
121
122 if (vol_dot_data.size1() != elemData.dotEdge.size1())
123 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
124 "Inconsistent number of integration points");
125
126 if (vol_dot_data.size2() != elemData.dotEdge.size2())
127 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
128 "Inconsistent number of base functions");
129 const double eps = 1e-12;
130 for (size_t gg = 0; gg != vol_dot_data.size1(); ++gg)
131 for (size_t bb = 0; bb != vol_dot_data.size2(); ++bb) {
132 const double error =
133 std::abs(vol_dot_data(gg, bb) - elemData.dotEdge(gg, bb));
134 if (error > eps)
135 SETERRQ4(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
136 "Inconsistency (%d, %d) %3.4e != %3.4e", gg, bb,
137 vol_dot_data(gg, bb), elemData.dotEdge(gg, bb));
138 }
140 };
141
142 if (elemData.dotEleLeft.size2() != 0)
143 CHKERR check_continuity_of_base(elemData.dotEleLeft);
144 else if (elemData.dotEleRight.size2() != 0)
145 CHKERR check_continuity_of_base(elemData.dotEleRight);
146
147 }
149 }

Member Data Documentation

◆ elemData

CommonData & SkeletonFE::elemData

◆ faceSideFe

FaceEleOnSide SkeletonFE::faceSideFe

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