v0.14.0
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 
11 using namespace boost::numeric;
12 
13 namespace MoFEM {
14 
15 /**
16  * \brief Base face element used to integrate on skeleton
17  * \ingroup mofem_forces_and_sources_volume_element
18  */
21 
22  using FaceElementForcesAndSourcesCore::
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 
78 protected:
79  MoFEMErrorCode setGaussPts(int order);
80 
81 private:
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 
96 
97  /** \brief return pointer to Generic Volume Finite Element object
98  */
99  inline const FaceElementForcesAndSourcesCoreOnSide *getFaceFE() const;
100 
101  /**
102  * @brief Get the edge side finite element
103  *
104  * @return EdgeElementForcesAndSourcesCore*
105  */
106  inline EdgeElementForcesAndSourcesCore *getEdgeFE() const;
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  */
146  inline MatrixDouble &getEdgeCoordsAtGaussPts();
147 
148 protected:
149  MoFEMErrorCode setPtrFE(ForcesAndSourcesCore *ptr);
150 };
151 
152 const std::array<int, 2> &
153 FaceElementForcesAndSourcesCoreOnSide::getEdgeConnMap() const {
154  return edgeConnMap;
155 }
156 
157 const std::array<int, 4> &
158 FaceElementForcesAndSourcesCoreOnSide::getFaceConnMap() const {
159  return faceConnMap;
160 }
161 
162 int FaceElementForcesAndSourcesCoreOnSide::getOppositeNode() const {
163  return oppositeNode;
164 }
165 
166 int FaceElementForcesAndSourcesCoreOnSide::getEdgeSense() const {
167  return getSkeletonSense();
168 }
169 
170 int FaceElementForcesAndSourcesCoreOnSide::getSkeletonSense() const {
171  return edgeSense;
172 }
173 
174 int FaceElementForcesAndSourcesCoreOnSide::getEdgeSideNumber() const {
175  return edgeSideNumber;
176 }
177 
179 FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getFaceFE() const {
180  return static_cast<FaceElementForcesAndSourcesCoreOnSide *>(ptrFE);
181 }
182 
184 FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getEdgeFE() const {
185  return static_cast<EdgeElementForcesAndSourcesCore *>(ptrFE->sidePtrFE);
186 }
187 
188 int FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getEdgeSense()
189  const {
190  return getSkeletonSense();
191 }
192 
193 int FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getSkeletonSense()
194  const {
195  return getFaceFE()->edgeSense;
196 }
197 
198 int FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::
199  getEdgeSideNumber() const {
200  return getFaceFE()->edgeSideNumber;
201 }
202 
203 VectorDouble &
204 FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::getDirection() {
205  return getEdgeFE()->dIrection;
206 }
207 
208 auto FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::
209  getFTensor1Direction() {
210  double *ptr = &*getDirection().data().begin();
211  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2]);
212 }
213 
214 MatrixDouble &FaceElementForcesAndSourcesCoreOnSide::UserDataOperator::
215  getEdgeCoordsAtGaussPts() {
216  return getEdgeFE()->coordsAtGaussPts;
217 }
218 
219 /**
220  * @deprecated do not use needed for back compatibility
221  */
222 template <int SWITCH>
225  using FaceElementForcesAndSourcesCoreOnSide::
226  FaceElementForcesAndSourcesCoreOnSide;
227  using UserDataOperator =
229 };
230 
231 } // namespace MoFEM
232 
233 #endif //__FACEELEMENTFORCESANDSOURCESCORE_ONSIDE___HPP__
UBlasMatrix< double >
MoFEM::FaceElementForcesAndSourcesCoreOnSide::edgeSense
int edgeSense
Sense of edge, could be 1 or -1.
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:82
MoFEM::EdgeElementForcesAndSourcesCore
Edge finite element.
Definition: EdgeElementForcesAndSourcesCore.hpp:30
MoFEM::FaceElementForcesAndSourcesCoreOnSide::edgeConnMap
std::array< int, 2 > edgeConnMap
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:84
DEPRECATED
#define DEPRECATED
Definition: definitions.h:17
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator
default operator for TRI element
Definition: FaceElementForcesAndSourcesCore.hpp:94
MoFEM::FaceElementForcesAndSourcesCore
Face finite element.
Definition: FaceElementForcesAndSourcesCore.hpp:23
MoFEM::FaceElementForcesAndSourcesCoreOnSide::oppositeNode
int oppositeNode
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:86
MoFEM::FaceElementForcesAndSourcesCoreOnSide::edgeSideNumber
int edgeSideNumber
Edge side number.
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:83
MoFEM::ForcesAndSourcesCore
structure to get information form mofem into EntitiesFieldData
Definition: ForcesAndSourcesCore.hpp:22
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
UBlasVector< double >
MoFEM::FaceElementForcesAndSourcesCoreOnSide::faceConnMap
std::array< int, 4 > faceConnMap
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:85
MoFEM::FaceElementForcesAndSourcesCoreOnSide::UserDataOperator
default operator for Face element
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:92
MoFEM::FaceElementForcesAndSourcesCoreOnSideSwitch
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:223
MoFEM::FaceElementForcesAndSourcesCoreOnSide
Base face element used to integrate on skeleton.
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:19