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

Public Member Functions

 OpFaceSide (CommonData &elem_data)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
 OpFaceSide (CommonData &elem_data)
 
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::FaceElementForcesAndSourcesCoreOnSideBase::UserDataOperator
const FaceElementForcesAndSourcesCoreOnSideBasegetFaceFE () const
 return pointer to Generic Volume Finite Element object More...
 
EdgeElementForcesAndSourcesCoreBasegetEdgeFE () const
 Get the edge side finite element. More...
 
int getEdgeSense () const
 get face sense in respect to volume More...
 
int getEdgeSideNumber () const
 get face side number in respect to volume More...
 
VectorDoublegetDirection ()
 
auto getFTensor1Direction ()
 get normal as tensor More...
 
MatrixDoublegetEdgeCoordsAtGaussPts ()
 get face coordinates at Gauss pts. More...
 
- Public Member Functions inherited from MoFEM::FaceElementForcesAndSourcesCoreBase::UserDataOperator
double getArea ()
 get area of face More...
 
double getMeasure ()
 get measure of element More...
 
VectorDoublegetNormal ()
 get triangle normal More...
 
VectorDoublegetTangent1 ()
 get triangle tangent 1 More...
 
VectorDoublegetTangent2 ()
 get triangle tangent 2 More...
 
auto getFTensor1Normal ()
 get normal as tensor More...
 
auto getFTensor1Tangent1 ()
 get tangentOne as tensor More...
 
auto getFTensor1Tangent2 ()
 get tangentTwo as tensor More...
 
int getNumNodes ()
 get element number of nodes More...
 
const EntityHandlegetConn ()
 get element connectivity More...
 
VectorDoublegetCoords ()
 get triangle coordinates More...
 
auto getFTensor1Coords ()
 get get coords at gauss points More...
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3) More...
 
auto getFTensor1CoordsAtGaussPts ()
 get coordinates at Gauss pts. More...
 
MatrixDoublegetHoCoordsAtGaussPts ()
 coordinate at Gauss points (if hierarchical approximation of element geometry) More...
 
auto getFTensor1HoCoordsAtGaussPts ()
 get coordinates at Gauss pts (takes in account ho approx. of geometry) More...
 
MatrixDoublegetNormalsAtGaussPts ()
 if higher order geometry return normals at Gauss pts. More...
 
DEPRECATED MatrixDoublegetNormalsAtGaussPt ()
 
ublas::matrix_row< MatrixDoublegetNormalsAtGaussPts (const int gg)
 if higher order geometry return normals at Gauss pts. More...
 
DEPRECATED ublas::matrix_row< MatrixDoublegetNormalsAtGaussPt (const int gg)
 
MatrixDoublegetTangent1AtGaussPts ()
 if higher order geometry return tangent vector to triangle at Gauss pts. More...
 
MatrixDoublegetTangent2AtGaussPts ()
 if higher order geometry return tangent vector to triangle at Gauss pts. More...
 
auto getFTensor1NormalsAtGaussPts ()
 get normal at integration points More...
 
auto getFTensor1Tangent1AtGaussPts ()
 get tangent 1 at integration points More...
 
auto getFTensor1Tangent2AtGaussPts ()
 get tangent 2 at integration points More...
 
const FaceElementForcesAndSourcesCoreBasegetFaceFE ()
 return pointer to Generic Triangle Finite Element object More...
 
DEPRECATED const FaceElementForcesAndSourcesCoreBasegetFaceElementForcesAndSourcesCore ()
 
template<int SWITCH>
MoFEMErrorCode loopSideVolumes (const string &fe_name, VolumeElementForcesAndSourcesCoreOnSideSwitch< SWITCH > &fe_method)
 
- 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...
 

Public Attributes

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

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...
 
- Protected Member Functions inherited from MoFEM::FaceElementForcesAndSourcesCoreOnSideBase::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
continuity_check_on_skeleton_with_simple_2d.cpp.

