49#ifndef __INTREPID2_CELLTOOLS_HPP__
50#define __INTREPID2_CELLTOOLS_HPP__
52#include "Intrepid2_ConfigDefs.hpp"
54#include "Shards_CellTopology.hpp"
55#include "Shards_BasicTopologies.hpp"
57#include "Teuchos_RCP.hpp"
107 template<
typename DeviceType>
109 using ExecSpaceType =
typename DeviceType::execution_space;
110 using MemSpaceType =
typename DeviceType::memory_space;
128 template<
typename outputValueType,
129 typename pointValueType>
130 static Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> >
132 Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> > r_val;
134 switch (cellTopo.getKey()) {
135 case shards::Line<2>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_LINE_C1_FEM <DeviceType,outputValueType,pointValueType>());
break;
136 case shards::Line<3>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_LINE_C2_FEM <DeviceType,outputValueType,pointValueType>());
break;
137 case shards::Triangle<3>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_TRI_C1_FEM <DeviceType,outputValueType,pointValueType>());
break;
138 case shards::Quadrilateral<4>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_QUAD_C1_FEM <DeviceType,outputValueType,pointValueType>());
break;
139 case shards::Tetrahedron<4>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_TET_C1_FEM <DeviceType,outputValueType,pointValueType>());
break;
140 case shards::Hexahedron<8>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_HEX_C1_FEM <DeviceType,outputValueType,pointValueType>());
break;
141 case shards::Wedge<6>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_WEDGE_C1_FEM <DeviceType,outputValueType,pointValueType>());
break;
142 case shards::Pyramid<5>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_PYR_C1_FEM <DeviceType,outputValueType,pointValueType>());
break;
144 case shards::Triangle<6>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_TRI_C2_FEM <DeviceType,outputValueType,pointValueType>());
break;
145 case shards::Quadrilateral<9>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_QUAD_C2_FEM <DeviceType,outputValueType,pointValueType>());
break;
146 case shards::Tetrahedron<10>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_TET_C2_FEM <DeviceType,outputValueType,pointValueType>());
break;
149 case shards::Hexahedron<27>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_HEX_C2_FEM <DeviceType,outputValueType,pointValueType>());
break;
151 case shards::Wedge<18>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_WEDGE_C2_FEM <DeviceType,outputValueType,pointValueType>());
break;
154 case shards::Quadrilateral<8>::key:
155 case shards::Beam<2>::key:
156 case shards::Beam<3>::key:
157 case shards::ShellLine<2>::key:
158 case shards::ShellLine<3>::key:
159 case shards::ShellTriangle<3>::key:
160 case shards::ShellTriangle<6>::key:
161 case shards::ShellQuadrilateral<4>::key:
162 case shards::ShellQuadrilateral<8>::key:
163 case shards::ShellQuadrilateral<9>::key:
165 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
166 ">>> ERROR (Intrepid2::CellTools::createHGradBasis): Cell topology not supported.");
223 template<
typename jacobianValueType,
class ...jacobianProperties,
224 typename pointValueType,
class ...pointProperties,
225 typename WorksetType,
226 typename HGradBasisType>
228 setJacobian( Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian,
229 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
230 const WorksetType worksetCell,
231 const Teuchos::RCP<HGradBasisType> basis,
232 const int startCell=0,
const int endCell=-1);
268 template<
typename jacobianValueType,
class ...jacobianProperties,
269 typename BasisGradientsType,
270 typename WorksetType>
272 setJacobian( Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian,
273 const WorksetType worksetCell,
274 const BasisGradientsType gradients,
275 const int startCell=0,
const int endCell=-1);
311 template<
typename jacobianValueType,
class ...jacobianProperties,
312 typename pointValueType,
class ...pointProperties,
313 typename worksetCellValueType,
class ...worksetCellProperties>
315 setJacobian( Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian,
316 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
317 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
318 const shards::CellTopology cellTopo ) {
319 using nonConstPointValueType = std::remove_const_t<pointValueType>;
337 template<
typename jacobianInvValueType,
class ...jacobianInvProperties,
338 typename jacobianValueType,
class ...jacobianProperties>
340 setJacobianInv( Kokkos::DynRankView<jacobianInvValueType,jacobianInvProperties...> jacobianInv,
341 const Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian );
353 template<
typename jacobianDetValueType,
class ...jacobianDetProperties,
354 typename jacobianValueType,
class ...jacobianProperties>
356 setJacobianDet( Kokkos::DynRankView<jacobianDetValueType,jacobianDetProperties...> jacobianDet,
357 const Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian );
364 template<
class Po
intScalar>
372 template<
class Po
intScalar>
380 template<
class Po
intScalar>
389 template<
class Po
intScalar>
398 template<
class Po
intScalar>
408 template<
class Po
intScalar>
429 template<
typename cellCenterValueType,
class ...cellCenterProperties>
432 const shards::CellTopology cell );
442 template<
typename cellVertexValueType,
class ...cellVertexProperties>
444 getReferenceVertex( Kokkos::DynRankView<cellVertexValueType,cellVertexProperties...> cellVertex,
445 const shards::CellTopology cell,
446 const ordinal_type vertexOrd );
463 template<
typename subcellVertexValueType,
class ...subcellVertexProperties>
466 const ordinal_type subcellDim,
467 const ordinal_type subcellOrd,
468 const shards::CellTopology parentCell );
487 template<
typename cellNodeValueType,
class ...cellNodeProperties>
489 getReferenceNode( Kokkos::DynRankView<cellNodeValueType,cellNodeProperties...> cellNode,
490 const shards::CellTopology cell,
491 const ordinal_type nodeOrd );
508 template<
typename subcellNodeValueType,
class ...subcellNodeProperties>
511 const ordinal_type subcellDim,
512 const ordinal_type subcellOrd,
513 const shards::CellTopology parentCell );
540 template<
typename refEdgeTangentValueType,
class ...refEdgeTangentProperties>
542 getReferenceEdgeTangent( Kokkos::DynRankView<refEdgeTangentValueType,refEdgeTangentProperties...> refEdgeTangent,
543 const ordinal_type edgeOrd,
544 const shards::CellTopology parentCell );
582 template<
typename refFaceTanValueType,
class ...refFaceTanProperties>
585 Kokkos::DynRankView<refFaceTanValueType,refFaceTanProperties...> refFaceTanV,
586 const ordinal_type faceOrd,
587 const shards::CellTopology parentCell );
651 template<
typename refSideNormalValueType,
class ...refSideNormalProperties>
653 getReferenceSideNormal( Kokkos::DynRankView<refSideNormalValueType,refSideNormalProperties...> refSideNormal,
654 const ordinal_type sideOrd,
655 const shards::CellTopology parentCell );
695 template<
typename refFaceNormalValueType,
class ...refFaceNormalProperties>
697 getReferenceFaceNormal( Kokkos::DynRankView<refFaceNormalValueType,refFaceNormalProperties...> refFaceNormal,
698 const ordinal_type faceOrd,
699 const shards::CellTopology parentCell );
730 template<
typename edgeTangentValueType,
class ...edgeTangentProperties,
731 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
734 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
735 const ordinal_type worksetEdgeOrd,
736 const shards::CellTopology parentCell );
750 template<
typename edgeTangentValueType,
class ...edgeTangentProperties,
751 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
752 typename edgeOrdValueType,
class ...edgeOrdProperties>
755 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
756 const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetEdgeOrds,
757 const shards::CellTopology parentCell );
798 template<
typename faceTanValueType,
class ...faceTanProperties,
799 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
802 Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanV,
803 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
804 const ordinal_type worksetFaceOrd,
805 const shards::CellTopology parentCell );
820 template<
typename faceTanValueType,
class ...faceTanProperties,
821 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
822 typename faceOrdValueType,
class ...faceOrdProperties>
825 Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanV,
826 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
827 const Kokkos::DynRankView<faceOrdValueType,faceOrdProperties...> worksetFaceOrds,
828 const shards::CellTopology parentCell );
892 template<
typename sideNormalValueType,
class ...sideNormalProperties,
893 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
896 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
897 const ordinal_type worksetSideOrd,
898 const shards::CellTopology parentCell );
911 template<
typename sideNormalValueType,
class ...sideNormalProperties,
912 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
913 typename edgeOrdValueType,
class ...edgeOrdProperties>
916 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
917 const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetSideOrds,
918 const shards::CellTopology parentCell );
958 template<
typename faceNormalValueType,
class ...faceNormalProperties,
959 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
962 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
963 const ordinal_type worksetFaceOrd,
964 const shards::CellTopology parentCell );
978 template<
typename faceNormalValueType,
class ...faceNormalProperties,
979 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
980 typename faceOrdValueType,
class ...faceOrdProperties>
983 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
984 const Kokkos::DynRankView<faceOrdValueType,faceOrdProperties...> worksetFaceOrds,
985 const shards::CellTopology parentCell );
1029 template<
typename physPointValueType,
class ...physPointProperties,
1030 typename refPointValueType,
class ...refPointProperties,
1031 typename WorksetType,
1032 typename HGradBasisPtrType>
1034 mapToPhysicalFrame( Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1035 const Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1036 const WorksetType worksetCell,
1037 const HGradBasisPtrType basis );
1079 template<
typename physPointValueType,
class ...physPointProperties,
1080 typename refPointValueType,
class ...refPointProperties,
1081 typename worksetCellValueType,
class ...worksetCellProperties>
1084 const Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1085 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1086 const shards::CellTopology cellTopo ) {
1087 using nonConstRefPointValueType = std::remove_const_t<refPointValueType>;
1146 template<
typename refSubcellPointValueType,
class ...refSubcellPointProperties,
1147 typename paramPointValueType,
class ...paramPointProperties>
1149 mapToReferenceSubcell( Kokkos::DynRankView<refSubcellPointValueType,refSubcellPointProperties...> refSubcellPoints,
1150 const Kokkos::DynRankView<paramPointValueType,paramPointProperties...> paramPoints,
1151 const ordinal_type subcellDim,
1152 const ordinal_type subcellOrd,
1153 const shards::CellTopology parentCell );
1206 template<
typename refPointValueType,
class ...refPointProperties,
1207 typename physPointValueType,
class ...physPointProperties,
1208 typename worksetCellValueType,
class ...worksetCellProperties>
1210 mapToReferenceFrame( Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1211 const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1212 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1213 const shards::CellTopology cellTopo );
1241 template<
typename refPointValueType,
class ...refPointProperties,
1242 typename initGuessValueType,
class ...initGuessProperties,
1243 typename physPointValueType,
class ...physPointProperties,
1244 typename worksetCellValueType,
class ...worksetCellProperties,
1245 typename HGradBasisPtrType>
1248 const Kokkos::DynRankView<initGuessValueType,initGuessProperties...> initGuess,
1249 const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1250 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1251 const HGradBasisPtrType basis );
1284 template<
typename refPointValueType,
class ...refPointProperties,
1285 typename initGuessValueType,
class ...initGuessProperties,
1286 typename physPointValueType,
class ...physPointProperties,
1287 typename worksetCellValueType,
class ...worksetCellProperties>
1290 const Kokkos::DynRankView<initGuessValueType,initGuessProperties...> initGuess,
1291 const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1292 const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1293 const shards::CellTopology cellTopo ) {
1382 template<
typename subcvCoordValueType,
class ...subcvCoordProperties,
1383 typename cellCoordValueType,
class ...cellCoordProperties>
1385 getSubcvCoords( Kokkos::DynRankView<subcvCoordValueType,subcvCoordProperties...> subcvCoords,
1386 const Kokkos::DynRankView<cellCoordValueType,cellCoordProperties...> cellCoords,
1387 const shards::CellTopology primaryCell );
1404 template<
typename pointValueType,
class ...pointProperties>
1407 const shards::CellTopology cellTopo,
1408 const double thres = threshold() );
1443 template<
typename inCellValueType,
class ...inCellProperties,
1444 typename pointValueType,
class ...pointProperties>
1446 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1447 const shards::CellTopology cellTopo,
1448 const double thres = threshold() );
1471 template<
typename inCellValueType,
class ...inCellProperties,
1472 typename pointValueType,
class ...pointProperties,
1473 typename cellWorksetValueType,
class ...cellWorksetProperties>
1475 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1476 const Kokkos::DynRankView<cellWorksetValueType,cellWorksetProperties...> cellWorkset,
1477 const shards::CellTopology cellTopo,
1478 const double thres = threshold() );
1523 template<
typename jacobianViewType,
1524 typename PointViewType,
1525 typename worksetCellViewType>
1529 const worksetCellViewType worksetCell,
1530 const shards::CellTopology cellTopo );
1536 template<
typename jacobianInvViewType,
1537 typename jacobianViewType>
1540 const jacobianViewType jacobian );
1547 template<
typename jacobianDetViewType,
1548 typename jacobianViewType>
1551 const jacobianViewType jacobian );
1560 template<
typename physPointViewType,
1561 typename refPointViewType,
1562 typename worksetCellViewType>
1565 const refPointViewType refPoints,
1566 const worksetCellViewType worksetCell,
1567 const shards::CellTopology cellTopo );
1576 template<
typename refPointViewType,
1577 typename physPointViewType,
1578 typename worksetCellViewType>
1581 const physPointViewType physPoints,
1582 const worksetCellViewType worksetCell,
1583 const shards::CellTopology cellTopo );
1594 template<
typename refPointViewType,
1595 typename initGuessViewType,
1596 typename physPointViewType,
1597 typename worksetCellViewType>
1600 const initGuessViewType initGuess,
1601 const physPointViewType physPoints,
1602 const worksetCellViewType worksetCell,
1603 const shards::CellTopology cellTopo );
Header file for the abstract base class Intrepid2::Basis.
Header file for the classes: Intrepid2::RefSubcellParametrization, Intrepid2::RefCellNodes,...
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_LINE_C2_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.
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.
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.