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"
106 template<
typename DeviceType>
108 using ExecSpaceType =
typename DeviceType::execution_space;
109 using MemSpaceType =
typename DeviceType::memory_space;
127 template<
typename outputValueType,
128 typename pointValueType>
129 static Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> >
131 Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> > r_val;
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;
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;
147 case shards::Hexahedron<27>::key: r_val = Teuchos::rcp(
new Basis_HGRAD_HEX_C2_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;
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:
164 INTREPID2_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
165 ">>> ERROR (Intrepid2::CellTools::createHGradBasis): Cell topology not supported.");
222 template<
typename jacobianValueType,
class ...jacobianProperties,
223 typename pointValueType,
class ...pointProperties,
224 typename WorksetType,
225 typename HGradBasisType>
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);
267 template<
typename jacobianValueType,
class ...jacobianProperties,
268 typename BasisGradientsType,
269 typename WorksetType>
271 setJacobian( Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian,
272 const WorksetType worksetCell,
273 const BasisGradientsType gradients,
274 const int startCell=0,
const int endCell=-1);
310 template<
typename jacobianValueType,
class ...jacobianProperties,
311 typename pointValueType,
class ...pointProperties,
312 typename worksetCellValueType,
class ...worksetCellProperties>
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);
335 template<
typename jacobianInvValueType,
class ...jacobianInvProperties,
336 typename jacobianValueType,
class ...jacobianProperties>
338 setJacobianInv( Kokkos::DynRankView<jacobianInvValueType,jacobianInvProperties...> jacobianInv,
339 const Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian );
351 template<
typename jacobianDetValueType,
class ...jacobianDetProperties,
352 typename jacobianValueType,
class ...jacobianProperties>
354 setJacobianDet( Kokkos::DynRankView<jacobianDetValueType,jacobianDetProperties...> jacobianDet,
355 const Kokkos::DynRankView<jacobianValueType,jacobianProperties...> jacobian );
362 template<
class Po
intScalar>
370 template<
class Po
intScalar>
378 template<
class Po
intScalar>
387 template<
class Po
intScalar>
396 template<
class Po
intScalar>
416 template<
typename cellCenterValueType,
class ...cellCenterProperties>
419 const shards::CellTopology cell );
429 template<
typename cellVertexValueType,
class ...cellVertexProperties>
431 getReferenceVertex( Kokkos::DynRankView<cellVertexValueType,cellVertexProperties...> cellVertex,
432 const shards::CellTopology cell,
433 const ordinal_type vertexOrd );
450 template<
typename subcellVertexValueType,
class ...subcellVertexProperties>
453 const ordinal_type subcellDim,
454 const ordinal_type subcellOrd,
455 const shards::CellTopology parentCell );
474 template<
typename cellNodeValueType,
class ...cellNodeProperties>
476 getReferenceNode( Kokkos::DynRankView<cellNodeValueType,cellNodeProperties...> cellNode,
477 const shards::CellTopology cell,
478 const ordinal_type nodeOrd );
495 template<
typename subcellNodeValueType,
class ...subcellNodeProperties>
498 const ordinal_type subcellDim,
499 const ordinal_type subcellOrd,
500 const shards::CellTopology parentCell );
527 template<
typename refEdgeTangentValueType,
class ...refEdgeTangentProperties>
529 getReferenceEdgeTangent( Kokkos::DynRankView<refEdgeTangentValueType,refEdgeTangentProperties...> refEdgeTangent,
530 const ordinal_type edgeOrd,
531 const shards::CellTopology parentCell );
569 template<
typename refFaceTanValueType,
class ...refFaceTanProperties>
572 Kokkos::DynRankView<refFaceTanValueType,refFaceTanProperties...> refFaceTanV,
573 const ordinal_type faceOrd,
574 const shards::CellTopology parentCell );
638 template<
typename refSideNormalValueType,
class ...refSideNormalProperties>
640 getReferenceSideNormal( Kokkos::DynRankView<refSideNormalValueType,refSideNormalProperties...> refSideNormal,
641 const ordinal_type sideOrd,
642 const shards::CellTopology parentCell );
682 template<
typename refFaceNormalValueType,
class ...refFaceNormalProperties>
684 getReferenceFaceNormal( Kokkos::DynRankView<refFaceNormalValueType,refFaceNormalProperties...> refFaceNormal,
685 const ordinal_type faceOrd,
686 const shards::CellTopology parentCell );
717 template<
typename edgeTangentValueType,
class ...edgeTangentProperties,
718 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
721 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
722 const ordinal_type worksetEdgeOrd,
723 const shards::CellTopology parentCell );
737 template<
typename edgeTangentValueType,
class ...edgeTangentProperties,
738 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
739 typename edgeOrdValueType,
class ...edgeOrdProperties>
742 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
743 const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetEdgeOrds,
744 const shards::CellTopology parentCell );
785 template<
typename faceTanValueType,
class ...faceTanProperties,
786 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
789 Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanV,
790 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
791 const ordinal_type worksetFaceOrd,
792 const shards::CellTopology parentCell );
807 template<
typename faceTanValueType,
class ...faceTanProperties,
808 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
809 typename faceOrdValueType,
class ...faceOrdProperties>
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 );
879 template<
typename sideNormalValueType,
class ...sideNormalProperties,
880 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
883 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
884 const ordinal_type worksetSideOrd,
885 const shards::CellTopology parentCell );
898 template<
typename sideNormalValueType,
class ...sideNormalProperties,
899 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
900 typename edgeOrdValueType,
class ...edgeOrdProperties>
903 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
904 const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetSideOrds,
905 const shards::CellTopology parentCell );
945 template<
typename faceNormalValueType,
class ...faceNormalProperties,
946 typename worksetJacobianValueType,
class ...worksetJacobianProperties>
949 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
950 const ordinal_type worksetFaceOrd,
951 const shards::CellTopology parentCell );
965 template<
typename faceNormalValueType,
class ...faceNormalProperties,
966 typename worksetJacobianValueType,
class ...worksetJacobianProperties,
967 typename faceOrdValueType,
class ...faceOrdProperties>
970 const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
971 const Kokkos::DynRankView<faceOrdValueType,faceOrdProperties...> worksetFaceOrds,
972 const shards::CellTopology parentCell );
1016 template<
typename physPointValueType,
class ...physPointProperties,
1017 typename refPointValueType,
class ...refPointProperties,
1018 typename WorksetType,
1019 typename HGradBasisPtrType>
1021 mapToPhysicalFrame( Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1022 const Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1023 const WorksetType worksetCell,
1024 const HGradBasisPtrType basis );
1066 template<
typename physPointValueType,
class ...physPointProperties,
1067 typename refPointValueType,
class ...refPointProperties,
1068 typename worksetCellValueType,
class ...worksetCellProperties>
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);
1132 template<
typename refSubcellPointValueType,
class ...refSubcellPointProperties,
1133 typename paramPointValueType,
class ...paramPointProperties>
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 );
1192 template<
typename refPointValueType,
class ...refPointProperties,
1193 typename physPointValueType,
class ...physPointProperties,
1194 typename worksetCellValueType,
class ...worksetCellProperties>
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 );
1227 template<
typename refPointValueType,
class ...refPointProperties,
1228 typename initGuessValueType,
class ...initGuessProperties,
1229 typename physPointValueType,
class ...physPointProperties,
1230 typename worksetCellValueType,
class ...worksetCellProperties,
1231 typename HGradBasisPtrType>
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 );
1270 template<
typename refPointValueType,
class ...refPointProperties,
1271 typename initGuessValueType,
class ...initGuessProperties,
1272 typename physPointValueType,
class ...physPointProperties,
1273 typename worksetCellValueType,
class ...worksetCellProperties>
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);
1368 template<
typename subcvCoordValueType,
class ...subcvCoordProperties,
1369 typename cellCoordValueType,
class ...cellCoordProperties>
1371 getSubcvCoords( Kokkos::DynRankView<subcvCoordValueType,subcvCoordProperties...> subcvCoords,
1372 const Kokkos::DynRankView<cellCoordValueType,cellCoordProperties...> cellCoords,
1373 const shards::CellTopology primaryCell );
1390 template<
typename pointValueType,
class ...pointProperties>
1393 const shards::CellTopology cellTopo,
1394 const double thres = threshold() );
1429 template<
typename inCellValueType,
class ...inCellProperties,
1430 typename pointValueType,
class ...pointProperties>
1432 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1433 const shards::CellTopology cellTopo,
1434 const double thres = threshold() );
1457 template<
typename inCellValueType,
class ...inCellProperties,
1458 typename pointValueType,
class ...pointProperties,
1459 typename cellWorksetValueType,
class ...cellWorksetProperties>
1461 const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1462 const Kokkos::DynRankView<cellWorksetValueType,cellWorksetProperties...> cellWorkset,
1463 const shards::CellTopology cellTopo,
1464 const double thres = threshold() );
1509 template<
typename jacobianViewType,
1510 typename PointViewType,
1511 typename worksetCellViewType>
1514 const PointViewType points,
1515 const worksetCellViewType worksetCell,
1516 const shards::CellTopology cellTopo );
1522 template<
typename jacobianInvViewType,
1523 typename jacobianViewType>
1526 const jacobianViewType jacobian );
1533 template<
typename jacobianDetViewType,
1534 typename jacobianViewType>
1537 const jacobianViewType jacobian );
1546 template<
typename physPointViewType,
1547 typename refPointViewType,
1548 typename worksetCellViewType>
1551 const refPointViewType refPoints,
1552 const worksetCellViewType worksetCell,
1553 const shards::CellTopology cellTopo );
1562 template<
typename refPointViewType,
1563 typename physPointViewType,
1564 typename worksetCellViewType>
1567 const physPointViewType physPoints,
1568 const worksetCellViewType worksetCell,
1569 const shards::CellTopology cellTopo );
1580 template<
typename refPointViewType,
1581 typename initGuessViewType,
1582 typename physPointViewType,
1583 typename worksetCellViewType>
1586 const initGuessViewType initGuess,
1587 const physPointViewType physPoints,
1588 const worksetCellViewType worksetCell,
1589 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_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.