Intrepid2
Intrepid2_CellData.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Intrepid2 Package
5 // Copyright (2007) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or
38 // Mauro Perego (mperego@sandia.gov), or
39 // Nathan Roberts (nvrober@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
53 #ifndef __INTREPID2_CELLDATA_HPP__
54 #define __INTREPID2_CELLDATA_HPP__
55 
56 #include "Intrepid2_ConfigDefs.hpp"
57 
58 #include "Shards_CellTopology.hpp"
59 
60 #include "Intrepid2_Types.hpp"
61 #include "Intrepid2_Utils.hpp"
62 #include "Intrepid2_Kernels.hpp"
63 
64 namespace Intrepid2 {
65 
66 //============================================================================================//
67 // //
68 // RefSubcellParametrization //
69 // //
70 //============================================================================================//
71 
110 template<typename DeviceType>
112 public:
113  using ConstViewType = Kokkos::DynRankView<const double,DeviceType>;
114 
117  RefSubcellParametrization() = default;
118 
121  ~RefSubcellParametrization() = default;
122 
123 
128  static inline bool
129  isSupported( const unsigned cellTopoKey );
130 
131 
147  static inline
148  ConstViewType
149  get( const ordinal_type subcellDim,
150  const unsigned parentCellKey );
151 
152 private:
153 
157  static void set();
158 
168  template <typename HostViewType>
169  static void
170  set( HostViewType subcellParam,
171  const ordinal_type subcellDim,
172  const shards::CellTopology parentCell );
173 
175  using ViewType = Kokkos::DynRankView<double,DeviceType>;
176  static ViewType lineEdgesParam; // edge maps for 2d non-standard cells; shell line and beam
177  static ViewType triEdgesParam, quadEdgesParam; // edge maps for 2d standard cells
178  static ViewType shellTriEdgesParam, shellQuadEdgesParam; // edge maps for 3d non-standard cells; shell tri and quad
179  static ViewType tetEdgesParam, hexEdgesParam, pyrEdgesParam, wedgeEdgesParam; // edge maps for 3d standard cells
180  static ViewType shellTriFacesParam, shellQuadFacesParam; // face maps for 3d non-standard cells
181  static ViewType tetFacesParam, hexFacesParam, pyrFacesParam, wedgeFacesParam; // face maps for 3d standard cells
182 
185 
186 
187 };
188 
189 
190 
191 //============================================================================================//
192 // //
193 // RefCellNodes //
194 // //
195 //============================================================================================//
196 
197 
205 template<typename DeviceType>
207 public:
208  using ConstViewType = Kokkos::DynRankView<const double,DeviceType>;
209 
212  RefCellNodes() = default;
213 
216  ~RefCellNodes() = default;
217 
218 
232  static inline
233  ConstViewType
234  get(const unsigned cellTopoKey);
235 
236 private:
239  static void set();
240 
242  using ViewType = Kokkos::DynRankView<double,DeviceType>;
243  static ViewType lineNodes, line3Nodes;
244  static ViewType triangleNodes, triangle4Nodes, triangle6Nodes;
245  static ViewType quadrilateralNodes, quadrilateral8Nodes, quadrilateral9Nodes;
246  static ViewType tetrahedronNodes, tetrahedron8Nodes, tetrahedron10Nodes, tetrahedron11Nodes;
247  static ViewType hexahedronNodes, hexahedron20Nodes, hexahedron27Nodes;
248  static ViewType pyramidNodes, pyramid13Nodes, pyramid14Nodes;
249  static ViewType wedgeNodes, wedge15Nodes, wedge18Nodes;
250 
251 
256  double line[2][3], line_3[3][3];
257  double triangle[3][3], triangle_4[4][3], triangle_6[6][3];
258  double quadrilateral[4][3], quadrilateral_8[8][3], quadrilateral_9[9][3];
259  double tetrahedron[4][3], tetrahedron_8[8][3], tetrahedron_10[10][3], tetrahedron_11[10][3];
260  double hexahedron[8][3], hexahedron_20[20][3], hexahedron_27[27][3];
261  double pyramid[5][3], pyramid_13[13][3], pyramid_14[14][3];
262  double wedge[6][3], wedge_15[15][3], wedge_18[18][3];
263  };
264 
267 
270 
271 };
272 
273 //============================================================================================//
274 // //
275 // RefCellCenter //
276 // //
277 //============================================================================================//
278 
279 
287 template<typename DeviceType>
289 public:
290  using ConstViewType = Kokkos::DynRankView<const double,DeviceType>;
291 
292 
295  RefCellCenter() = default;
296 
299  ~RefCellCenter() = default;
300 
301 
314  static inline
315  ConstViewType
316  get(const unsigned cellTopoKey);
317 
318 private:
321  static void set();
322 
324  using ViewType = Kokkos::DynRankView<double,DeviceType>;
325  static ViewType lineCenter;
326  static ViewType triangleCenter;
327  static ViewType quadrilateralCenter;
328  static ViewType tetrahedronCenter;
329  static ViewType hexahedronCenter;
330  static ViewType pyramidCenter;
331  static ViewType wedgeCenter;
332 
337  double line[3];
338  double triangle[3];
339  double quadrilateral[3];
340  double tetrahedron[3];
341  double hexahedron[3];
342  double pyramid[3];
343  double wedge[3];
344  };
345 
348 
351 };
352 }
353 
354 #include "Intrepid2_CellDataDef.hpp"
355 
356 #endif
357 
This class defines the coordinates of the barycenter of the supported reference cells. The barycenter coordinates are stored in static views. The class is templated on the Kokkos::Device Type which is used to determine layout and memory space of the views.
RefSubcellParametrization()=default
Default constructor.
static bool isReferenceNodeDataSet_
whether the nodes coordinates have been already set using the method set()
Kokkos::DynRankView< double, DeviceType > ViewType
static views containing the center coordinates allocated on DeviceType::memory_space ...
static const ReferenceNodeDataStatic refNodeDataStatic_
static struct containing the nodes coordinates on host
Kokkos::DynRankView< double, DeviceType > ViewType
static views containing the parametrization maps, allocated on DeviceType::memory_space ...
~RefSubcellParametrization()=default
Destructor.
Definition file for the classes: Intrepid2::RefSubcellParametrization, Intrepid2::RefCellNodes, Intrepid2::RefCellCenter.
Header function for Intrepid2::Util class and other utility functions.
~RefCellNodes()=default
Destructor.
RefCellNodes()=default
Default constructor.
This class defines the coordinates of the nodes of reference cells according for supported cell topol...
static bool isReferenceCellCenterDataSet_
whether the center coordinates have been already set using the method set()
static void set()
Set reference nodes coordinates for supported topologies.
static bool isSupported(const unsigned cellTopoKey)
Checks if a cell topology has a reference parametrization.
static void set()
Computes and stores static views containing the parametrizations maps of edges and faces of all refer...
Contains definitions of custom data types in Intrepid2.
static bool isSubcellParametrizationSet_
whether the parametrizations have been already computed using the method set()
RefCellCenter()=default
Default constructor.
Kokkos::DynRankView< double, DeviceType > ViewType
static views containing the node coordinates allocated on DeviceType::memory_space ...
Reference node containers for each supported topology.
This class defines the parametrizations of edges and faces of supported reference cells...
Header file for small functions used in Intrepid2.
static void set()
Set center coordinates of reference cell for supported topologies.
static const ReferenceCenterDataStatic refCenterDataStatic_
static struct containing the nodes coordinates on host
~RefCellCenter()=default
Destructor.