Intrepid2
Intrepid2_CellData.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Intrepid2 Package
4//
5// Copyright 2007 NTESS and the Intrepid2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
18
19#ifndef __INTREPID2_CELLDATA_HPP__
20#define __INTREPID2_CELLDATA_HPP__
21
22#include "Intrepid2_ConfigDefs.hpp"
23
24#include "Shards_CellTopology.hpp"
25
26#include "Intrepid2_Types.hpp"
27#include "Intrepid2_Utils.hpp"
28#include "Intrepid2_Kernels.hpp"
29
30namespace Intrepid2 {
31
32//============================================================================================//
33// //
34// RefSubcellParametrization //
35// //
36//============================================================================================//
37
74
75
76template<typename DeviceType>
78public:
79 using ConstViewType = Kokkos::DynRankView<const double,DeviceType>;
80
84
88
89
94 static inline bool
95 isSupported( const unsigned cellTopoKey );
96
97
113 static inline
114 ConstViewType
115 get( const ordinal_type subcellDim,
116 const unsigned parentCellKey );
117
118private:
119
123 static void set();
124
134 template <typename HostViewType>
135 static void
136 set( HostViewType subcellParam,
137 const ordinal_type subcellDim,
138 const shards::CellTopology parentCell );
139
141 using ViewType = Kokkos::DynRankView<double,DeviceType>;
142 static ViewType beamEdgeParam, shellLineEdgesParam; // edge maps for 2d non-standard cells; shell line and beam
143 static ViewType triEdgesParam, quadEdgesParam; // edge maps for 2d standard cells
144 static ViewType shellTriEdgesParam, shellQuadEdgesParam; // edge maps for 3d non-standard cells; shell tri and quad
145 static ViewType tetEdgesParam, hexEdgesParam, pyrEdgesParam, wedgeEdgesParam; // edge maps for 3d standard cells
146 static ViewType shellTriFacesParam, shellQuadFacesParam; // face maps for 3d non-standard cells
147 static ViewType tetFacesParam, hexFacesParam, pyrFacesParam, wedgeFacesParam; // face maps for 3d standard cells
148
151
152
153};
154
155
156
157//============================================================================================//
158// //
159// RefCellNodes //
160// //
161//============================================================================================//
162
163
171template<typename DeviceType>
173public:
174 using ConstViewType = Kokkos::DynRankView<const double,DeviceType>;
175
178 RefCellNodes() = default;
179
182 ~RefCellNodes() = default;
183
184
198 static inline
199 ConstViewType
200 get(const unsigned cellTopoKey);
201
202private:
205 static void set();
206
208 using ViewType = Kokkos::DynRankView<double,DeviceType>;
209 static ViewType lineNodes, line3Nodes;
210 static ViewType triangleNodes, triangle4Nodes, triangle6Nodes;
211 static ViewType quadrilateralNodes, quadrilateral8Nodes, quadrilateral9Nodes;
212 static ViewType tetrahedronNodes, tetrahedron8Nodes, tetrahedron10Nodes, tetrahedron11Nodes;
213 static ViewType hexahedronNodes, hexahedron20Nodes, hexahedron27Nodes;
214 static ViewType pyramidNodes, pyramid13Nodes, pyramid14Nodes;
215 static ViewType wedgeNodes, wedge15Nodes, wedge18Nodes;
216
217
222 double line[2][3], line_3[3][3];
223 double triangle[3][3], triangle_4[4][3], triangle_6[6][3];
224 double quadrilateral[4][3], quadrilateral_8[8][3], quadrilateral_9[9][3];
225 double tetrahedron[4][3], tetrahedron_8[8][3], tetrahedron_10[10][3], tetrahedron_11[11][3];
226 double hexahedron[8][3], hexahedron_20[20][3], hexahedron_27[27][3];
227 double pyramid[5][3], pyramid_13[13][3], pyramid_14[14][3];
228 double wedge[6][3], wedge_15[15][3], wedge_18[18][3];
229 };
230
233
236
237};
238
239//============================================================================================//
240// //
241// RefCellCenter //
242// //
243//============================================================================================//
244
245
252
253template<typename DeviceType>
255public:
256 using ConstViewType = Kokkos::DynRankView<const double,DeviceType>;
257
258
261 RefCellCenter() = default;
262
265 ~RefCellCenter() = default;
266
267
280 static inline
281 ConstViewType
282 get(const unsigned cellTopoKey);
283
284private:
287 static void set();
288
290 using ViewType = Kokkos::DynRankView<double,DeviceType>;
291 static ViewType lineCenter;
292 static ViewType triangleCenter;
293 static ViewType quadrilateralCenter;
294 static ViewType tetrahedronCenter;
295 static ViewType hexahedronCenter;
296 static ViewType pyramidCenter;
297 static ViewType wedgeCenter;
298
303 double line[3];
304 double triangle[3];
305 double quadrilateral[3];
306 double tetrahedron[3];
307 double hexahedron[3];
308 double pyramid[3];
309 double wedge[3];
310 };
311
314
317};
318
319//============================================================================================//
320// //
321// ParametricDistance //
322// //
323//============================================================================================//
324
325
338
339template<unsigned CellTopologyKey>
341
342
348
349template<unsigned CellTopologyKey>
350struct [[deprecated("Deprecated, use ParametricDistance.")]] PointInclusion {
351
352 template<typename PointViewType, typename ScalarType>
353 KOKKOS_INLINE_FUNCTION
354 static bool
355 check(const PointViewType &point, const ScalarType threshold){
356 return ParametricDistance<CellTopologyKey>::distance(point) <= 1.0 + threshold;
357 }
358};
359
363template<>
364struct ParametricDistance<shards::Line<>::key> {
365 template<typename PointViewType>
366 KOKKOS_INLINE_FUNCTION
367 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
368 distance(const PointViewType &point);
369};
370
374template<>
375struct ParametricDistance<shards::Beam<>::key> {
376 template<typename PointViewType>
377 KOKKOS_INLINE_FUNCTION
378 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
379 distance(const PointViewType &point);
380};
381
385template<>
386struct ParametricDistance<shards::ShellLine<>::key> {
387 template<typename PointViewType>
388 KOKKOS_INLINE_FUNCTION
389 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
390 distance(const PointViewType &point);
391};
392
396template<>
397struct ParametricDistance<shards::Triangle<>::key> {
398 template<typename PointViewType>
399 KOKKOS_INLINE_FUNCTION
400 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
401 distance(const PointViewType &point);
402};
403
407template<>
408struct ParametricDistance<shards::ShellTriangle<>::key> {
409 template<typename PointViewType>
410 KOKKOS_INLINE_FUNCTION
411 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
412 distance(const PointViewType &point);
413};
414
418template<>
419struct ParametricDistance<shards::Quadrilateral<>::key> {
420 template<typename PointViewType>
421 KOKKOS_INLINE_FUNCTION
422 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
423 distance(const PointViewType &point);
424};
425
429template<>
430struct ParametricDistance<shards::ShellQuadrilateral<>::key> {
431 template<typename PointViewType>
432 KOKKOS_INLINE_FUNCTION
433 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
434 distance(const PointViewType &point);
435};
436
440template<>
441struct ParametricDistance<shards::Tetrahedron<>::key> {
442 template<typename PointViewType>
443 KOKKOS_INLINE_FUNCTION
444 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
445 distance(const PointViewType &point);
446};
447
451template<>
452struct ParametricDistance<shards::Hexahedron<>::key> {
453 template<typename PointViewType>
454 KOKKOS_INLINE_FUNCTION
455 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
456 distance(const PointViewType &point);
457};
458
462template<>
463struct ParametricDistance<shards::Pyramid<>::key> {
464 template<typename PointViewType>
465 KOKKOS_INLINE_FUNCTION
466 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
467 distance(const PointViewType &point);
468};
469
473template<>
474struct ParametricDistance<shards::Wedge<>::key> {
475 template<typename PointViewType>
476 KOKKOS_INLINE_FUNCTION
477 static typename ScalarTraits<typename PointViewType::value_type>::scalar_type
478 distance(const PointViewType &point);
479};
480
481const CellTopologyData* getCellTopologyData(const unsigned& cellTopologyKey);
482
483}
484
486
487#endif
488
Definition file for the classes: Intrepid2::RefSubcellParametrization, Intrepid2::RefCellNodes,...
Header file for small functions used in Intrepid2.
Contains definitions of custom data types in Intrepid2.
Header function for Intrepid2::Util class and other utility functions.
~RefCellCenter()=default
Destructor.
Kokkos::DynRankView< double, DeviceType > ViewType
static views containing the center coordinates allocated on DeviceType::memory_space
static const ReferenceCenterDataStatic refCenterDataStatic_
static struct containing the nodes coordinates on host
static void set()
Set center coordinates of reference cell for supported topologies.
RefCellCenter()=default
Default constructor.
static ConstViewType get(const unsigned cellTopoKey)
Retrieves the Cartesian coordinates of a reference cell barycenter.
static bool isReferenceCellCenterDataSet_
whether the center coordinates have been already set using the method set()
~RefCellNodes()=default
Destructor.
static ConstViewType get(const unsigned cellTopoKey)
Retrieves the Cartesian coordinates of reference cell nodes.
static void set()
Set reference nodes coordinates for supported topologies.
static bool isReferenceNodeDataSet_
whether the nodes coordinates have been already set using the method set()
static const ReferenceNodeDataStatic refNodeDataStatic_
static struct containing the nodes coordinates on host
RefCellNodes()=default
Default constructor.
Kokkos::DynRankView< double, DeviceType > ViewType
static views containing the node coordinates allocated on DeviceType::memory_space
static void set()
Computes and stores static views containing the parametrizations maps of edges and faces of all refer...
static bool isSubcellParametrizationSet_
whether the parametrizations have been already computed using the method set()
~RefSubcellParametrization()=default
Destructor.
Kokkos::DynRankView< double, DeviceType > ViewType
static views containing the parametrization maps, allocated on DeviceType::memory_space
static bool isSupported(const unsigned cellTopoKey)
Checks if a cell topology has a reference parametrization.
RefSubcellParametrization()=default
Default constructor.
static ConstViewType get(const ordinal_type subcellDim, const unsigned parentCellKey)
Returns a Kokkos view with the coefficients of the parametrization maps for the edges or faces of a r...
This class implements a distance function that computes the parametric distance of a point in a refer...
This [deprecated] class implements a check function that determines whether a given point is inside o...
Reference node containers for each supported topology.