v0.16.3
Loading...
Searching...
No Matches
Tools.hpp
Go to the documentation of this file.
1/** \file Tools.hpp
2 * \brief Tools interface
3 *
4 * Implementation of some useful and very often used methods * in MoFEM.
5 *
6 * \ingroup mofem_tools
7 */
8
9#ifndef __TOOLS_HPP__
10#define __TOOLS_HPP__
11
12namespace MoFEM {
13
14/**
15 * \brief Auxiliary tools
16 * \nosubgrouping
17 * \ingroup mofem_tools
18 */
19struct Tools : public UnknownInterface {
20
21 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
22 UnknownInterface **iface) const;
23
25 Tools(const MoFEM::Core &core) : cOre(const_cast<MoFEM::Core &>(core)) {}
26
27 /** \name Computational */
28
29 /**
30 * \brief Calculate tetrahedron volume length quality
31 * @param coords tet coordinates
32 * @return Volume-length quality
33 */
34 static double volumeLengthQuality(const double *coords);
35
36 /**
37 * @brief Calculate volume of tetrahedron
38 *
39 * @param coords
40 * @return double volume
41 */
42 static double tetVolume(const double *coords);
43
44 /**
45 * \brief calculate minimal quality of tetrahedra in range
46 * @param tets range
47 * @param min_quality minimal quality
48 * @return error code
49 */
51 const Range &tets, double &min_quality, Tag th = nullptr,
52 boost::function<double(double, double)> f =
53 [](double a, double b) -> double { return std::min(a, b); });
54
55 static constexpr double shapeFunMBEDGE0At00 = N_MBEDGE0(0);
56 static constexpr double shapeFunMBEDGE1At00 = N_MBEDGE1(0);
57
58 /**
59 * @brief Array of shape function at zero local point on reference element
60 *
61 */
62 static constexpr std::array<double, 2> shapeFunMBEDGEAt00 = {
64
65 static constexpr double diffN_MBEDGE0x = diffN_MBEDGE0;
66 static constexpr double diffN_MBEDGE1x = diffN_MBEDGE1;
67
68 static constexpr std::array<double, 2> diffShapeFunMBEDGE = {diffN_MBEDGE0x,
70
71 static inline double shapeFunMBEDGE0(const double x);
72
73 static inline double shapeFunMBEDGE1(const double x);
74
75 /**
76 * @brief Calculate shape functions on edge
77 *
78 * \note Template parameter is leading dimension of point coordinate arrays,
79 * such that \f$ksi_{n+1} = ksi[n + LDB]\f$
80 *
81 * @tparam 1
82 * @param shape shape functions
83 * @param ksi pointer to first local coordinates
84 * @param nb number of points
85 * @return MoFEMErrorCode
86 */
87 template <int LDB = 1>
88 static MoFEMErrorCode shapeFunMBEDGE(double *shape, const double *ksi,
89 const int nb);
90
91 static constexpr double diffShapeFunMBTRI0x =
92 diffN_MBTRI0x; ///< derivative of triangle shape function
93 static constexpr double diffShapeFunMBTRI0y =
94 diffN_MBTRI0y; ///< derivative of triangle shape function
95 static constexpr double diffShapeFunMBTRI1x =
96 diffN_MBTRI1x; ///< derivative of triangle shape function
97 static constexpr double diffShapeFunMBTRI1y =
98 diffN_MBTRI1y; ///< derivative of triangle shape function
99 static constexpr double diffShapeFunMBTRI2x =
100 diffN_MBTRI2x; ///< derivative of triangle shape function
101 static constexpr double diffShapeFunMBTRI2y =
102 diffN_MBTRI2y; ///< derivative of triangle shape function
103
111
112 static constexpr double shapeFunMBTRI0At00 = N_MBTRI0(0, 0);
113 static constexpr double shapeFunMBTRI1At00 = N_MBTRI1(0, 0);
114 static constexpr double shapeFunMBTRI2At00 = N_MBTRI2(0, 0);
115
116 /**
117 * @brief Array of shape function at zero local point on reference element
118 *
119 */
120 static constexpr std::array<double, 3> shapeFunMBTRIAt00 = {
122
123 static inline double shapeFunMBTRI0(const double x, const double y);
124
125 static inline double shapeFunMBTRI1(const double x, const double y);
126
127 static inline double shapeFunMBTRI2(const double x, const double y);
128
129 /**
130 * @brief Calculate shape functions on triangle
131 *
132 * \note Template parameter is leading dimension of point coordinate arrays,
133 * such that \f$ksi_{n+1} = ksi[n + LDB]\f$
134 *
135 * @tparam 1
136 * @param shape shape functions
137 * @param ksi pointer to first local coordinates
138 * @param eta pointer to second local coordinates
139 * @param nb number of points
140 * @return MoFEMErrorCode
141 */
142 template <int LDB = 1>
143 static MoFEMErrorCode shapeFunMBTRI(double *shape, const double *ksi,
144 const double *eta, const int nb);
145
146 static constexpr double diffShapeFunMBQUADAtCenter0x =
147 diffN_MBQUAD0x(0.5); ///< derivative of quad shape function
148 static constexpr double diffShapeFunMBQUADAtCenter0y =
149 diffN_MBQUAD0y(0.5); ///< derivative of quad shape function
150 static constexpr double diffShapeFunMBQUADAtCenter1x =
151 diffN_MBQUAD1x(0.5); ///< derivative of quad shape function
152 static constexpr double diffShapeFunMBQUADAtCenter1y =
153 diffN_MBQUAD1y(0.5); ///< derivative of quad shape function
154 static constexpr double diffShapeFunMBQUADAtCenter2x =
155 diffN_MBQUAD2x(0.5); ///< derivative of quad shape function
156 static constexpr double diffShapeFunMBQUADAtCenter2y =
157 diffN_MBQUAD2y(0.5); ///< derivative of quad shape function
158 static constexpr double diffShapeFunMBQUADAtCenter3x =
159 diffN_MBQUAD3x(0.5); ///< derivative of quad shape function
160 static constexpr double diffShapeFunMBQUADAtCenter3y =
161 diffN_MBQUAD3y(0.5); ///< derivative of quad shape function
162
163 static constexpr double diffShapeFunMBHEXAtCenter0x =
164 diffN_MBHEX0x(0.5, 0.5); ///< derivative of HEX shape function
165 static constexpr double diffShapeFunMBHEXAtCenter0y =
166 diffN_MBHEX0y(0.5, 0.5); ///< derivative of HEX shape function
167 static constexpr double diffShapeFunMBHEXAtCenter0z =
168 diffN_MBHEX0z(0.5, 0.5); ///< derivative of HEX shape function
169 static constexpr double diffShapeFunMBHEXAtCenter1x =
170 diffN_MBHEX1x(0.5, 0.5); ///< derivative of HEX shape function
171 static constexpr double diffShapeFunMBHEXAtCenter1y =
172 diffN_MBHEX1y(0.5, 0.5); ///< derivative of HEX shape function
173 static constexpr double diffShapeFunMBHEXAtCenter1z =
174 diffN_MBHEX1z(0.5, 0.5); ///< derivative of HEX shape function
175 static constexpr double diffShapeFunMBHEXAtCenter2x =
176 diffN_MBHEX2x(0.5, 0.5); ///< derivative of HEX shape function
177 static constexpr double diffShapeFunMBHEXAtCenter2y =
178 diffN_MBHEX2y(0.5, 0.5); ///< derivative of HEX shape function
179 static constexpr double diffShapeFunMBHEXAtCenter2z =
180 diffN_MBHEX2z(0.5, 0.5); ///< derivative of HEX shape function
181 static constexpr double diffShapeFunMBHEXAtCenter3x =
182 diffN_MBHEX3x(0.5, 0.5); ///< derivative of HEX shape function
183 static constexpr double diffShapeFunMBHEXAtCenter3y =
184 diffN_MBHEX3y(0.5, 0.5); ///< derivative of quad shape function
185 static constexpr double diffShapeFunMBHEXAtCenter3z =
186 diffN_MBHEX3z(0.5, 0.5); ///< derivative of quad shape function
187 static constexpr double diffShapeFunMBHEXAtCenter4x =
188 diffN_MBHEX4x(0.5, 0.5); ///< derivative of HEX shape function
189 static constexpr double diffShapeFunMBHEXAtCenter4y =
190 diffN_MBHEX4y(0.5, 0.5); ///< derivative of quad shape function
191 static constexpr double diffShapeFunMBHEXAtCenter4z =
192 diffN_MBHEX4z(0.5, 0.5); ///< derivative of quad shape function
193 static constexpr double diffShapeFunMBHEXAtCenter5x =
194 diffN_MBHEX5x(0.5, 0.5); ///< derivative of HEX shape function
195 static constexpr double diffShapeFunMBHEXAtCenter5y =
196 diffN_MBHEX5y(0.5, 0.5); ///< derivative of quad shape function
197 static constexpr double diffShapeFunMBHEXAtCenter5z =
198 diffN_MBHEX5z(0.5, 0.5); ///< derivative of quad shape function
199 static constexpr double diffShapeFunMBHEXAtCenter6x =
200 diffN_MBHEX6x(0.5, 0.5); ///< derivative of HEX shape function
201 static constexpr double diffShapeFunMBHEXAtCenter6y =
202 diffN_MBHEX6y(0.5, 0.5); ///< derivative of quad shape function
203 static constexpr double diffShapeFunMBHEXAtCenter6z =
204 diffN_MBHEX6z(0.5, 0.5); ///< derivative of quad shape function
205 static constexpr double diffShapeFunMBHEXAtCenter7x =
206 diffN_MBHEX7x(0.5, 0.5); ///< derivative of HEX shape function
207 static constexpr double diffShapeFunMBHEXAtCenter7y =
208 diffN_MBHEX7y(0.5, 0.5); ///< derivative of quad shape function
209 static constexpr double diffShapeFunMBHEXAtCenter7z =
210 diffN_MBHEX7z(0.5, 0.5); ///< derivative of quad shape function
211
217
245
246 /**
247 * @brief Calculate shape functions on quadrilateral
248 *
249 * Bilinear vertex functions on the reference square \f$[0,1]^2\f$, in the
250 * MOAB corner order.
251 *
252 * \note Template parameter is leading dimension of point coordinate arrays,
253 * such that \f$ksi_{n+1} = ksi[n + LDB]\f$
254 *
255 * @tparam 1
256 * @param shape shape functions, four values per point
257 * @param ksi pointer to first local coordinates
258 * @param eta pointer to second local coordinates
259 * @param nb number of points
260 * @return MoFEMErrorCode
261 */
262 template <int LDB = 1>
263 static MoFEMErrorCode shapeFunMBQUAD(double *shape, const double *ksi,
264 const double *eta, const int nb);
265
266 /**
267 * @brief Calculate shape functions on hexahedron
268 *
269 * Trilinear vertex functions on the reference cube \f$[0,1]^3\f$, in the
270 * MOAB corner order.
271 *
272 * \note Template parameter is leading dimension of point coordinate arrays,
273 * such that \f$ksi_{n+1} = ksi[n + LDB]\f$
274 *
275 * @tparam 1
276 * @param shape shape functions, eight values per point
277 * @param ksi pointer to first local coordinates
278 * @param eta pointer to second local coordinates
279 * @param zeta pointer to third local coordinates
280 * @param nb number of points
281 * @return MoFEMErrorCode
282 */
283 template <int LDB = 1>
284 static MoFEMErrorCode shapeFunMBHEX(double *shape, const double *ksi,
285 const double *eta, const double *zeta,
286 const int nb);
287
288 static constexpr double diffShapeFunMBTET0x =
289 diffN_MBTET0x; ///< derivative of tetrahedral shape function
290 static constexpr double diffShapeFunMBTET0y =
291 diffN_MBTET0y; ///< derivative of tetrahedral shape function
292 static constexpr double diffShapeFunMBTET0z =
293 diffN_MBTET0z; ///< derivative of tetrahedral shape function
294 static constexpr double diffShapeFunMBTET1x =
295 diffN_MBTET1x; ///< derivative of tetrahedral shape function
296 static constexpr double diffShapeFunMBTET1y =
297 diffN_MBTET1y; ///< derivative of tetrahedral shape function
298 static constexpr double diffShapeFunMBTET1z =
299 diffN_MBTET1z; ///< derivative of tetrahedral shape function
300 static constexpr double diffShapeFunMBTET2x =
301 diffN_MBTET2x; ///< derivative of tetrahedral shape function
302 static constexpr double diffShapeFunMBTET2y =
303 diffN_MBTET2y; ///< derivative of tetrahedral shape function
304 static constexpr double diffShapeFunMBTET2z =
305 diffN_MBTET2z; ///< derivative of tetrahedral shape function
306 static constexpr double diffShapeFunMBTET3x =
307 diffN_MBTET3x; ///< derivative of tetrahedral shape function
308 static constexpr double diffShapeFunMBTET3y =
309 diffN_MBTET3y; ///< derivative of tetrahedral shape function
310 static constexpr double diffShapeFunMBTET3z =
311 diffN_MBTET3z; ///< derivative of tetrahedral shape function
312
322
323 static inline double shapeFunMBTET0(const double x, const double y,
324 const double z);
325
326 static inline double shapeFunMBTET1(const double x, const double y,
327 const double z);
328
329 static inline double shapeFunMBTET2(const double x, const double y,
330 const double z);
331
332 static inline double shapeFunMBTET3(const double x, const double y,
333 const double z);
334
335 static constexpr double shapeFunMBTET0At000 = N_MBTET0(0, 0, 0);
336 static constexpr double shapeFunMBTET1At000 = N_MBTET1(0, 0, 0);
337 static constexpr double shapeFunMBTET2At000 = N_MBTET2(0, 0, 0);
338 static constexpr double shapeFunMBTET3At000 = N_MBTET3(0, 0, 0);
339
340 static constexpr double shapeFunMBTET0AtOneThird =
341 N_MBTET0(1. / 3., 1. / 3., 1. / 3.);
342 static constexpr double shapeFunMBTET1AtOneThird =
343 N_MBTET1(1. / 3., 1. / 3., 1. / 3.);
344 static constexpr double shapeFunMBTET2AtOneThird =
345 N_MBTET2(1. / 3., 1. / 3., 1. / 3.);
346 static constexpr double shapeFunMBTET3AtOneThird =
347 N_MBTET3(1. / 3., 1. / 3., 1. / 3.);
348
349 /**
350 * @brief Calculate shape functions on tetrahedron
351 *
352 * \note Template parameter is leading dimension of point coordinate arrays,
353 * such that \f$ksi_{n+1} = ksi[n + LDB]\f$
354 *
355 * @tparam 1
356 * @param shape shape functions
357 * @param ksi pointer to first local coordinates
358 * @param eta pointer to second local coordinates
359 * @param zeta pointer to first third coordinates
360 * @param nb number of points
361 * @return MoFEMErrorCode
362 */
363 template <int LDB = 1>
364 static MoFEMErrorCode shapeFunMBTET(double *shape, const double *ksi,
365 const double *eta, const double *zeta,
366 const double nb);
367
368 /**
369 * @brief Array of shape function at zero local point on reference element
370 *
371 */
375
376 /**
377 * @brief Array of shape function at center on reference element
378 *
379 */
383
384 /**
385 * @brief Get the local coordinates on reference four node tet object
386 *
387 * \code
388 * MatrixDouble elem_coords(4, 3);
389 * // Set nodal coordinates
390 * MatrixDouble global_coords(5, 3);
391 * // Set global coordinates
392 * MatrixDouble local_coords(global_coords.size1(), 3);
393 * CHKERR Tools::getLocalCoordinatesOnReferenceFourNodeTet(
394 * &elem_coords(0, 0), &global_coords(0, 0), global_coords.size1(),
395 * &local_coords(0, 0))
396 * \endcode
397 *
398 * @param elem_coords Global element node coordinates
399 * @param glob_coords Global coordinates
400 * @param nb_nodes Number of points
401 * @param local_coords Result
402 * @return MoFEMErrorCode
403 */
405 const double *elem_coords, const double *glob_coords, const int nb_nodes,
406 double *local_coords);
407
408 /**
409 * @brief Get the local coordinates on reference three node tri object
410 *
411 * \code
412 * MatrixDouble elem_coords(4, 3);
413 * // Set nodal coordinates
414 * MatrixDouble global_coords(5, 3);
415 * // Set global coordinates
416 * MatrixDouble local_coords(global_coords.size1(), 3);
417 * CHKERR Tools::getLocalCoordinatesOnReferenceFourNodeTet(
418 * &elem_coords(0, 0), &global_coords(0, 0), global_coords.size1(),
419 * &local_coords(0, 0))
420 * \endcode
421 *
422 * @param elem_coords Global element node coordinates
423 * @param glob_coords Global coordinates
424 * @param nb_nodes Number of points
425 * @param local_coords Result
426 * @param d_elem_coords Derivative of local coordinates
427 * @param d_global_coords
428 * @return MoFEMErrorCode
429 */
431 const double *elem_coords, const double *glob_coords, const int nb_nodes,
432 double *local_coords);
433
434 /** @copydoc getLocalCoordinatesOnReferenceThreeNodeTri */
436 const double *elem_coords, const std::complex<double> *glob_coords,
437 const int nb_nodes, std::complex<double> *local_coords);
438
439/** @deprecated use getLocalCoordinatesOnReferenceThreeNodeTri */
441 const double *elem_coords, const double *glob_coords, const int nb_nodes,
442 double *local_coords) {
443 return getLocalCoordinatesOnReferenceThreeNodeTri(elem_coords, glob_coords,
444 nb_nodes, local_coords);
445 }
446
447 /**
448 * @brief Get the local coordinates on reference four node tet object
449 *
450 * \code
451 * MatrixDouble elem_coords(4, 3);
452 * // Set nodal coordinates
453 * MatrixDouble global_coords(5, 3);
454 * // Set global coordinates
455 * MatrixDouble local_coords(global_coords.size1(), 3);
456 * CHKERR Tools::getLocalCoordinatesOnReferenceEdgeNodeEdge(
457 * &elem_coords(0, 0), &global_coords(0, 0), global_coords.size1(),
458 * &local_coords(0, 0))
459 * \endcode
460 *
461 * @param elem_coords Global element node coordinates
462 * @param glob_coords Global coordinates
463 * @param nb_nodes Number of points
464 * @param local_coords Result
465 * @return MoFEMErrorCode
466 */
468 const double *elem_coords, const double *glob_coords, const int nb_nodes,
469 double *local_coords);
470
471 /**
472 * @brief Get the Tets With Quality
473 *
474 * @param out_tets
475 * @param tets
476 * @param th
477 * @param f
478 * @return MoFEMErrorCode
479 */
481 Range &out_tets, const Range &tets, Tag th = nullptr,
482 boost::function<bool(double)> f = [](double q) -> bool {
483 if (q <= 0)
484 return true;
485 else
486 return false;
487 });
488 /**
489 * @brief Write file with tetrahedral of given quality
490 *
491 * @param file_name
492 * @param file_type
493 * @param options
494 * @param tets
495 * @param th
496 * @param f
497 * @return MoFEMErrorCode
498 */
500 const char *file_name, const char *file_type, const char *options,
501 const Range &tets, Tag th = nullptr,
502 boost::function<bool(double)> f = [](double q) -> bool {
503 if (q <= 0)
504 return true;
505 else
506 return false;
507 });
508
509 /**
510 * @brief Check of point is in tetrahedral
511 *
512 * @param tet_coords
513 * @param global_coord
514 * @param tol
515 * @param result
516 * @return MoFEMErrorCode
517 */
518 static MoFEMErrorCode checkIfPointIsInTet(const double tet_coords[],
519 const double global_coord[],
520 const double tol, bool &result);
521
522 /**
523 * @brief Get the Tri Normal objectGet triangle normal
524 *
525 * @param coords
526 * @param normal
527 * @param d_normal derivative, if pointer is null, derivative is not
528 * calculated
529 *
530 * In d_normal, format is 3rd rank tensor, first index is normal direction,
531 * second is node number, third is coordinate.
532 *
533 * This is relation between tensor and pointer
534 * \code {.cpp}
535 * auto t_d_normal = getFTensor3FromPtr<3, 3, 3>(d_normal);
536 * \endcode
537 *
538 * @return MoFEMErrorCode
539 */
540 static MoFEMErrorCode getTriNormal(const double *coords, double *normal,
541 double *d_normal = nullptr);
542
543 /**
544 * @brief Get triangle normal
545 *
546 * @param tri
547 * @param normal
548 * @return MoFEMErrorCode
549 */
550 MoFEMErrorCode getTriNormal(const EntityHandle tri, double *normal) const;
551
552 /**
553 * @brief Get triangle area
554 *
555 * @param tri
556 * @return double
557 */
558 double getTriArea(const EntityHandle tri) const;
559
560
561 /**
562 * @brief Calculate triangle circumcenter in 3d
563 *
564 * @note NEEDS TESTING
565 *
566 * @param tri
567 * @return std::tuple<std::array<double, 3>, std::array<double, 2>, double>
568 */
569 static std::tuple<std::array<double, 3>, std::array<double, 2>, double>
570 getTricircumcenter3d(double *coords_ptr);
571
572 /**
573 * @brief Get edge length
574 *
575 * @param edge_coords
576 * @return double
577 */
578 static double getEdgeLength(const double *edge_coords);
579
580 /**
581 * @brief Get edge length
582 *
583 * @param edge
584 * @return double
585 */
586 double getEdgeLength(const EntityHandle edge);
587
595
596 /**
597 * @brief Find closet point on the segment from the point
598 *
599 * @param w_ptr segment first vertex coordinate
600 * @param v_ptr segment second vertex coordinate
601 * @param p_ptr coordinate of point
602 * @param t_ptr distance on the segment
603 *
604 * \note If t is outside bounds [ 0,-1 ] point is on the line point
605 * beyond segment.
606 *
607 * \code
608 *
609 * double w[] = {-1, 0, 0};
610 * double v[] = {1, 0, 0};
611 * double p[] = {0, 1, 0};
612 * double t;
613 * CHKERR Toolas::minDistancePointFromOnSegment(w, v, p, &t);
614 * double point_on_segment[3];
615 * for (int i = 0; i != 3; ++i)
616 * point_on_segment[i] = w[i] + t * (v[i] - w[i]);
617 *
618 * \endcode
619 *
620 * @return SEGMENT_MIN_DISTANCE
621 */
623 minDistancePointFromOnSegment(const double *w_ptr, const double *v_ptr,
624 const double *p_ptr,
625 double *const t_ptr = nullptr);
626 /**
627 * @brief Find points on two segments in closest distance
628 *
629 * @param w_ptr
630 * @param v_ptr
631 * @param k_ptr
632 * @param l_ptr
633 * @param tvw_ptr
634 * @param tlk_ptr
635 * @return SEGMENT_MIN_DISTANCE
636 *
637 * \note If tvwk or tlk are outside bound [0,-1], it means that points
638 * are on the lines beyond segments, respectively for segment vw and
639 * lk.
640 *
641 */
643 minDistanceFromSegments(const double *w_ptr, const double *v_ptr,
644 const double *k_ptr, const double *l_ptr,
645 double *const tvw_ptr = nullptr,
646 double *const tlk_ptr = nullptr);
647
648 /**
649 * @brief Find minimal distance to edges
650 *
651 * \note Finding only edges with have smaller distance than distance
652 * set on the input by min_dist_ptr
653 *
654 * @param v_ptr point coordinates
655 * @param nb nb points
656 * @param edges range of edges
657 * @param min_dist_ptr on return minimal distance, on input starting
658 * distance
659 * @param o_ptr coordinates of the point on edge
660 * @param o_segments closest segments
661 * @return MoFEMErrorCode
662 */
664 findMinDistanceFromTheEdges(const double *v_ptr, const int nb, Range edges,
665 double *min_dist_ptr, double *o_ptr = nullptr,
666 EntityHandle *o_segments = nullptr) const;
667
668 /** \name Debugging */
669
670 /**@{*/
671
672 /** \brief Print all DOFs for which element of vector is not a number
673 *
674 */
676 const RowColData row_or_col, Vec v);
677
678 /**@}*/
679
680 static MoFEMErrorCode
682 const int edge1);
683
684 static MoFEMErrorCode
686 const int edge1, const int edge2);
687
688 /** \name Mesh refinement */
689
690 /**@{*/
691
692 static constexpr std::array<int, 12> uniformTriangleRefineTriangles = {
693
694 0, 3, 5, // 0
695 3, 1, 4, // 1
696 5, 4, 2, // 2
697 5, 3, 4 // 3
698
699 };
700
702 std::tuple<std::vector<double>, std::vector<int>, std::vector<int>>;
703
704 /**
705 * @brief create uniform triangle mesh of refined elements
706 *
707 * @param nb_levels
708 * @return RefineTrianglesReturn
709 */
711
712 /**
713 * @brief generate integration points for refined triangle mesh for last level
714 *
715 * @param pts
716 * @param refined
717 * @return MatrixDouble
718 */
719 static MatrixDouble
721
722 /**
723 * @brief generate integration points for refined triangle mesh for last level
724 *
725 * @param rule Gauss integration rule
726 * @param refined
727 * @return MatrixDouble
728 */
729 static MatrixDouble
731
732 /**@}*/
733
734};
735
736double Tools::shapeFunMBEDGE0(const double x) {
737 return N_MBEDGE0(x);
738}
739
740double Tools::shapeFunMBEDGE1(const double x) {
741 return N_MBEDGE1(x);
742}
743
744template <int LDB>
745MoFEMErrorCode Tools::shapeFunMBEDGE(double *shape, const double *ksi,
746 const int nb) {
748 for (int n = 0; n != nb; ++n) {
749 shape[0] = shapeFunMBEDGE0(*ksi);
750 shape[1] = shapeFunMBEDGE1(*ksi);
751 shape += 2;
752 ksi += LDB;
753 }
755}
756
757double Tools::shapeFunMBTRI0(const double x, const double y) {
758 return N_MBTRI0(x, y);
759}
760
761double Tools::shapeFunMBTRI1(const double x, const double y) {
762 (void)y;
763 return N_MBTRI1(x, y);
764}
765
766double Tools::shapeFunMBTRI2(const double x, const double y) {
767 (void)x;
768 return N_MBTRI2(x, y);
769}
770
771template <int LDB>
772MoFEMErrorCode Tools::shapeFunMBTRI(double *shape, const double *ksi,
773 const double *eta, const int nb) {
775 for (int n = 0; n != nb; ++n) {
776 shape[0] = shapeFunMBTRI0(*ksi, *eta);
777 shape[1] = shapeFunMBTRI1(*ksi, *eta);
778 shape[2] = shapeFunMBTRI2(*ksi, *eta);
779 shape += 3;
780 ksi += LDB;
781 eta += LDB;
782 }
784}
785
786double Tools::shapeFunMBTET0(const double x, const double y, const double z) {
787 return N_MBTET0(x, y, z);
788}
789
790double Tools::shapeFunMBTET1(const double x, const double y, const double z) {
791 (void)y;
792 (void)z;
793 return N_MBTET1(x, y, z);
794}
795
796double Tools::shapeFunMBTET2(const double x, const double y, const double z) {
797 (void)x;
798 (void)z;
799 return N_MBTET2(x, y, z);
800}
801
802double Tools::shapeFunMBTET3(const double x, const double y, const double z) {
803 (void)x;
804 (void)y;
805 return N_MBTET3(x, y, z);
806};
807
808template <int LDB>
809MoFEMErrorCode Tools::shapeFunMBTET(double *shape, const double *ksi,
810 const double *eta, const double *zeta,
811 const double nb) {
813 for (int n = 0; n != nb; ++n) {
814 shape[0] = shapeFunMBTET0(*ksi, *eta, *zeta);
815 shape[1] = shapeFunMBTET1(*ksi, *eta, *zeta);
816 shape[2] = shapeFunMBTET2(*ksi, *eta, *zeta);
817 shape[3] = shapeFunMBTET3(*ksi, *eta, *zeta);
818 shape += 4;
819 ksi += LDB;
820 eta += LDB;
821 zeta += LDB;
822 }
824}
825
826template <int LDB>
827MoFEMErrorCode Tools::shapeFunMBQUAD(double *shape, const double *ksi,
828 const double *eta, const int nb) {
830 for (int n = 0; n != nb; ++n) {
831 shape[0] = N_MBQUAD0(*ksi, *eta);
832 shape[1] = N_MBQUAD1(*ksi, *eta);
833 shape[2] = N_MBQUAD2(*ksi, *eta);
834 shape[3] = N_MBQUAD3(*ksi, *eta);
835 shape += 4;
836 ksi += LDB;
837 eta += LDB;
838 }
840}
841
842template <int LDB>
843MoFEMErrorCode Tools::shapeFunMBHEX(double *shape, const double *ksi,
844 const double *eta, const double *zeta,
845 const int nb) {
847 for (int n = 0; n != nb; ++n) {
848 shape[0] = N_MBHEX0(*ksi, *eta, *zeta);
849 shape[1] = N_MBHEX1(*ksi, *eta, *zeta);
850 shape[2] = N_MBHEX2(*ksi, *eta, *zeta);
851 shape[3] = N_MBHEX3(*ksi, *eta, *zeta);
852 shape[4] = N_MBHEX4(*ksi, *eta, *zeta);
853 shape[5] = N_MBHEX5(*ksi, *eta, *zeta);
854 shape[6] = N_MBHEX6(*ksi, *eta, *zeta);
855 shape[7] = N_MBHEX7(*ksi, *eta, *zeta);
856 shape += 8;
857 ksi += LDB;
858 eta += LDB;
859 zeta += LDB;
860 }
862}
863
864
865} // namespace MoFEM
866
867#endif // __TOOLS_HPP__a
868
869/**
870 * \defgroup mofem_tools Tools interface
871 * \brief Interface for tools
872 *
873 * \ingroup mofem
874 */
TetMeshData result
int nb
number of DOFs
Definition Schur.cpp:2505
constexpr double a
RowColData
RowColData.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define DEPRECATED
Definition definitions.h:17
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define diffN_MBTET0z
derivative of tetrahedral shape function
Definition fem_tools.h:34
#define N_MBTET0(x, y, z)
tetrahedral shape function
Definition fem_tools.h:28
#define diffN_MBTRI2x
derivative of triangle shape function
Definition fem_tools.h:53
#define diffN_MBHEX3z(x, y)
Definition fem_tools.h:98
#define diffN_MBHEX7z(x, y)
Definition fem_tools.h:102
#define N_MBTET1(x, y, z)
tetrahedral shape function
Definition fem_tools.h:29
#define diffN_MBQUAD2y(x)
Definition fem_tools.h:66
#define diffN_MBTRI0y
derivative of triangle shape function
Definition fem_tools.h:50
#define diffN_MBTRI1y
derivative of triangle shape function
Definition fem_tools.h:52
#define diffN_MBQUAD1x(y)
Definition fem_tools.h:63
#define diffN_MBHEX7y(x, z)
Definition fem_tools.h:94
#define N_MBTRI1(x, y)
triangle shape function
Definition fem_tools.h:47
#define diffN_MBHEX6x(y, z)
Definition fem_tools.h:85
#define N_MBQUAD3(x, y)
quad shape function
Definition fem_tools.h:60
#define diffN_MBEDGE0
derivative of edge shape function
Definition fem_tools.h:107
#define N_MBHEX7(x, y, z)
Definition fem_tools.h:78
#define diffN_MBQUAD0x(y)
Definition fem_tools.h:61
#define N_MBHEX3(x, y, z)
Definition fem_tools.h:74
#define N_MBHEX5(x, y, z)
Definition fem_tools.h:76
#define diffN_MBTET2z
derivative of tetrahedral shape function
Definition fem_tools.h:40
#define diffN_MBEDGE1
derivative of edge shape function
Definition fem_tools.h:108
#define diffN_MBQUAD1y(x)
Definition fem_tools.h:64
#define diffN_MBQUAD3y(x)
Definition fem_tools.h:68
#define diffN_MBHEX1y(x, z)
Definition fem_tools.h:88
#define diffN_MBHEX3y(x, z)
Definition fem_tools.h:90
#define N_MBEDGE0(x)
edge shape function
Definition fem_tools.h:105
#define diffN_MBTET3y
derivative of tetrahedral shape function
Definition fem_tools.h:42
#define diffN_MBTET0y
derivative of tetrahedral shape function
Definition fem_tools.h:33
#define diffN_MBHEX4y(x, z)
Definition fem_tools.h:91
#define diffN_MBHEX5x(y, z)
Definition fem_tools.h:84
#define diffN_MBTET1z
derivative of tetrahedral shape function
Definition fem_tools.h:37
#define diffN_MBHEX1z(x, y)
Definition fem_tools.h:96
#define diffN_MBTET3z
derivative of tetrahedral shape function
Definition fem_tools.h:43
#define diffN_MBHEX4z(x, y)
Definition fem_tools.h:99
#define diffN_MBHEX6y(x, z)
Definition fem_tools.h:93
#define diffN_MBHEX6z(x, y)
Definition fem_tools.h:101
#define N_MBHEX4(x, y, z)
Definition fem_tools.h:75
#define N_MBHEX0(x, y, z)
Definition fem_tools.h:71
#define N_MBHEX6(x, y, z)
Definition fem_tools.h:77
#define diffN_MBHEX5z(x, y)
Definition fem_tools.h:100
#define N_MBHEX2(x, y, z)
Definition fem_tools.h:73
#define diffN_MBQUAD0y(x)
Definition fem_tools.h:62
#define diffN_MBTET1y
derivative of tetrahedral shape function
Definition fem_tools.h:36
#define diffN_MBHEX0x(y, z)
Definition fem_tools.h:79
#define diffN_MBHEX1x(y, z)
Definition fem_tools.h:80
#define diffN_MBTRI0x
derivative of triangle shape function
Definition fem_tools.h:49
#define N_MBQUAD0(x, y)
quad shape function
Definition fem_tools.h:57
#define diffN_MBHEX2z(x, y)
Definition fem_tools.h:97
#define diffN_MBHEX5y(x, z)
Definition fem_tools.h:92
#define diffN_MBHEX4x(y, z)
Definition fem_tools.h:83
#define diffN_MBTET2y
derivative of tetrahedral shape function
Definition fem_tools.h:39
#define diffN_MBTET2x
derivative of tetrahedral shape function
Definition fem_tools.h:38
#define N_MBHEX1(x, y, z)
Definition fem_tools.h:72
#define N_MBTRI0(x, y)
triangle shape function
Definition fem_tools.h:46
#define diffN_MBTRI2y
derivative of triangle shape function
Definition fem_tools.h:54
#define diffN_MBHEX3x(y, z)
Definition fem_tools.h:82
#define diffN_MBQUAD3x(y)
Definition fem_tools.h:67
#define diffN_MBQUAD2x(y)
Definition fem_tools.h:65
#define diffN_MBHEX2y(x, z)
Definition fem_tools.h:89
#define N_MBQUAD2(x, y)
quad shape function
Definition fem_tools.h:59
#define N_MBTRI2(x, y)
triangle shape function
Definition fem_tools.h:48
#define diffN_MBHEX0y(x, z)
Definition fem_tools.h:87
#define diffN_MBHEX0z(x, y)
Definition fem_tools.h:95
#define N_MBQUAD1(x, y)
quad shape function
Definition fem_tools.h:58
#define N_MBTET2(x, y, z)
tetrahedral shape function
Definition fem_tools.h:30
#define N_MBEDGE1(x)
edge shape function
Definition fem_tools.h:106
#define diffN_MBTRI1x
derivative of triangle shape function
Definition fem_tools.h:51
#define diffN_MBTET3x
derivative of tetrahedral shape function
Definition fem_tools.h:41
#define diffN_MBHEX2x(y, z)
Definition fem_tools.h:81
#define diffN_MBTET1x
derivative of tetrahedral shape function
Definition fem_tools.h:35
#define diffN_MBTET0x
derivative of tetrahedral shape function
Definition fem_tools.h:32
#define diffN_MBHEX7x(y, z)
Definition fem_tools.h:86
#define N_MBTET3(x, y, z)
tetrahedral shape function
Definition fem_tools.h:31
static const double edge_coords[6][6]
double eta
const double v
phase velocity of light in medium (cm/ns)
constexpr int nb_levels
Definition level_set.cpp:58
double tol
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
Definition Types.hpp:77
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
double zeta
Viscous hardening.
Definition plastic.cpp:131
double q
Core (interface) class.
Definition Core.hpp:83
keeps basic data about problem
Auxiliary tools.
Definition Tools.hpp:19
static constexpr double shapeFunMBEDGE1At00
Definition Tools.hpp:56
static constexpr double diffShapeFunMBTET0y
derivative of tetrahedral shape function
Definition Tools.hpp:290
static SEGMENT_MIN_DISTANCE minDistanceFromSegments(const double *w_ptr, const double *v_ptr, const double *k_ptr, const double *l_ptr, double *const tvw_ptr=nullptr, double *const tlk_ptr=nullptr)
Find points on two segments in closest distance.
Definition Tools.cpp:472
static RefineTrianglesReturn refineTriangle(int nb_levels)
create uniform triangle mesh of refined elements
Definition Tools.cpp:724
static constexpr double diffShapeFunMBHEXAtCenter6y
derivative of quad shape function
Definition Tools.hpp:201
static constexpr double shapeFunMBTET1At000
Definition Tools.hpp:336
static MoFEMErrorCode getLocalCoordinatesOnReferenceFourNodeTet(const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
Get the local coordinates on reference four node tet object.
Definition Tools.cpp:88
static constexpr double shapeFunMBTET0At000
Definition Tools.hpp:335
static constexpr double diffShapeFunMBHEXAtCenter0y
derivative of HEX shape function
Definition Tools.hpp:165
static double shapeFunMBTET0(const double x, const double y, const double z)
Definition Tools.hpp:786
static MoFEMErrorCode outerProductOfEdgeIntegrationPtsForQuad(MatrixDouble &pts, const int edge0, const int edge1)
Definition Tools.cpp:613
static constexpr double diffShapeFunMBTRI1x
derivative of triangle shape function
Definition Tools.hpp:95
static constexpr double diffShapeFunMBQUADAtCenter0x
derivative of quad shape function
Definition Tools.hpp:146
static constexpr double diffShapeFunMBQUADAtCenter2y
derivative of quad shape function
Definition Tools.hpp:156
static SEGMENT_MIN_DISTANCE minDistancePointFromOnSegment(const double *w_ptr, const double *v_ptr, const double *p_ptr, double *const t_ptr=nullptr)
Find closet point on the segment from the point.
Definition Tools.cpp:449
static constexpr double shapeFunMBTRI1At00
Definition Tools.hpp:113
static double shapeFunMBTET3(const double x, const double y, const double z)
Definition Tools.hpp:802
static constexpr double diffShapeFunMBTET0z
derivative of tetrahedral shape function
Definition Tools.hpp:292
static constexpr double diffShapeFunMBHEXAtCenter1x
derivative of HEX shape function
Definition Tools.hpp:169
static constexpr double shapeFunMBTRI0At00
Definition Tools.hpp:112
static constexpr double diffShapeFunMBTET3y
derivative of tetrahedral shape function
Definition Tools.hpp:308
static constexpr std::array< double, 8 > diffShapeFunMBQUADAtCenter
Definition Tools.hpp:212
MoFEMErrorCode findMinDistanceFromTheEdges(const double *v_ptr, const int nb, Range edges, double *min_dist_ptr, double *o_ptr=nullptr, EntityHandle *o_segments=nullptr) const
Find minimal distance to edges.
Definition Tools.cpp:538
static constexpr double diffShapeFunMBTET1z
derivative of tetrahedral shape function
Definition Tools.hpp:298
static double shapeFunMBTRI1(const double x, const double y)
Definition Tools.hpp:761
static constexpr double diffShapeFunMBQUADAtCenter2x
derivative of quad shape function
Definition Tools.hpp:154
static constexpr std::array< double, 6 > diffShapeFunMBTRI
Definition Tools.hpp:104
static constexpr double diffShapeFunMBHEXAtCenter3z
derivative of quad shape function
Definition Tools.hpp:185
static constexpr double diffShapeFunMBHEXAtCenter7y
derivative of quad shape function
Definition Tools.hpp:207
static constexpr double diffShapeFunMBHEXAtCenter4y
derivative of quad shape function
Definition Tools.hpp:189
static constexpr double diffShapeFunMBTRI0x
derivative of triangle shape function
Definition Tools.hpp:91
static double shapeFunMBTET1(const double x, const double y, const double z)
Definition Tools.hpp:790
static double shapeFunMBEDGE1(const double x)
Definition Tools.hpp:740
@ SEGMENT_TWO_AND_TWO_ARE_POINT
Definition Tools.hpp:592
@ SEGMENT_ONE_IS_POINT
Definition Tools.hpp:590
@ SEGMENT_TWO_IS_POINT
Definition Tools.hpp:591
MoFEMErrorCode checkVectorForNotANumber(const Problem *prb_ptr, const RowColData row_or_col, Vec v)
Print all DOFs for which element of vector is not a number.
Definition Tools.cpp:307
static constexpr std::array< double, 2 > shapeFunMBEDGEAt00
Array of shape function at zero local point on reference element.
Definition Tools.hpp:62
static constexpr double shapeFunMBEDGE0At00
Definition Tools.hpp:55
static MatrixDouble refineTriangleIntegrationPts(MatrixDouble pts, RefineTrianglesReturn refined)
generate integration points for refined triangle mesh for last level
Definition Tools.cpp:791
static constexpr double diffShapeFunMBHEXAtCenter0z
derivative of HEX shape function
Definition Tools.hpp:167
static constexpr double diffShapeFunMBHEXAtCenter1y
derivative of HEX shape function
Definition Tools.hpp:171
static constexpr double diffShapeFunMBTET2z
derivative of tetrahedral shape function
Definition Tools.hpp:304
static constexpr double diffShapeFunMBTET3x
derivative of tetrahedral shape function
Definition Tools.hpp:306
MoFEMErrorCode minTetsQuality(const Range &tets, double &min_quality, Tag th=nullptr, boost::function< double(double, double)> f=[](double a, double b) -> double { return std::min(a, b);})
calculate minimal quality of tetrahedra in range
Definition Tools.cpp:49
std::tuple< std::vector< double >, std::vector< int >, std::vector< int > > RefineTrianglesReturn
Definition Tools.hpp:702
static constexpr double diffShapeFunMBHEXAtCenter5y
derivative of quad shape function
Definition Tools.hpp:195
static double shapeFunMBTRI0(const double x, const double y)
Definition Tools.hpp:757
static constexpr double shapeFunMBTET1AtOneThird
Definition Tools.hpp:342
static constexpr std::array< int, 12 > uniformTriangleRefineTriangles
Definition Tools.hpp:692
Tools(const MoFEM::Core &core)
Definition Tools.hpp:25
static constexpr double diffShapeFunMBTET0x
derivative of tetrahedral shape function
Definition Tools.hpp:288
static double shapeFunMBTET2(const double x, const double y, const double z)
Definition Tools.hpp:796
static constexpr double diffShapeFunMBHEXAtCenter2y
derivative of HEX shape function
Definition Tools.hpp:177
static constexpr double diffShapeFunMBHEXAtCenter3x
derivative of HEX shape function
Definition Tools.hpp:181
MoFEMErrorCode writeTetsWithQuality(const char *file_name, const char *file_type, const char *options, const Range &tets, Tag th=nullptr, boost::function< bool(double)> f=[](double q) -> bool { if(q<=0) return true;else return false;})
Write file with tetrahedral of given quality.
Definition Tools.cpp:269
static MoFEMErrorCode getLocalCoordinatesOnReferenceThreeNodeTri(const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
Get the local coordinates on reference three node tri object.
Definition Tools.cpp:188
static constexpr double shapeFunMBTET2AtOneThird
Definition Tools.hpp:344
MoFEMErrorCode getTetsWithQuality(Range &out_tets, const Range &tets, Tag th=nullptr, boost::function< bool(double)> f=[](double q) -> bool { if(q<=0) return true;else return false;})
Get the Tets With Quality.
Definition Tools.cpp:244
static MoFEMErrorCode shapeFunMBHEX(double *shape, const double *ksi, const double *eta, const double *zeta, const int nb)
Calculate shape functions on hexahedron.
Definition Tools.hpp:843
static constexpr double diffShapeFunMBQUADAtCenter3y
derivative of quad shape function
Definition Tools.hpp:160
static constexpr double diffShapeFunMBQUADAtCenter1y
derivative of quad shape function
Definition Tools.hpp:152
static MoFEMErrorCode outerProductOfEdgeIntegrationPtsForHex(MatrixDouble &pts, const int edge0, const int edge1, const int edge2)
Definition Tools.cpp:662
static MoFEMErrorCode getTriNormal(const double *coords, double *normal, double *d_normal=nullptr)
Get the Tri Normal objectGet triangle normal.
Definition Tools.cpp:353
static constexpr double shapeFunMBTRI2At00
Definition Tools.hpp:114
static constexpr std::array< double, 24 > diffShapeFunMBHEXAtCenter
Definition Tools.hpp:218
static constexpr double shapeFunMBTET3At000
Definition Tools.hpp:338
static constexpr std::array< double, 4 > shapeFunMBTETAt000
Array of shape function at zero local point on reference element.
Definition Tools.hpp:372
static constexpr double diffShapeFunMBHEXAtCenter0x
derivative of HEX shape function
Definition Tools.hpp:163
static constexpr double diffShapeFunMBQUADAtCenter3x
derivative of quad shape function
Definition Tools.hpp:158
static double shapeFunMBEDGE0(const double x)
Definition Tools.hpp:736
static constexpr double diffN_MBEDGE0x
Definition Tools.hpp:65
static constexpr double diffN_MBEDGE1x
Definition Tools.hpp:66
static constexpr double diffShapeFunMBHEXAtCenter3y
derivative of quad shape function
Definition Tools.hpp:183
static constexpr double diffShapeFunMBTRI2x
derivative of triangle shape function
Definition Tools.hpp:99
static constexpr double diffShapeFunMBHEXAtCenter2x
derivative of HEX shape function
Definition Tools.hpp:175
static MoFEMErrorCode checkIfPointIsInTet(const double tet_coords[], const double global_coord[], const double tol, bool &result)
Check of point is in tetrahedral.
Definition Tools.cpp:287
static MoFEMErrorCode getLocalCoordinatesOnReferenceEdgeNodeEdge(const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
Get the local coordinates on reference four node tet object.
Definition Tools.cpp:203
static constexpr double diffShapeFunMBHEXAtCenter7z
derivative of quad shape function
Definition Tools.hpp:209
static MoFEMErrorCode shapeFunMBTET(double *shape, const double *ksi, const double *eta, const double *zeta, const double nb)
Calculate shape functions on tetrahedron.
Definition Tools.hpp:809
static constexpr std::array< double, 2 > diffShapeFunMBEDGE
Definition Tools.hpp:68
static constexpr double diffShapeFunMBTET1y
derivative of tetrahedral shape function
Definition Tools.hpp:296
static MoFEMErrorCode shapeFunMBEDGE(double *shape, const double *ksi, const int nb)
Calculate shape functions on edge.
Definition Tools.hpp:745
static MoFEMErrorCode shapeFunMBQUAD(double *shape, const double *ksi, const double *eta, const int nb)
Calculate shape functions on quadrilateral.
Definition Tools.hpp:827
static double tetVolume(const double *coords)
Calculate volume of tetrahedron.
Definition Tools.cpp:30
static constexpr double diffShapeFunMBTRI2y
derivative of triangle shape function
Definition Tools.hpp:101
static double volumeLengthQuality(const double *coords)
Calculate tetrahedron volume length quality.
Definition Tools.cpp:15
double getTriArea(const EntityHandle tri) const
Get triangle area.
Definition Tools.cpp:408
static constexpr std::array< double, 3 > shapeFunMBTRIAt00
Array of shape function at zero local point on reference element.
Definition Tools.hpp:120
static constexpr double diffShapeFunMBHEXAtCenter7x
derivative of HEX shape function
Definition Tools.hpp:205
static constexpr double diffShapeFunMBTRI0y
derivative of triangle shape function
Definition Tools.hpp:93
static constexpr double shapeFunMBTET3AtOneThird
Definition Tools.hpp:346
static constexpr double diffShapeFunMBTET3z
derivative of tetrahedral shape function
Definition Tools.hpp:310
static std::tuple< std::array< double, 3 >, std::array< double, 2 >, double > getTricircumcenter3d(double *coords_ptr)
Calculate triangle circumcenter in 3d.
Definition Tools.cpp:878
static constexpr double diffShapeFunMBTET1x
derivative of tetrahedral shape function
Definition Tools.hpp:294
static constexpr double diffShapeFunMBHEXAtCenter6x
derivative of HEX shape function
Definition Tools.hpp:199
static constexpr double diffShapeFunMBHEXAtCenter4x
derivative of HEX shape function
Definition Tools.hpp:187
static constexpr double shapeFunMBTET2At000
Definition Tools.hpp:337
static constexpr double diffShapeFunMBHEXAtCenter5z
derivative of quad shape function
Definition Tools.hpp:197
static constexpr double shapeFunMBTET0AtOneThird
Definition Tools.hpp:340
static double shapeFunMBTRI2(const double x, const double y)
Definition Tools.hpp:766
static constexpr double diffShapeFunMBHEXAtCenter2z
derivative of HEX shape function
Definition Tools.hpp:179
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition Tools.cpp:9
static constexpr double diffShapeFunMBHEXAtCenter4z
derivative of quad shape function
Definition Tools.hpp:191
static constexpr std::array< double, 12 > diffShapeFunMBTET
Definition Tools.hpp:313
static constexpr double diffShapeFunMBTET2x
derivative of tetrahedral shape function
Definition Tools.hpp:300
static double getEdgeLength(const double *edge_coords)
Get edge length.
Definition Tools.cpp:418
static DEPRECATED MoFEMErrorCode getLocalCoordinatesOnReferenceTriNodeTri(const double *elem_coords, const double *glob_coords, const int nb_nodes, double *local_coords)
Definition Tools.hpp:440
MoFEM::Core & cOre
Definition Tools.hpp:24
static constexpr double diffShapeFunMBQUADAtCenter1x
derivative of quad shape function
Definition Tools.hpp:150
static constexpr double diffShapeFunMBHEXAtCenter6z
derivative of quad shape function
Definition Tools.hpp:203
static constexpr std::array< double, 4 > shapeFunMBTETAtOneThird
Array of shape function at center on reference element.
Definition Tools.hpp:380
static constexpr double diffShapeFunMBHEXAtCenter1z
derivative of HEX shape function
Definition Tools.hpp:173
static MoFEMErrorCode shapeFunMBTRI(double *shape, const double *ksi, const double *eta, const int nb)
Calculate shape functions on triangle.
Definition Tools.hpp:772
static constexpr double diffShapeFunMBTET2y
derivative of tetrahedral shape function
Definition Tools.hpp:302
static constexpr double diffShapeFunMBHEXAtCenter5x
derivative of HEX shape function
Definition Tools.hpp:193
static constexpr double diffShapeFunMBTRI1y
derivative of triangle shape function
Definition Tools.hpp:97
static constexpr double diffShapeFunMBQUADAtCenter0y
derivative of quad shape function
Definition Tools.hpp:148
base class for all interface classes