Intrepid2
Intrepid2_CellTools.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)
39//
40// ************************************************************************
41// @HEADER
42
49#ifndef __INTREPID2_CELLTOOLS_HPP__
50#define __INTREPID2_CELLTOOLS_HPP__
51
52#include "Intrepid2_ConfigDefs.hpp"
53
54#include "Shards_CellTopology.hpp"
55#include "Shards_BasicTopologies.hpp"
56
57#include "Teuchos_RCP.hpp"
58
59#include "Intrepid2_Types.hpp"
60#include "Intrepid2_Utils.hpp"
61
63
64#include "Intrepid2_Basis.hpp"
65
69
74
77
81
83//#include "Intrepid2_HGRAD_WEDGE_I2_FEM.hpp"
84
85#include "Intrepid2_Data.hpp"
87
88namespace Intrepid2 {
89
90 //============================================================================================//
91 // //
92 // CellTools //
93 // //
94 //============================================================================================//
95
106 template<typename DeviceType>
107 class CellTools {
108 using ExecSpaceType = typename DeviceType::execution_space;
109 using MemSpaceType = typename DeviceType::memory_space;
110 public:
111
116 inline
117 static bool
118 hasReferenceCell( const shards::CellTopology cellTopo ) {
120 }
121
122 private:
123
127 template<typename outputValueType,
128 typename pointValueType>
129 static Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> >
130 createHGradBasis( const shards::CellTopology cellTopo ) {
131 Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> > r_val;
132
133 switch (cellTopo.getKey()) {
134 case shards::Line<2>::key: r_val = Teuchos::rcp(new Basis_HGRAD_LINE_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
135 case shards::Triangle<3>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TRI_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
136 case shards::Quadrilateral<4>::key: r_val = Teuchos::rcp(new Basis_HGRAD_QUAD_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
137 case shards::Tetrahedron<4>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TET_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
138 case shards::Hexahedron<8>::key: r_val = Teuchos::rcp(new Basis_HGRAD_HEX_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
139 case shards::Wedge<6>::key: r_val = Teuchos::rcp(new Basis_HGRAD_WEDGE_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
140 case shards::Pyramid<5>::key: r_val = Teuchos::rcp(new Basis_HGRAD_PYR_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
141
142 case shards::Triangle<6>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TRI_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
143 case shards::Quadrilateral<9>::key: r_val = Teuchos::rcp(new Basis_HGRAD_QUAD_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
144 case shards::Tetrahedron<10>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TET_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
145 case shards::Tetrahedron<11>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TET_COMP12_FEM<DeviceType,outputValueType,pointValueType>()); break;
146 //case shards::Hexahedron<20>::key: r_val = Teuchos::rcp(new Basis_HGRAD_HEX_I2_FEM <DeviceType,outputValueType,pointValueType>()); break;
147 case shards::Hexahedron<27>::key: r_val = Teuchos::rcp(new Basis_HGRAD_HEX_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
148 //case shards::Wedge<15>::key: r_val = Teuchos::rcp(new Basis_HGRAD_WEDGE_I2_FEM <DeviceType,outputValueType,pointValueType>()); break;
149 case shards::Wedge<18>::key: r_val = Teuchos::rcp(new Basis_HGRAD_WEDGE_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
150 //case shards::Pyramid<13>::key: r_val = Teuchos::rcp(new Basis_HGRAD_PYR_I2_FEM <DeviceType,outputValueType,pointValueType>()); break;
151
152 case shards::Quadrilateral<8>::key:
153 case shards::Line<3>::key:
154 case shards::Beam<2>::key:
155 case shards::Beam<3>::key:
156 case shards::ShellLine<2>::key:
157 case shards::ShellLine<3>::key:
158 case shards::ShellTriangle<3>::key:
159 case shards::ShellTriangle<6>::key:
160 case shards::ShellQuadrilateral<4>::key:
161 case shards::ShellQuadrilateral<8>::key:
162 case shards::ShellQuadrilateral<9>::key:
163 default: {
164 INTREPID2_TEST_FOR_EXCEPTION( true, std::invalid_argument,
165 ">>> ERROR (Intrepid2::CellTools::createHGradBasis): Cell topology not supported.");
166 }
167 }
168 return r_val;
169 }
170
171public:
172
175 CellTools() = default;
176
179 ~CellTools() = default;
180
181 //============================================================================================//
182 // //
183 // Jacobian, inverse Jacobian and Jacobian determinant //
184 // //
185 //============================================================================================//
186
222 template<typename jacobianValueType, class ...jacobianProperties,
223 typename pointValueType, class ...pointProperties,
224 typename WorksetType,
225 typename HGradBasisType>
226 static void
227 setJacobian( Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian,
228 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
229 const WorksetType worksetCell,
230 const Teuchos::RCP<HGradBasisType> basis,
231 const int startCell=0, const int endCell=-1);
232
267 template<typename jacobianValueType, class ...jacobianProperties,
268 typename BasisGradientsType,
269 typename WorksetType>
270 static void
271 setJacobian( Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian,
272 const WorksetType worksetCell,
273 const BasisGradientsType gradients,
274 const int startCell=0, const int endCell=-1);
275
310 template<typename jacobianValueType, class ...jacobianProperties,
311 typename pointValueType, class ...pointProperties,
312 typename worksetCellValueType, class ...worksetCellProperties>
313 static void
314 setJacobian( Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian,
315 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
316 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
317 const shards::CellTopology cellTopo ) {
318 auto basis = createHGradBasis<pointValueType,pointValueType>(cellTopo);
319 setJacobian(jacobian,
320 points,
321 worksetCell,
322 basis);
323 }
324
335 template<typename jacobianInvValueType, class ...jacobianInvProperties,
336 typename jacobianValueType, class ...jacobianProperties>
337 static void
338 setJacobianInv( Kokkos::DynRankView<jacobianInvValueType,jacobianInvProperties...> jacobianInv,
339 const Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian );
340
351 template<typename jacobianDetValueType, class ...jacobianDetProperties,
352 typename jacobianValueType, class ...jacobianProperties>
353 static void
354 setJacobianDet( Kokkos::DynRankView<jacobianDetValueType,jacobianDetProperties...> jacobianDet,
355 const Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian );
356
362 template<class PointScalar>
364
370 template<class PointScalar>
372
378 template<class PointScalar>
379 static void setJacobianDet( Data<PointScalar,DeviceType> & jacobianDet,
380 const Data<PointScalar,DeviceType> & jacobian);
381
387 template<class PointScalar>
388 static void setJacobianDetInv( Data<PointScalar,DeviceType> & jacobianDet,
389 const Data<PointScalar,DeviceType> & jacobian);
390
396 template<class PointScalar>
397 static void setJacobianInv( Data<PointScalar,DeviceType> & jacobianInv,
398 const Data<PointScalar,DeviceType> & jacobian);
399
400 //============================================================================================//
401 // //
402 // Node information //
403 // //
404 //============================================================================================//
405
406 // the node information can be used inside of kokkos functor and needs kokkos inline and
407 // exception should be an abort. for now, let's not decorate
408
416 template<typename cellCenterValueType, class ...cellCenterProperties>
417 static void
418 getReferenceCellCenter( Kokkos::DynRankView<cellCenterValueType,cellCenterProperties...> cellCenter,
419 const shards::CellTopology cell );
420
429 template<typename cellVertexValueType, class ...cellVertexProperties>
430 static void
431 getReferenceVertex( Kokkos::DynRankView<cellVertexValueType,cellVertexProperties...> cellVertex,
432 const shards::CellTopology cell,
433 const ordinal_type vertexOrd );
434
435
450 template<typename subcellVertexValueType, class ...subcellVertexProperties>
451 static void
452 getReferenceSubcellVertices( Kokkos::DynRankView<subcellVertexValueType,subcellVertexProperties...> subcellVertices,
453 const ordinal_type subcellDim,
454 const ordinal_type subcellOrd,
455 const shards::CellTopology parentCell );
456
457
458
474 template<typename cellNodeValueType, class ...cellNodeProperties>
475 static void
476 getReferenceNode( Kokkos::DynRankView<cellNodeValueType,cellNodeProperties...> cellNode,
477 const shards::CellTopology cell,
478 const ordinal_type nodeOrd );
479
480
481
495 template<typename subcellNodeValueType, class ...subcellNodeProperties>
496 static void
497 getReferenceSubcellNodes( Kokkos::DynRankView<subcellNodeValueType,subcellNodeProperties...> subcellNodes,
498 const ordinal_type subcellDim,
499 const ordinal_type subcellOrd,
500 const shards::CellTopology parentCell );
501
527 template<typename refEdgeTangentValueType, class ...refEdgeTangentProperties>
528 static void
529 getReferenceEdgeTangent( Kokkos::DynRankView<refEdgeTangentValueType,refEdgeTangentProperties...> refEdgeTangent,
530 const ordinal_type edgeOrd,
531 const shards::CellTopology parentCell );
532
569 template<typename refFaceTanValueType, class ...refFaceTanProperties>
570 static void
571 getReferenceFaceTangents( Kokkos::DynRankView<refFaceTanValueType,refFaceTanProperties...> refFaceTanU,
572 Kokkos::DynRankView<refFaceTanValueType,refFaceTanProperties...> refFaceTanV,
573 const ordinal_type faceOrd,
574 const shards::CellTopology parentCell );
575
638 template<typename refSideNormalValueType, class ...refSideNormalProperties>
639 static void
640 getReferenceSideNormal( Kokkos::DynRankView<refSideNormalValueType,refSideNormalProperties...> refSideNormal,
641 const ordinal_type sideOrd,
642 const shards::CellTopology parentCell );
643
682 template<typename refFaceNormalValueType, class ...refFaceNormalProperties>
683 static void
684 getReferenceFaceNormal( Kokkos::DynRankView<refFaceNormalValueType,refFaceNormalProperties...> refFaceNormal,
685 const ordinal_type faceOrd,
686 const shards::CellTopology parentCell );
687
717 template<typename edgeTangentValueType, class ...edgeTangentProperties,
718 typename worksetJacobianValueType, class ...worksetJacobianProperties>
719 static void
720 getPhysicalEdgeTangents( Kokkos::DynRankView<edgeTangentValueType,edgeTangentProperties...> edgeTangents,
721 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
722 const ordinal_type worksetEdgeOrd,
723 const shards::CellTopology parentCell );
724
725
737 template<typename edgeTangentValueType, class ...edgeTangentProperties,
738 typename worksetJacobianValueType, class ...worksetJacobianProperties,
739 typename edgeOrdValueType, class ...edgeOrdProperties>
740 static void
741 getPhysicalEdgeTangents( Kokkos::DynRankView<edgeTangentValueType,edgeTangentProperties...> edgeTangents,
742 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
743 const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetEdgeOrds,
744 const shards::CellTopology parentCell );
745
785 template<typename faceTanValueType, class ...faceTanProperties,
786 typename worksetJacobianValueType, class ...worksetJacobianProperties>
787 static void
788 getPhysicalFaceTangents( Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanU,
789 Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanV,
790 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
791 const ordinal_type worksetFaceOrd,
792 const shards::CellTopology parentCell );
793
794
807 template<typename faceTanValueType, class ...faceTanProperties,
808 typename worksetJacobianValueType, class ...worksetJacobianProperties,
809 typename faceOrdValueType, class ...faceOrdProperties>
810 static void
811 getPhysicalFaceTangents( Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanU,
812 Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanV,
813 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
814 const Kokkos::DynRankView<faceOrdValueType,faceOrdProperties...> worksetFaceOrds,
815 const shards::CellTopology parentCell );
816
817
818
879 template<typename sideNormalValueType, class ...sideNormalProperties,
880 typename worksetJacobianValueType, class ...worksetJacobianProperties>
881 static void
882 getPhysicalSideNormals( Kokkos::DynRankView<sideNormalValueType,sideNormalProperties...> sideNormals,
883 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
884 const ordinal_type worksetSideOrd,
885 const shards::CellTopology parentCell );
886
887
898 template<typename sideNormalValueType, class ...sideNormalProperties,
899 typename worksetJacobianValueType, class ...worksetJacobianProperties,
900 typename edgeOrdValueType, class ...edgeOrdProperties>
901 static void
902 getPhysicalSideNormals( Kokkos::DynRankView<sideNormalValueType,sideNormalProperties...> sideNormals,
903 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
904 const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetSideOrds,
905 const shards::CellTopology parentCell );
906
945 template<typename faceNormalValueType, class ...faceNormalProperties,
946 typename worksetJacobianValueType, class ...worksetJacobianProperties>
947 static void
948 getPhysicalFaceNormals( Kokkos::DynRankView<faceNormalValueType,faceNormalProperties...> faceNormals,
949 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
950 const ordinal_type worksetFaceOrd,
951 const shards::CellTopology parentCell );
952
953
965 template<typename faceNormalValueType, class ...faceNormalProperties,
966 typename worksetJacobianValueType, class ...worksetJacobianProperties,
967 typename faceOrdValueType, class ...faceOrdProperties>
968 static void
969 getPhysicalFaceNormals( Kokkos::DynRankView<faceNormalValueType,faceNormalProperties...> faceNormals,
970 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
971 const Kokkos::DynRankView<faceOrdValueType,faceOrdProperties...> worksetFaceOrds,
972 const shards::CellTopology parentCell );
973
974 //============================================================================================//
975 // //
976 // Reference-to-physical frame mapping and its inverse //
977 // //
978 //============================================================================================//
979
1016 template<typename physPointValueType, class ...physPointProperties,
1017 typename refPointValueType, class ...refPointProperties,
1018 typename WorksetType,
1019 typename HGradBasisPtrType>
1020 static void
1021 mapToPhysicalFrame( Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1022 const Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1023 const WorksetType worksetCell,
1024 const HGradBasisPtrType basis );
1025
1066 template<typename physPointValueType, class ...physPointProperties,
1067 typename refPointValueType, class ...refPointProperties,
1068 typename worksetCellValueType, class ...worksetCellProperties>
1069 static void
1070 mapToPhysicalFrame( Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1071 const Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1072 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1073 const shards::CellTopology cellTopo ) {
1074 auto basis = createHGradBasis<refPointValueType,refPointValueType>(cellTopo);
1075 mapToPhysicalFrame(physPoints,
1076 refPoints,
1077 worksetCell,
1078 basis);
1079 }
1080
1081
1132 template<typename refSubcellPointValueType, class ...refSubcellPointProperties,
1133 typename paramPointValueType, class ...paramPointProperties>
1134 static void
1135 mapToReferenceSubcell( Kokkos::DynRankView<refSubcellPointValueType,refSubcellPointProperties...> refSubcellPoints,
1136 const Kokkos::DynRankView<paramPointValueType,paramPointProperties...> paramPoints,
1137 const ordinal_type subcellDim,
1138 const ordinal_type subcellOrd,
1139 const shards::CellTopology parentCell );
1140
1141
1142 //============================================================================================//
1143 // //
1144 // Physical-to-reference frame mapping and its inverse //
1145 // //
1146 //============================================================================================//
1147
1148
1192 template<typename refPointValueType, class ...refPointProperties,
1193 typename physPointValueType, class ...physPointProperties,
1194 typename worksetCellValueType, class ...worksetCellProperties>
1195 static void
1196 mapToReferenceFrame( Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1197 const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1198 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1199 const shards::CellTopology cellTopo );
1200
1227 template<typename refPointValueType, class ...refPointProperties,
1228 typename initGuessValueType, class ...initGuessProperties,
1229 typename physPointValueType, class ...physPointProperties,
1230 typename worksetCellValueType, class ...worksetCellProperties,
1231 typename HGradBasisPtrType>
1232 static void
1233 mapToReferenceFrameInitGuess( Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1234 const Kokkos::DynRankView<initGuessValueType,initGuessProperties...> initGuess,
1235 const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1236 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1237 const HGradBasisPtrType basis );
1238
1239
1270 template<typename refPointValueType, class ...refPointProperties,
1271 typename initGuessValueType, class ...initGuessProperties,
1272 typename physPointValueType, class ...physPointProperties,
1273 typename worksetCellValueType, class ...worksetCellProperties>
1274 static void
1275 mapToReferenceFrameInitGuess( Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1276 const Kokkos::DynRankView<initGuessValueType,initGuessProperties...> initGuess,
1277 const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1278 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1279 const shards::CellTopology cellTopo ) {
1280 auto basis = createHGradBasis<refPointValueType,refPointValueType>(cellTopo);
1282 initGuess,
1283 physPoints,
1284 worksetCell,
1285 basis);
1286 }
1287
1288
1289 //============================================================================================//
1290 // //
1291 // Control Volume Coordinates //
1292 // //
1293 //============================================================================================//
1294
1368 template<typename subcvCoordValueType, class ...subcvCoordProperties,
1369 typename cellCoordValueType, class ...cellCoordProperties>
1370 static void
1371 getSubcvCoords( Kokkos::DynRankView<subcvCoordValueType,subcvCoordProperties...> subcvCoords,
1372 const Kokkos::DynRankView<cellCoordValueType,cellCoordProperties...> cellCoords,
1373 const shards::CellTopology primaryCell );
1374
1375 //============================================================================================//
1376 // //
1377 // Inclusion tests //
1378 // //
1379 //============================================================================================//
1380
1390 template<typename pointValueType, class ...pointProperties>
1391 static bool
1392 checkPointInclusion( const Kokkos::DynRankView<pointValueType,pointProperties...> point,
1393 const shards::CellTopology cellTopo,
1394 const double thres = threshold() );
1395
1396 // template<class ArrayPoint>
1397 // static int checkPointsetInclusion(const ArrayPoint & points,
1398 // const shards::CellTopology & cellTopo,
1399 // const double & threshold = INTREPID2_THRESHOLD);
1400
1401
1402
1429 template<typename inCellValueType, class ...inCellProperties,
1430 typename pointValueType, class ...pointProperties>
1431 static void checkPointwiseInclusion( Kokkos::DynRankView<inCellValueType,inCellProperties...> inCell,
1432 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1433 const shards::CellTopology cellTopo,
1434 const double thres = threshold() );
1435
1457 template<typename inCellValueType, class ...inCellProperties,
1458 typename pointValueType, class ...pointProperties,
1459 typename cellWorksetValueType, class ...cellWorksetProperties>
1460 static void checkPointwiseInclusion( Kokkos::DynRankView<inCellValueType,inCellProperties...> inCell,
1461 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1462 const Kokkos::DynRankView<cellWorksetValueType,cellWorksetProperties...> cellWorkset,
1463 const shards::CellTopology cellTopo,
1464 const double thres = threshold() );
1465
1466
1467 // //============================================================================================//
1468 // // //
1469 // // Debug //
1470 // // //
1471 // //============================================================================================//
1472
1473
1474 // /** \brief Prints the reference space coordinates of the vertices of the specified subcell
1475 // \param subcellDim [in] - dimension of the subcell where points are mapped to
1476 // \param subcellOrd [in] - subcell ordinal
1477 // \param parentCell [in] - cell topology of the parent cell.
1478 // */
1479 // static void printSubcellVertices(const int subcellDim,
1480 // const int subcellOrd,
1481 // const shards::CellTopology & parentCell);
1482
1483
1484
1485 // /** \brief Prints the nodes of a subcell from a cell workset
1486
1487 // */
1488 // template<class ArrayCell>
1489 // static void printWorksetSubcell(const ArrayCell & cellWorkset,
1490 // const shards::CellTopology & parentCell,
1491 // const int& pCellOrd,
1492 // const int& subcellDim,
1493 // const int& subcellOrd,
1494 // const int& fieldWidth = 3);
1495 };
1496
1497 //============================================================================================//
1498 // //
1499 // Validation of input/output arguments for CellTools methods //
1500 // //
1501 //============================================================================================//
1502
1509 template<typename jacobianViewType,
1510 typename PointViewType,
1511 typename worksetCellViewType>
1512 static void
1513 CellTools_setJacobianArgs( const jacobianViewType jacobian,
1514 const PointViewType points,
1515 const worksetCellViewType worksetCell,
1516 const shards::CellTopology cellTopo );
1517
1522 template<typename jacobianInvViewType,
1523 typename jacobianViewType>
1524 static void
1525 CellTools_setJacobianInvArgs( const jacobianInvViewType jacobianInv,
1526 const jacobianViewType jacobian );
1527
1528
1533 template<typename jacobianDetViewType,
1534 typename jacobianViewType>
1535 static void
1536 CellTools_setJacobianDetArgs( const jacobianDetViewType jacobianDet,
1537 const jacobianViewType jacobian );
1538
1539
1546 template<typename physPointViewType,
1547 typename refPointViewType,
1548 typename worksetCellViewType>
1549 static void
1550 CellTools_mapToPhysicalFrameArgs( const physPointViewType physPoints,
1551 const refPointViewType refPoints,
1552 const worksetCellViewType worksetCell,
1553 const shards::CellTopology cellTopo );
1554
1555
1562 template<typename refPointViewType,
1563 typename physPointViewType,
1564 typename worksetCellViewType>
1565 static void
1566 CellTools_mapToReferenceFrameArgs( const refPointViewType refPoints,
1567 const physPointViewType physPoints,
1568 const worksetCellViewType worksetCell,
1569 const shards::CellTopology cellTopo );
1570
1571
1572
1580 template<typename refPointViewType,
1581 typename initGuessViewType,
1582 typename physPointViewType,
1583 typename worksetCellViewType>
1584 static void
1585 CellTools_mapToReferenceFrameInitGuess( const refPointViewType refPoints,
1586 const initGuessViewType initGuess,
1587 const physPointViewType physPoints,
1588 const worksetCellViewType worksetCell,
1589 const shards::CellTopology cellTopo );
1590
1591 // /** \brief Validates arguments to Intrepid2::CellTools::checkPointwiseInclusion
1592 // \param inCell [out] - rank-1 (P) array required
1593 // \param physPoints [in] - rank-2 (P,D) array required
1594 // \param cellWorkset [in] - rank-3 (C,N,D) array required
1595 // \param whichCell [in] - 0 <= whichCell < C required
1596 // \param cellTopo [in] - cell topology with a reference cell required
1597 // */
1598 // template<class ArrayIncl, class ArrayPoint, class ArrayCell>
1599 // static void
1600 // validateArguments_checkPointwiseInclusion(ArrayIncl & inCell,
1601 // const ArrayPoint & physPoints,
1602 // const ArrayCell & cellWorkset,
1603 // const int & whichCell,
1604 // const shards::CellTopology & cell);
1605
1606
1607
1608}
1609
1611
1614
1618
1620
1621// not yet converted ...
1623
1624// #include "Intrepid2_CellToolsDefDebug.hpp"
1625
1626
1627#endif
1628
Header file for the abstract base class Intrepid2::Basis.
Header file for the classes: Intrepid2::RefSubcellParametrization, Intrepid2::RefCellNodes,...
Definition file for the control volume functions of the Intrepid2::CellTools class.
Definition file for point inclusion functions of the Intrepid2::CellTools class.
Definition file for the Jacobian functions in the Intrepid2::CellTools class.
Definition file for node data and subcell functions of the Intrepid2::CellTools class.
Definition file for the physical to reference mappings in the Intrepid2::CellTools class.
Definition file for the reference to physical mappings in the Intrepid2::CellTools class.
Definition file for the validate arguments functions of the Intrepid2::CellTools class.
void CellTools_setJacobianInvArgs(const jacobianInvViewType jacobianInv, const jacobianViewType jacobian)
Validates arguments to Intrepid2::CellTools::setJacobianInv.
void CellTools_mapToReferenceFrameArgs(const refPointViewType refPoints, const physPointViewType physPoints, const worksetCellViewType worksetCell, const shards::CellTopology cellTopo)
Validates arguments to Intrepid2::CellTools::mapToReferenceFrame with default initial guess.
void CellTools_mapToPhysicalFrameArgs(const physPointViewType physPoints, const refPointViewType refPoints, const worksetCellViewType worksetCell, const shards::CellTopology cellTopo)
Validates arguments to Intrepid2::CellTools::mapToPhysicalFrame.
void CellTools_setJacobianDetArgs(const jacobianDetViewType jacobianDet, const jacobianViewType jacobian)
Validates arguments to Intrepid2::CellTools::setJacobianDet.
Header file with additional documentation for the Intrepid2::CellTools class.
static void CellTools_mapToReferenceFrameInitGuess(const refPointViewType refPoints, const initGuessViewType initGuess, const physPointViewType physPoints, const worksetCellViewType worksetCell, const shards::CellTopology cellTopo)
Validates arguments to Intrepid2::CellTools::mapToReferenceFrame with user-defined initial guess.
static void CellTools_setJacobianArgs(const jacobianViewType jacobian, const PointViewType points, const worksetCellViewType worksetCell, const shards::CellTopology cellTopo)
Validates arguments to Intrepid2::CellTools::setJacobian.
Defines the Data class, a wrapper around a Kokkos::View that allows data that is constant or repeatin...
Header file for the Intrepid2::Basis_HGRAD_HEX_C1_FEM class.
Header file for the Intrepid2::Basis_HGRAD_HEX_C2_FEM class.
Header file for the Intrepid2::Basis_HGRAD_LINE_C1_FEM class.
Header file for the Intrepid2::Basis_HGRAD_PYR_C1_FEM class.
Header file for the Intrepid2::Basis_HGRAD_QUAD_C1_FEM class.
Header file for the Intrepid2::Basis_HGRAD_QUAD_C2_FEM class.
Header file for the Intrepid2::Basis_HGRAD_TET_C1_FEM class.
Header file for the Intrepid2::Basis_HGRAD_TET_C2_FEM class.
Header file for the Intrepid2::Basis_HGRAD_TET_COMP12_FEM class.
Header file for the Intrepid2::Basis_HGRAD_TRI_C1_FEM class.
Header file for the Intrepid2::Basis_HGRAD_TRI_C2_FEM class.
Header file for the Intrepid2::Basis_HGRAD_WEDGE_C1_FEM class.
Header file for the Intrepid2::Basis_HGRAD_WEDGE_C2_FEM class.
Header file for Intrepid2::RealSpaceTools class providing basic linear algebra functionality in 1D,...
Contains definitions of custom data types in Intrepid2.
Header function for Intrepid2::Util class and other utility functions.
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Tetrahedron cell.
A stateless class for operations on cell data. Provides methods for:
static void mapToReferenceFrame(Kokkos::DynRankView< refPointValueType, refPointProperties... > refPoints, const Kokkos::DynRankView< physPointValueType, physPointProperties... > physPoints, const Kokkos::DynRankView< worksetCellValueType, worksetCellProperties... > worksetCell, const shards::CellTopology cellTopo)
Computes , the inverse of the reference-to-physical frame map using a default initial guess.
static Teuchos::RCP< Basis< DeviceType, outputValueType, pointValueType > > createHGradBasis(const shards::CellTopology cellTopo)
Generates default HGrad basis based on cell topology.
static void mapToReferenceFrameInitGuess(Kokkos::DynRankView< refPointValueType, refPointProperties... > refPoints, const Kokkos::DynRankView< initGuessValueType, initGuessProperties... > initGuess, const Kokkos::DynRankView< physPointValueType, physPointProperties... > physPoints, const Kokkos::DynRankView< worksetCellValueType, worksetCellProperties... > worksetCell, const shards::CellTopology cellTopo)
Computation of , the inverse of the reference-to-physical frame map using user-supplied initial guess...
static void getReferenceSubcellNodes(Kokkos::DynRankView< subcellNodeValueType, subcellNodeProperties... > subcellNodes, const ordinal_type subcellDim, const ordinal_type subcellOrd, const shards::CellTopology parentCell)
Retrieves the Cartesian coordinates of all nodes of a reference subcell.
static void setJacobianDet(Kokkos::DynRankView< jacobianDetValueType, jacobianDetProperties... > jacobianDet, const Kokkos::DynRankView< jacobianValueType, jacobianProperties... > jacobian)
Computes the determinant of the Jacobian matrix DF of the reference-to-physical frame map F.
static void getReferenceNode(Kokkos::DynRankView< cellNodeValueType, cellNodeProperties... > cellNode, const shards::CellTopology cell, const ordinal_type nodeOrd)
Retrieves the Cartesian coordinates of a reference cell node.
static Data< PointScalar, DeviceType > allocateJacobianDet(const Data< PointScalar, DeviceType > &jacobian)
Allocates and returns a Data container suitable for storing determinants corresponding to the Jacobia...
static void mapToPhysicalFrame(Kokkos::DynRankView< physPointValueType, physPointProperties... > physPoints, const Kokkos::DynRankView< refPointValueType, refPointProperties... > refPoints, const WorksetType worksetCell, const HGradBasisPtrType basis)
Computes F, the reference-to-physical frame map.
static void getPhysicalFaceTangents(Kokkos::DynRankView< faceTanValueType, faceTanProperties... > faceTanU, Kokkos::DynRankView< faceTanValueType, faceTanProperties... > faceTanV, const Kokkos::DynRankView< worksetJacobianValueType, worksetJacobianProperties... > worksetJacobians, const ordinal_type worksetFaceOrd, const shards::CellTopology parentCell)
Computes non-normalized tangent vector pairs to physical faces in a face workset ; (see Subcell works...
static bool checkPointInclusion(const Kokkos::DynRankView< pointValueType, pointProperties... > point, const shards::CellTopology cellTopo, const double thres=threshold())
Checks if a point belongs to a reference cell.
static void getSubcvCoords(Kokkos::DynRankView< subcvCoordValueType, subcvCoordProperties... > subcvCoords, const Kokkos::DynRankView< cellCoordValueType, cellCoordProperties... > cellCoords, const shards::CellTopology primaryCell)
Computes coordinates of sub-control volumes in each primary cell.
static void mapToPhysicalFrame(Kokkos::DynRankView< physPointValueType, physPointProperties... > physPoints, const Kokkos::DynRankView< refPointValueType, refPointProperties... > refPoints, const Kokkos::DynRankView< worksetCellValueType, worksetCellProperties... > worksetCell, const shards::CellTopology cellTopo)
Computes F, the reference-to-physical frame map.
static void setJacobianDetInv(Data< PointScalar, DeviceType > &jacobianDet, const Data< PointScalar, DeviceType > &jacobian)
Computes reciprocals of determinants corresponding to the Jacobians in the Data container provided.
static void getReferenceEdgeTangent(Kokkos::DynRankView< refEdgeTangentValueType, refEdgeTangentProperties... > refEdgeTangent, const ordinal_type edgeOrd, const shards::CellTopology parentCell)
Computes constant tangent vectors to edges of 2D or 3D reference cells.
static void getPhysicalFaceNormals(Kokkos::DynRankView< faceNormalValueType, faceNormalProperties... > faceNormals, const Kokkos::DynRankView< worksetJacobianValueType, worksetJacobianProperties... > worksetJacobians, const ordinal_type worksetFaceOrd, const shards::CellTopology parentCell)
Computes non-normalized normal vectors to physical faces in a face workset ; (see Subcell worksets fo...
static void mapToReferenceFrameInitGuess(Kokkos::DynRankView< refPointValueType, refPointProperties... > refPoints, const Kokkos::DynRankView< initGuessValueType, initGuessProperties... > initGuess, const Kokkos::DynRankView< physPointValueType, physPointProperties... > physPoints, const Kokkos::DynRankView< worksetCellValueType, worksetCellProperties... > worksetCell, const HGradBasisPtrType basis)
Computation of , the inverse of the reference-to-physical frame map using user-supplied initial guess...
static void setJacobian(Kokkos::DynRankView< jacobianValueType, jacobianProperties... > jacobian, const Kokkos::DynRankView< pointValueType, pointProperties... > points, const Kokkos::DynRankView< worksetCellValueType, worksetCellProperties... > worksetCell, const shards::CellTopology cellTopo)
Computes the Jacobian matrix DF of the reference-to-physical frame map F.
static void getReferenceFaceNormal(Kokkos::DynRankView< refFaceNormalValueType, refFaceNormalProperties... > refFaceNormal, const ordinal_type faceOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to faces of 3D reference cell.
static bool hasReferenceCell(const shards::CellTopology cellTopo)
Checks if a cell topology has reference cell.
static void setJacobianInv(Kokkos::DynRankView< jacobianInvValueType, jacobianInvProperties... > jacobianInv, const Kokkos::DynRankView< jacobianValueType, jacobianProperties... > jacobian)
Computes the inverse of the Jacobian matrix DF of the reference-to-physical frame map F.
static void setJacobian(Kokkos::DynRankView< jacobianValueType, jacobianProperties... > jacobian, const Kokkos::DynRankView< pointValueType, pointProperties... > points, const WorksetType worksetCell, const Teuchos::RCP< HGradBasisType > basis, const int startCell=0, const int endCell=-1)
Computes the Jacobian matrix DF of the reference-to-physical frame map F.
static Data< PointScalar, DeviceType > allocateJacobianInv(const Data< PointScalar, DeviceType > &jacobian)
Allocates and returns a Data container suitable for storing inverses corresponding to the Jacobians i...
CellTools()=default
Default constructor.
static void checkPointwiseInclusion(Kokkos::DynRankView< inCellValueType, inCellProperties... > inCell, const Kokkos::DynRankView< pointValueType, pointProperties... > points, const shards::CellTopology cellTopo, const double thres=threshold())
Checks every point in a set for inclusion in a reference cell.
static void mapToReferenceSubcell(Kokkos::DynRankView< refSubcellPointValueType, refSubcellPointProperties... > refSubcellPoints, const Kokkos::DynRankView< paramPointValueType, paramPointProperties... > paramPoints, const ordinal_type subcellDim, const ordinal_type subcellOrd, const shards::CellTopology parentCell)
Computes parameterization maps of 1- and 2-subcells of reference cells.
~CellTools()=default
Destructor.
static void getPhysicalEdgeTangents(Kokkos::DynRankView< edgeTangentValueType, edgeTangentProperties... > edgeTangents, const Kokkos::DynRankView< worksetJacobianValueType, worksetJacobianProperties... > worksetJacobians, const ordinal_type worksetEdgeOrd, const shards::CellTopology parentCell)
Computes non-normalized tangent vectors to physical edges in an edge workset ; (see Subcell worksets ...
static void getReferenceCellCenter(Kokkos::DynRankView< cellCenterValueType, cellCenterProperties... > cellCenter, const shards::CellTopology cell)
Computes the Cartesian coordinates of reference cell barycenter.
static void getReferenceFaceTangents(Kokkos::DynRankView< refFaceTanValueType, refFaceTanProperties... > refFaceTanU, Kokkos::DynRankView< refFaceTanValueType, refFaceTanProperties... > refFaceTanV, const ordinal_type faceOrd, const shards::CellTopology parentCell)
Computes pairs of constant tangent vectors to faces of a 3D reference cells.
static void getReferenceSideNormal(Kokkos::DynRankView< refSideNormalValueType, refSideNormalProperties... > refSideNormal, const ordinal_type sideOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to sides of 2D or 3D reference cells.
static void getReferenceSubcellVertices(Kokkos::DynRankView< subcellVertexValueType, subcellVertexProperties... > subcellVertices, const ordinal_type subcellDim, const ordinal_type subcellOrd, const shards::CellTopology parentCell)
Retrieves the Cartesian coordinates of all vertices of a reference subcell.
static void getReferenceVertex(Kokkos::DynRankView< cellVertexValueType, cellVertexProperties... > cellVertex, const shards::CellTopology cell, const ordinal_type vertexOrd)
Retrieves the Cartesian coordinates of a reference cell vertex.
static void getPhysicalSideNormals(Kokkos::DynRankView< sideNormalValueType, sideNormalProperties... > sideNormals, const Kokkos::DynRankView< worksetJacobianValueType, worksetJacobianProperties... > worksetJacobians, const ordinal_type worksetSideOrd, const shards::CellTopology parentCell)
Computes non-normalized normal vectors to physical sides in a side workset .
Wrapper around a Kokkos::View that allows data that is constant or repeating in various logical dimen...
static bool isSupported(const unsigned cellTopoKey)
Checks if a cell topology has a reference parametrization.