v0.14.0
FlatPrismElementForcesAndSourcesCore.hpp
Go to the documentation of this file.
1 /** \file ForcesAndSourcesCore.hpp
2  \brief Implementation of elements on entities.
3 
4  Those element are inherited by user to implement specific implementation of
5  particular problem.
6 
7 */
8 
9 
10 
11 using namespace boost::numeric;
12 
13 #ifndef __FLATPRISMELEMENTFORCESANDSURCESCORE_HPP__
14 #define __FLATPRISMELEMENTFORCESANDSURCESCORE_HPP__
15 
16 namespace MoFEM {
17 
18 /** \brief FlatPrism finite element
19  \ingroup mofem_forces_and_sources_prism_element
20 
21  User is implementing own operator at Gauss points level, by own object
22  derived from FlatPrismElementForcesAndSourcesCoreL::UserDataOperator. Arbitrary
23  number of operator added pushing objects to rowOpPtrVector and
24  rowColOpPtrVector.
25 
26  */
28 
30 
31  /** \brief default operator for Flat Prism element
32  * \ingroup mofem_forces_and_sources_prism_element
33  */
35 
37 
38  /** \brief get face aRea
39  \param dd if dd == 0 it is for face F3 if dd == 1 is for face F4
40  */
41  inline double getArea(const int dd);
42 
43  inline double getAreaF3();
44 
45  inline double getAreaF4();
46 
47  /** \brief get triangle normal
48 
49  Normal has 6 elements, first 3 are for face F3 another three for face F4
50 
51  */
52  inline VectorDouble &getNormal();
53 
54  inline VectorAdaptor getNormalF3();
55 
56  inline VectorAdaptor getNormalF4();
57 
58  /** \brief get triangle coordinates
59 
60  Vector has 6 elements, i.e. coordinates on face F3 and F4
61 
62  */
63  inline VectorDouble &getCoords();
64 
65  /** \brief get coordinates at Gauss pts.
66 
67  Matrix has size (nb integration points)x(coordinates on F3 and F4 = 6),
68  i.e. coordinates on face F3 and F4
69 
70  */
71  inline MatrixDouble &getCoordsAtGaussPts();
72 
73  /** \brief coordinate at Gauss points on face 3 (if hierarchical
74  * approximation of element geometry)
75  */
76  inline MatrixDouble &getHOCoordsAtGaussPtsF3();
77 
78  /** \brief coordinate at Gauss points on face 4 (if hierarchical
79  * approximation of element geometry)
80  */
81  inline MatrixDouble &getHOCoordsAtGaussPtsF4();
82 
83  /** \brief if higher order geometry return normals at face F3 at Gauss pts.
84  *
85  * Face 3 is top face in canonical triangle numeration, see \cite
86  * tautges2010canonical
87  *
88  */
89  inline MatrixDouble &getNormalsAtGaussPtsF3();
90 
91  /** \brief if higher order geometry return normals at face F4 at Gauss pts.
92  *
93  * Face 4 is top face in canonical triangle numeration, see \cite
94  * tautges2010canonical
95  *
96  */
97  inline MatrixDouble &getNormalsAtGaussPtsF4();
98 
99  /** \brief if higher order geometry return normals at Gauss pts.
100  *
101  * Face 3 is top face in canonical triangle numeration, see \cite
102  * tautges2010canonical
103  *
104  * \param gg gauss point number
105  */
106  inline ublas::matrix_row<MatrixDouble> getNormalsAtGaussPtsF3(const int gg);
107 
108  /** \brief if higher order geometry return normals at Gauss pts.
109  *
110  * Face 3 is top face in canonical triangle numeration, see \cite
111  * tautges2010canonical
112  *
113  * \param gg gauss point number
114  */
115  inline ublas::matrix_row<MatrixDouble> getNormalsAtGaussPtsF4(const int gg);
116 
117  /** \brief if higher order geometry return tangent vector to triangle at
118  * Gauss pts.
119  */
120  inline MatrixDouble &getTangent1AtGaussPtF3();
121 
122  /** \brief if higher order geometry return tangent vector to triangle at
123  * Gauss pts.
124  */
125  inline MatrixDouble &getTangent2AtGaussPtF3();
126 
127  /** \brief if higher order geometry return tangent vector to triangle at
128  * Gauss pts.
129  */
130  inline MatrixDouble &getTangent1AtGaussPtF4();
131 
132  /** \brief if higher order geometry return tangent vector to triangle at
133  * Gauss pts.
134  */
135  inline MatrixDouble &getTangent2AtGaussPtF4();
136 
137  /** \brief return pointer to triangle finite element object
138  */
140  getFlatPrismElementForcesAndSourcesCore();
141 
142  protected:
143  MoFEMErrorCode setPtrFE(ForcesAndSourcesCore *ptr);
144 
145  };
146 
147  MoFEMErrorCode operator()();
148 
149 protected:
150  double aRea[2];
154 
156 
166 
167  friend class UserDataOperator;
168 };
169 
170 /// \brief USe FlatPrismElementForcesAndSourcesCore
173 
174 inline double
175 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getArea(const int dd) {
176  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)->aRea[0];
177 }
178 
179 inline double
180 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getAreaF3() {
181  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)->aRea[0];
182 }
183 inline double
184 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getAreaF4() {
185  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)->aRea[1];
186 }
187 
188 inline VectorDouble &
189 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getNormal() {
190  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)->normal;
191 }
192 
193 inline VectorAdaptor
194 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getNormalF3() {
195  double *data =
196  &(static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)->normal[0]);
197  return VectorAdaptor(3, ublas::shallow_array_adaptor<double>(3, data));
198 }
199 
200 inline VectorAdaptor
201 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getNormalF4() {
202  double *data =
203  &(static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)->normal[3]);
204  return VectorAdaptor(3, ublas::shallow_array_adaptor<double>(3, data));
205 }
206 
207 inline VectorDouble &
208 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getCoords() {
209  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)->coords;
210 }
211 
212 inline MatrixDouble &
213 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getCoordsAtGaussPts() {
214  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
215  ->coordsAtGaussPts;
216 }
217 
218 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
219  getHOCoordsAtGaussPtsF3() {
220  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
221  ->hoCoordsAtGaussPtsF3;
222 }
223 
224 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
225  getHOCoordsAtGaussPtsF4() {
226  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
227  ->hoCoordsAtGaussPtsF4;
228 }
229 
230 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
231  getNormalsAtGaussPtsF3() {
232  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
233  ->nOrmals_at_GaussPtF3;
234 }
235 
236 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
237  getNormalsAtGaussPtsF4() {
238  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
239  ->nOrmals_at_GaussPtF4;
240 }
241 
242 inline ublas::matrix_row<MatrixDouble>
243 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getNormalsAtGaussPtsF3(
244  const int gg) {
245  return ublas::matrix_row<MatrixDouble>(
247  ->nOrmals_at_GaussPtF3,
248  gg);
249 }
250 
251 inline ublas::matrix_row<MatrixDouble>
252 FlatPrismElementForcesAndSourcesCore::UserDataOperator::getNormalsAtGaussPtsF4(
253  const int gg) {
254  return ublas::matrix_row<MatrixDouble>(
256  ->nOrmals_at_GaussPtF4,
257  gg);
258 }
259 
260 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
261  getTangent1AtGaussPtF3() {
262  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
263  ->tAngent1_at_GaussPtF3;
264 }
265 
266 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
267  getTangent2AtGaussPtF3() {
268  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
269  ->tAngent2_at_GaussPtF3;
270 }
271 
272 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
273  getTangent1AtGaussPtF4() {
274  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
275  ->tAngent1_at_GaussPtF4;
276 }
277 
278 inline MatrixDouble &FlatPrismElementForcesAndSourcesCore::UserDataOperator::
279  getTangent2AtGaussPtF4() {
280  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE)
281  ->tAngent2_at_GaussPtF4;
282 }
283 
285 FlatPrismElementForcesAndSourcesCore::UserDataOperator::
286  getFlatPrismElementForcesAndSourcesCore() {
287  return static_cast<FlatPrismElementForcesAndSourcesCore *>(ptrFE);
288 }
289 
290 } // namespace MoFEM
291 
292 #endif //__FLATPRISMELEMENTFORCESANDSURCESCORE_HPP__
293 
294 /**
295  * \defgroup mofem_forces_and_sources_prism_element Prism Element
296  * \ingroup mofem_forces_and_sources
297  **/
UBlasMatrix< double >
DEPRECATED
#define DEPRECATED
Definition: definitions.h:17
MoFEM::FlatPrismElementForcesAndSourcesCore::coordsAtGaussPts
MatrixDouble coordsAtGaussPts
Definition: FlatPrismElementForcesAndSourcesCore.hpp:153
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::FlatPrismElementForcesAndSourcesCore::tAngent1_at_GaussPtF4
MatrixDouble tAngent1_at_GaussPtF4
Definition: FlatPrismElementForcesAndSourcesCore.hpp:163
MoFEM::FlatPrismElementForcesAndSourcesCore::opHOCoordsAndNormals
OpGetCoordsAndNormalsOnPrism opHOCoordsAndNormals
Definition: FlatPrismElementForcesAndSourcesCore.hpp:165
MoFEM::FlatPrismElementForcesAndSourcesCore::tAngent1_at_GaussPtF3
MatrixDouble tAngent1_at_GaussPtF3
Definition: FlatPrismElementForcesAndSourcesCore.hpp:159
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::FlatPrismElementForcesAndSourcesCore::tAngent2_at_GaussPtF4
MatrixDouble tAngent2_at_GaussPtF4
Definition: FlatPrismElementForcesAndSourcesCore.hpp:164
MoFEM::FlatPrismElementForcesAndSourcesCore::coords
VectorDouble coords
Definition: FlatPrismElementForcesAndSourcesCore.hpp:152
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::ForcesAndSourcesCore::UserDataOperator
Definition: ForcesAndSourcesCore.hpp:549
MoFEM::FlatPrismElementForcesAndSourcesCore::nOrmals_at_GaussPtF3
MatrixDouble nOrmals_at_GaussPtF3
Definition: FlatPrismElementForcesAndSourcesCore.hpp:158
MoFEM::FlatPrismElementForcesAndSourcesCore::UserDataOperator
default operator for Flat Prism element
Definition: FlatPrismElementForcesAndSourcesCore.hpp:34
MoFEM::FlatPrismElementForcesAndSourcesCore::hoCoordsAtGaussPtsF3
MatrixDouble hoCoordsAtGaussPtsF3
Definition: FlatPrismElementForcesAndSourcesCore.hpp:157
MoFEM::OpGetCoordsAndNormalsOnPrism
calculate normals at Gauss points of triangle element
Definition: DataOperators.hpp:378
MoFEM::Types::VectorAdaptor
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:115
MoFEM::FlatPrismElementForcesAndSourcesCore::tAngent2_at_GaussPtF3
MatrixDouble tAngent2_at_GaussPtF3
Definition: FlatPrismElementForcesAndSourcesCore.hpp:160
MoFEM::FlatPrismElementForcesAndSurcesCore
DEPRECATED typedef FlatPrismElementForcesAndSourcesCore FlatPrismElementForcesAndSurcesCore
USe FlatPrismElementForcesAndSourcesCore.
Definition: FlatPrismElementForcesAndSourcesCore.hpp:172
MoFEM::ForcesAndSourcesCore
structure to get information form mofem into EntitiesFieldData
Definition: ForcesAndSourcesCore.hpp:22
MoFEM::FlatPrismElementForcesAndSourcesCore::nOrmals_at_GaussPtF4
MatrixDouble nOrmals_at_GaussPtF4
Definition: FlatPrismElementForcesAndSourcesCore.hpp:162
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
MoFEM::FlatPrismElementForcesAndSourcesCore
FlatPrism finite element.
Definition: FlatPrismElementForcesAndSourcesCore.hpp:27
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
UBlasVector< double >
MoFEM::FlatPrismElementForcesAndSourcesCore::hoCoordsAtGaussPtsF4
MatrixDouble hoCoordsAtGaussPtsF4
Definition: FlatPrismElementForcesAndSourcesCore.hpp:161
MoFEM::FlatPrismElementForcesAndSourcesCore::meshPositionsFieldName
std::string meshPositionsFieldName
Definition: FlatPrismElementForcesAndSourcesCore.hpp:155
MoFEM::ForcesAndSourcesCore::UserDataOperator::ptrFE
ForcesAndSourcesCore * ptrFE
Definition: ForcesAndSourcesCore.hpp:985
MoFEM::FlatPrismElementForcesAndSourcesCore::normal
VectorDouble normal
Definition: FlatPrismElementForcesAndSourcesCore.hpp:151