v0.13.2
Loading...
Searching...
No Matches
FaceElementForcesAndSourcesCoreOnSide.hpp
Go to the documentation of this file.
1/** \file FaceElementForcesAndSourcesCoreOnSide.hpp
2 \brief Implementation of face element.
3
4*/
5
6
7
8#ifndef __FACEELEMENTFORCESANDSOURCESCORE_ONSIDE__HPP__
9#define __FACEELEMENTFORCESANDSOURCESCORE_ONSIDE__HPP__
10
11using namespace boost::numeric;
12
13namespace MoFEM {
14
15/**
16 * \brief Base face element used to integrate on skeleton
17 * \ingroup mofem_forces_and_sources_volume_element
18 */
21
23 FaceElementForcesAndSourcesCore;
24
25 int getRule(int order);
26
27 /**
28 * @brief Get the face nodes mapped on volume element
29 *
30 * \todo That this is not general, e.g., for quad number of nodes is 4.
31 *
32 * @return const std::array<int, 3>&
33 */
34 inline const std::array<int, 2> &getEdgeConnMap() const;
35
36 /**
37 * @brief Get face nodes maped on volume
38 *
39 * @return const sdt::array<int, 4>&
40 */
41 inline const std::array<int, 4> &getFaceConnMap() const;
42
43 /**
44 * @brief Get node on volume opposite to skeleton element
45 *
46 * @return int
47 */
48 inline int getOppositeNode() const;
49
50 /**
51 * @brief Sense face on volume
52 * @deprecated use getSkeletonSense()
53 *
54 * @return int
55 */
56 DEPRECATED inline int getEdgeSense() const;
57
58 /* @brief Get the skeleton sense
59 *
60 * calls getFaceSense()
61 *
62 * @return int
63 */
64 inline int getSkeletonSense() const;
65
66 /**
67 * @brief Face number on the volume
68 *
69 * @return int
70 */
71 inline int getEdgeSideNumber() const;
72
73 /** \brief default operator for Face element
74 * \ingroup mofem_forces_and_sources_volume_element
75 */
76 struct UserDataOperator;
77
78protected:
80
81private:
82 int edgeSense; ///< Sense of edge, could be 1 or -1
83 int edgeSideNumber; ///< Edge side number
84 std::array<int, 2> edgeConnMap;
85 std::array<int, 4> faceConnMap;
87};
88
89/** \brief default operator for Face element
90 * \ingroup mofem_forces_and_sources_volume_element
91 */
94
95 using FaceElementForcesAndSourcesCore::UserDataOperator::UserDataOperator;
96
97 /** \brief return pointer to Generic Volume Finite Element object
98 */
100
101 /**
102 * @brief Get the edge side finite element
103 *
104 * @return EdgeElementForcesAndSourcesCore*
105 */
107
108 /**
109 * @brief get face sense in respect to volume
110 * @deprecated use getSkeletonSense()
111 * @return edge sense
112 */
113 DEPRECATED inline int getEdgeSense() const;
114
115 /* @brief Get the skeleton sense
116 *
117 * calls getEdgeSense()
118 *
119 * @return int
120 */
121 inline int getSkeletonSense() const;
122
123 /**
124 * \brief get face side number in respect to volume
125 * @return edge side number
126 */
127 inline int getEdgeSideNumber() const;
128
129 /**
130 * get face normal on side which is this element
131 * @return face normal
132 */
133 inline VectorDouble &getDirection();
134
135 /** \brief get normal as tensor
136 */
137 inline auto getFTensor1Direction();
138
139 /** \brief get face coordinates at Gauss pts.
140
141 \note Coordinates should be the same what function getCoordsAtGaussPts
142 on face is returning. If both coordinates are different it is error, or you
143 do something very unusual.
144
145 */
147
148protected:
150};
151
152const std::array<int, 2> &
154 return edgeConnMap;
155}
156
157const std::array<int, 4> &
159 return faceConnMap;
160}
161
163 return oppositeNode;
164}
165
167 return getSkeletonSense();
168}
169
171 return edgeSense;
172}
173
175 return edgeSideNumber;
176}
177
179FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getFaceFE() const {
180 return static_cast<FaceElementForcesAndSourcesCoreOnSide *>(ptrFE);
181}
182
184FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getEdgeFE() const {
185 return static_cast<EdgeElementForcesAndSourcesCore *>(ptrFE->sidePtrFE);
186}
187
188int FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getEdgeSense()
189 const {
190 return getSkeletonSense();
191}
192
193int FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getSkeletonSense()
194 const {
195 return getFaceFE()->edgeSense;
196}
197
198int FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::
199 getEdgeSideNumber() const {
200 return getFaceFE()->edgeSideNumber;
201}
202
204FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getDirection() {
205 return getEdgeFE()->dIrection;
206}
207
208auto FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::
209 getFTensor1Direction() {
210 double *ptr = &*getDirection().data().begin();
211 return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2]);
212}
213
214MatrixDouble &FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::
215 getEdgeCoordsAtGaussPts() {
216 return getEdgeFE()->coordsAtGaussPts;
217}
218
219/**
220 * @deprecated do not use needed for back compatibility
221 */
222template <int SWITCH>
226 FaceElementForcesAndSourcesCoreOnSide;
229};
230
231} // namespace MoFEM
232
233#endif //__FACEELEMENTFORCESANDSOURCESCORE_ONSIDE___HPP__
#define DEPRECATED
Definition: definitions.h:17
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
DEPRECATED int getEdgeSense() const
get face sense in respect to volume
EdgeElementForcesAndSourcesCore * getEdgeFE() const
Get the edge side finite element.
const FaceElementForcesAndSourcesCoreOnSide * getFaceFE() const
return pointer to Generic Volume Finite Element object
Base face element used to integrate on skeleton.
int getOppositeNode() const
Get node on volume opposite to skeleton element.
const std::array< int, 4 > & getFaceConnMap() const
Get face nodes maped on volume.
const std::array< int, 2 > & getEdgeConnMap() const
Get the face nodes mapped on volume element.
structure to get information form mofem into EntitiesFieldData