Definition at line 48 of file continuity_check_on_skeleton_with_simple_2d.cpp.

Constructor & Destructor Documentation

◆ OpFaceSide() [1/2]

SkeletonFE::OpFaceSide::OpFaceSide ( CommonData elem_data)

Definition at line 51 of file continuity_check_on_skeleton_with_simple_2d.cpp.

52  : FaceEleOnSideOp("FIELD", UserDataOperator::OPROW), elemData(elem_data) {}
FaceEleOnSide::UserDataOperator FaceEleOnSideOp

◆ OpFaceSide() [2/2]

SkeletonFE::OpFaceSide::OpFaceSide ( CommonData elem_data)

Definition at line 52 of file continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp.

53  : FaceEleOnSideOp("FIELD", UserDataOperator::OPROW), elemData(elem_data) {}
FaceEleOnSide::UserDataOperator FaceEleOnSideOp

Member Function Documentation

◆ doWork() [1/2]

MoFEMErrorCode SkeletonFE::OpFaceSide::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 54 of file continuity_check_on_skeleton_with_simple_2d.cpp.

55  {
57 
58  if (type == MBEDGE && side == getEdgeSideNumber()) {
59 
61 
62  const double eps = 1e-12;
63  if (norm_inf(diff) > eps)
64  SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
65  "coordinates at integration pts are different");
66 
67  const size_t nb_dofs = data.getN().size2() / 3;
68  const size_t nb_integration_pts = data.getN().size1();
69 
70  auto t_tangent = getFTensor1Direction();
71  auto t_hcurl_base = data.getFTensor1N<3>();
73  MatrixDouble *ptr_dot_elem_data = nullptr;
74  if (getFEMethod()->nInTheLoop == 0)
75  ptr_dot_elem_data = &elemData.dotEleLeft;
76  else
77  ptr_dot_elem_data = &elemData.dotEleRight;
78  MatrixDouble &dot_elem_data = *ptr_dot_elem_data;
79  dot_elem_data.resize(nb_integration_pts, nb_dofs, false);
80 
81  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
82  for (size_t bb = 0; bb != nb_dofs; ++bb) {
83  dot_elem_data(gg, bb) = t_tangent(i) * t_hcurl_base(i);
84  ++t_hcurl_base;
85  }
86  }
87  }
89  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
int nInTheLoop
number currently of processed method
static const double eps
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26

◆ doWork() [2/2]

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

56  {
58 
59  if (type == MBEDGE && side == getEdgeSideNumber()) {
60 
62 
63  const double eps = 1e-12;
64  if (norm_inf(diff) > eps)
65  SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
66  "coordinates at integration pts are different");
67 
68  const size_t nb_dofs = data.getN().size2() / 3;
69  const size_t nb_integration_pts = data.getN().size1();
70 
71  auto &dir = getDirection();
72  FTensor::Tensor1<double, 2> t_normal{-dir(1), dir(0)};
73  auto t_hdiv_base = data.getFTensor1N<3>();
75  MatrixDouble *ptr_dot_elem_data = nullptr;
76  if (getFEMethod()->nInTheLoop == 0)
77  ptr_dot_elem_data = &elemData.dotEleLeft;
78  else
79  ptr_dot_elem_data = &elemData.dotEleRight;
80  MatrixDouble &dot_elem_data = *ptr_dot_elem_data;
81  dot_elem_data.resize(nb_integration_pts, nb_dofs, false);
82 
83  for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
84  for (size_t bb = 0; bb != nb_dofs; ++bb) {
85  dot_elem_data(gg, bb) = t_normal(i) * t_hdiv_base(i);
86  ++t_hdiv_base;
87  }
88  }
89  }
91  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
int nInTheLoop
number currently of processed method
static const double eps
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26

Member Data Documentation

◆ elemData

CommonData & SkeletonFE::OpFaceSide::elemData

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