v0.13.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
MoFEM::EdgeElementForcesAndSourcesCore::UserDataOperator Struct Reference

default operator for EDGE element More...

#include <src/finite_elements/EdgeElementForcesAndSourcesCore.hpp>

Inheritance diagram for MoFEM::EdgeElementForcesAndSourcesCore::UserDataOperator:
[legend]
Collaboration diagram for MoFEM::EdgeElementForcesAndSourcesCore::UserDataOperator:
[legend]

Public Member Functions

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

Protected Member Functions

MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 

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 Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

default operator for EDGE element

Examples
continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, forces_and_sources_testing_edge_element.cpp, hcurl_divergence_operator_2d.cpp, helmholtz.cpp, and phase.cpp.

Definition at line 66 of file EdgeElementForcesAndSourcesCore.hpp.

Member Function Documentation

◆ getConn()

const EntityHandle * EdgeElementForcesAndSourcesCore::UserDataOperator::getConn ( )
inline

◆ getCoords()

VectorDouble & EdgeElementForcesAndSourcesCore::UserDataOperator::getCoords ( )
inline

get edge node coordinates

Definition at line 180 of file EdgeElementForcesAndSourcesCore.hpp.

◆ getDirection()

VectorDouble & EdgeElementForcesAndSourcesCore::UserDataOperator::getDirection ( )
inline

◆ getEdgeFE()

const EdgeElementForcesAndSourcesCore * EdgeElementForcesAndSourcesCore::UserDataOperator::getEdgeFE ( )
inline

get pointer to this finite element

Definition at line 191 of file EdgeElementForcesAndSourcesCore.hpp.

191 {
192 return static_cast<EdgeElementForcesAndSourcesCore *>(ptrFE);
193}

◆ getFTensor1Direction()

FTensor::Tensor1< double, 3 > EdgeElementForcesAndSourcesCore::UserDataOperator::getFTensor1Direction ( )
inline

◆ getFTensor1Normal() [1/2]

auto EdgeElementForcesAndSourcesCore::UserDataOperator::getFTensor1Normal ( )
inline

get edge normal NOTE: it should be used only in 2D analysis

Examples
continuity_check_on_skeleton_3d.cpp, hcurl_divergence_operator_2d.cpp, and phase.cpp.

Definition at line 236 of file EdgeElementForcesAndSourcesCore.hpp.

237 {
238 FTensor::Tensor1<double, 3> t_normal{0., 0., 1.};
239 return getFTensor1Normal(t_normal);
240}
auto getFTensor1Normal()
get edge normal NOTE: it should be used only in 2D analysis

◆ getFTensor1Normal() [2/2]

auto EdgeElementForcesAndSourcesCore::UserDataOperator::getFTensor1Normal ( const FTensor::Tensor1< double, 3 > &  vec)
inline

get ftensor1 edge normal

Parameters
vecvector in third direction
Returns
auto

Definition at line 225 of file EdgeElementForcesAndSourcesCore.hpp.

226 {
231 auto t_dir = getFTensor1Direction();
232 t_normal(i) = FTensor::levi_civita(i, j, k) * t_dir(j) * vec(k);
233 return t_normal;
234}
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use

◆ getFTensor1TangentAtGaussPts() [1/2]

template<int DIM = 3>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, DIM > MoFEM::EdgeElementForcesAndSourcesCore::UserDataOperator::getFTensor1TangentAtGaussPts ( )
inline

Get tangent vector at integration points.

Returns
FTensor::Tensor1<FTensor::PackPtr<double *, 3>, DIM>

◆ getFTensor1TangentAtGaussPts() [2/2]

FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 2 > EdgeElementForcesAndSourcesCore::UserDataOperator::getFTensor1TangentAtGaussPts< 2 >
inline

Definition at line 202 of file EdgeElementForcesAndSourcesCore.hpp.

211 {
212 double *ptr = &*getTangentAtGaussPts().data().begin();
214 &ptr[2]);
215}
MatrixDouble & getTangentAtGaussPts()
get tangent vector to edge curve at integration points

◆ getLength()

double EdgeElementForcesAndSourcesCore::UserDataOperator::getLength ( )
inline

get edge length

Definition at line 166 of file EdgeElementForcesAndSourcesCore.hpp.

◆ getMeasure()

double EdgeElementForcesAndSourcesCore::UserDataOperator::getMeasure ( )
inline

get measure of element

Returns
length of face

Definition at line 170 of file EdgeElementForcesAndSourcesCore.hpp.

◆ getTangentAtGaussPts()

MatrixDouble & EdgeElementForcesAndSourcesCore::UserDataOperator::getTangentAtGaussPts ( )
inline

get tangent vector to edge curve at integration points

Definition at line 185 of file EdgeElementForcesAndSourcesCore.hpp.

◆ getTangetAtGaussPts()

DEPRECATED MatrixDouble & MoFEM::EdgeElementForcesAndSourcesCore::UserDataOperator::getTangetAtGaussPts ( )
inline

Definition at line 115 of file EdgeElementForcesAndSourcesCore.hpp.

115 {
116 return getTangentAtGaussPts();
117 }

◆ getTensor1Coords()

FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > EdgeElementForcesAndSourcesCore::UserDataOperator::getTensor1Coords ( )
inline

get get coords at gauss points

auto t_center;
auto t_coords = getTensor1Coords();
t_center(i) = 0;
for(int nn = 0;nn!=2;nn++) {
t_center(i) += t_coords(i);
++t_coords;
}
t_center(i) /= 2;
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getTensor1Coords()
get get coords at gauss points

Definition at line 202 of file EdgeElementForcesAndSourcesCore.hpp.

202 {
203 double *ptr = &*getCoords().data().begin();
205 &ptr[2]);
206}

◆ loopSideFaces()

MoFEMErrorCode EdgeElementForcesAndSourcesCore::UserDataOperator::loopSideFaces ( const string  fe_name,
FaceElementForcesAndSourcesCoreOnSide fe_side 
)
Examples
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 142 of file EdgeElementForcesAndSourcesCore.cpp.

143 {
144 return loopSide(fe_name, &fe_side, 2);
145}
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...

◆ setPtrFE()

MoFEMErrorCode EdgeElementForcesAndSourcesCore::UserDataOperator::setPtrFE ( ForcesAndSourcesCore ptr)
protectedvirtual

Reimplemented from MoFEM::ForcesAndSourcesCore::UserDataOperator.

Definition at line 132 of file EdgeElementForcesAndSourcesCore.cpp.

133 {
135 if (!(ptrFE = dynamic_cast<EdgeElementForcesAndSourcesCore *>(ptr)))
136 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
137 "User operator and finite element do not work together");
139}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
@ 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

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