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 
68 
71 
74 
78 
81 
84 
87 
88 #include "Intrepid2_Data.hpp"
89 #include "Intrepid2_CellData.hpp"
90 
91 namespace Intrepid2 {
92 
93  //============================================================================================//
94  // //
95  // CellTools //
96  // //
97  //============================================================================================//
98 
109  template<typename DeviceType>
110  class CellTools {
111  using ExecSpaceType = typename DeviceType::execution_space;
112  using MemSpaceType = typename DeviceType::memory_space;
113  public:
114 
119  inline
120  static bool
121  hasReferenceCell( const shards::CellTopology cellTopo ) {
122  return RefSubcellParametrization<DeviceType>::isSupported(cellTopo.getKey());
123  }
124 
125  private:
126 
130  template<typename outputValueType,
131  typename pointValueType>
132  static Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> >
133  createHGradBasis( const shards::CellTopology cellTopo ) {
134  Teuchos::RCP<Basis<DeviceType,outputValueType,pointValueType> > r_val;
135 
136  switch (cellTopo.getKey()) {
137  case shards::Line<2>::key: r_val = Teuchos::rcp(new Basis_HGRAD_LINE_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
138  case shards::Line<3>::key: r_val = Teuchos::rcp(new Basis_HGRAD_LINE_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
139  case shards::Triangle<3>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TRI_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
140  case shards::Quadrilateral<4>::key: r_val = Teuchos::rcp(new Basis_HGRAD_QUAD_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
141  case shards::Tetrahedron<4>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TET_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
142  case shards::Hexahedron<8>::key: r_val = Teuchos::rcp(new Basis_HGRAD_HEX_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
143  case shards::Wedge<6>::key: r_val = Teuchos::rcp(new Basis_HGRAD_WEDGE_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
144  case shards::Pyramid<5>::key: r_val = Teuchos::rcp(new Basis_HGRAD_PYR_C1_FEM <DeviceType,outputValueType,pointValueType>()); break;
145 
146  case shards::Triangle<6>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TRI_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
147  case shards::Quadrilateral<8>::key: r_val = Teuchos::rcp(new Basis_HGRAD_QUAD_I2_FEM <DeviceType,outputValueType,pointValueType>()); break;
148  case shards::Quadrilateral<9>::key: r_val = Teuchos::rcp(new Basis_HGRAD_QUAD_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
149  case shards::Tetrahedron<10>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TET_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
150  case shards::Tetrahedron<11>::key: r_val = Teuchos::rcp(new Basis_HGRAD_TET_COMP12_FEM<DeviceType,outputValueType,pointValueType>()); break;
151  case shards::Hexahedron<20>::key: r_val = Teuchos::rcp(new Basis_HGRAD_HEX_I2_FEM <DeviceType,outputValueType,pointValueType>()); break;
152  case shards::Hexahedron<27>::key: r_val = Teuchos::rcp(new Basis_HGRAD_HEX_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
153  case shards::Wedge<15>::key: r_val = Teuchos::rcp(new Basis_HGRAD_WEDGE_I2_FEM <DeviceType,outputValueType,pointValueType>()); break;
154  case shards::Wedge<18>::key: r_val = Teuchos::rcp(new Basis_HGRAD_WEDGE_C2_FEM <DeviceType,outputValueType,pointValueType>()); break;
155  case shards::Pyramid<13>::key: r_val = Teuchos::rcp(new Basis_HGRAD_PYR_I2_FEM <DeviceType,outputValueType,pointValueType>()); break;
156 
157  case shards::Beam<2>::key:
158  case shards::Beam<3>::key:
159  case shards::ShellLine<2>::key:
160  case shards::ShellLine<3>::key:
161  case shards::ShellTriangle<3>::key:
162  case shards::ShellTriangle<6>::key:
163  case shards::ShellQuadrilateral<4>::key:
164  case shards::ShellQuadrilateral<8>::key:
165  case shards::ShellQuadrilateral<9>::key:
166  default: {
167  INTREPID2_TEST_FOR_EXCEPTION( true, std::invalid_argument,
168  ">>> ERROR (Intrepid2::CellTools::createHGradBasis): Cell topology not supported.");
169  }
170  }
171  return r_val;
172  }
173 
174 public:
175 
178  CellTools() = default;
179 
182  ~CellTools() = default;
183 
184  //============================================================================================//
185  // //
186  // Jacobian, inverse Jacobian and Jacobian determinant //
187  // //
188  //============================================================================================//
189 
225  template<typename JacobianViewType,
226  typename PointViewType,
227  typename WorksetType,
228  typename HGradBasisType>
229  static void
230  setJacobian( JacobianViewType jacobian,
231  const PointViewType points,
232  const WorksetType worksetCell,
233  const Teuchos::RCP<HGradBasisType> basis,
234  const int startCell=0, const int endCell=-1);
235 
270  template<typename JacobianViewType,
271  typename BasisGradientsType,
272  typename WorksetType>
273  static void
274  setJacobian( JacobianViewType jacobian,
275  const WorksetType worksetCell,
276  const BasisGradientsType gradients,
277  const int startCell=0, const int endCell=-1);
278 
313  template<typename JacobianViewType,
314  typename PointViewType,
315  typename WorksetCellViewType>
316  static void
317  setJacobian( JacobianViewType jacobian,
318  const PointViewType points,
319  const WorksetCellViewType worksetCell,
320  const shards::CellTopology cellTopo ) {
321  using nonConstPointValueType = typename PointViewType::non_const_value_type;
322  auto basis = createHGradBasis<nonConstPointValueType,nonConstPointValueType>(cellTopo);
323  setJacobian(jacobian,
324  points,
325  worksetCell,
326  basis);
327  }
328 
339  template<typename JacobianInvViewType,
340  typename JacobianViewType>
341  static void
342  setJacobianInv( JacobianInvViewType jacobianInv,
343  const JacobianViewType jacobian );
344 
355  template<typename JacobianDetViewType,
356  typename JacobianViewType>
357  static void
358  setJacobianDet( JacobianDetViewType jacobianDet,
359  const JacobianViewType jacobian );
360 
366  template<class PointScalar>
368 
374  template<class PointScalar>
376 
382  template<class PointScalar>
383  static void setJacobianDet( Data<PointScalar,DeviceType> & jacobianDet,
384  const Data<PointScalar,DeviceType> & jacobian);
385 
391  template<class PointScalar>
392  static void setJacobianDetInv( Data<PointScalar,DeviceType> & jacobianDet,
393  const Data<PointScalar,DeviceType> & jacobian);
394 
400  template<class PointScalar>
401  static void setJacobianInv( Data<PointScalar,DeviceType> & jacobianInv,
402  const Data<PointScalar,DeviceType> & jacobian);
403 
410  template<class PointScalar>
411  static void setJacobianDividedByDet( Data<PointScalar,DeviceType> & jacobianDividedByDet,
412  const Data<PointScalar,DeviceType> & jacobian,
413  const Data<PointScalar,DeviceType> & jacobianDetInv);
414 
415  //============================================================================================//
416  // //
417  // Node information //
418  // //
419  //============================================================================================//
420 
421  // the node information can be used inside of kokkos functor and needs kokkos inline and
422  // exception should be an abort. for now, let's not decorate
423 
431  template<typename cellCenterValueType, class ...cellCenterProperties>
432  static void
433  getReferenceCellCenter( Kokkos::DynRankView<cellCenterValueType,cellCenterProperties...> cellCenter,
434  const shards::CellTopology cell );
435 
444  template<typename cellVertexValueType, class ...cellVertexProperties>
445  static void
446  getReferenceVertex( Kokkos::DynRankView<cellVertexValueType,cellVertexProperties...> cellVertex,
447  const shards::CellTopology cell,
448  const ordinal_type vertexOrd );
449 
450 
465  template<typename subcellVertexValueType, class ...subcellVertexProperties>
466  static void
467  getReferenceSubcellVertices( Kokkos::DynRankView<subcellVertexValueType,subcellVertexProperties...> subcellVertices,
468  const ordinal_type subcellDim,
469  const ordinal_type subcellOrd,
470  const shards::CellTopology parentCell );
471 
472 
473 
489  template<typename cellNodeValueType, class ...cellNodeProperties>
490  static void
491  getReferenceNode( Kokkos::DynRankView<cellNodeValueType,cellNodeProperties...> cellNode,
492  const shards::CellTopology cell,
493  const ordinal_type nodeOrd );
494 
495 
496 
510  template<typename SubcellNodeViewType>
511  static void
512  getReferenceSubcellNodes( SubcellNodeViewType subcellNodes,
513  const ordinal_type subcellDim,
514  const ordinal_type subcellOrd,
515  const shards::CellTopology parentCell );
516 
542  template<typename RefEdgeTangentViewType>
543  static void
544  getReferenceEdgeTangent( RefEdgeTangentViewType refEdgeTangent,
545  const ordinal_type edgeOrd,
546  const shards::CellTopology parentCell );
547 
584  template<typename RefFaceTanViewType>
585  static void
586  getReferenceFaceTangents( RefFaceTanViewType refFaceTanU,
587  RefFaceTanViewType refFaceTanV,
588  const ordinal_type faceOrd,
589  const shards::CellTopology parentCell );
590 
653  template<typename RefSideNormalViewType>
654  static void
655  getReferenceSideNormal( RefSideNormalViewType refSideNormal,
656  const ordinal_type sideOrd,
657  const shards::CellTopology parentCell );
658 
697  template<typename RefFaceNormalViewType>
698  static void
699  getReferenceFaceNormal( RefFaceNormalViewType refFaceNormal,
700  const ordinal_type faceOrd,
701  const shards::CellTopology parentCell );
702 
732  template<typename edgeTangentValueType, class ...edgeTangentProperties,
733  typename worksetJacobianValueType, class ...worksetJacobianProperties>
734  static void
735  getPhysicalEdgeTangents( Kokkos::DynRankView<edgeTangentValueType,edgeTangentProperties...> edgeTangents,
736  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
737  const ordinal_type worksetEdgeOrd,
738  const shards::CellTopology parentCell );
739 
740 
752  template<typename edgeTangentValueType, class ...edgeTangentProperties,
753  typename worksetJacobianValueType, class ...worksetJacobianProperties,
754  typename edgeOrdValueType, class ...edgeOrdProperties>
755  static void
756  getPhysicalEdgeTangents( Kokkos::DynRankView<edgeTangentValueType,edgeTangentProperties...> edgeTangents,
757  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
758  const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetEdgeOrds,
759  const shards::CellTopology parentCell );
760 
800  template<typename faceTanValueType, class ...faceTanProperties,
801  typename worksetJacobianValueType, class ...worksetJacobianProperties>
802  static void
803  getPhysicalFaceTangents( Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanU,
804  Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanV,
805  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
806  const ordinal_type worksetFaceOrd,
807  const shards::CellTopology parentCell );
808 
809 
822  template<typename faceTanValueType, class ...faceTanProperties,
823  typename worksetJacobianValueType, class ...worksetJacobianProperties,
824  typename faceOrdValueType, class ...faceOrdProperties>
825  static void
826  getPhysicalFaceTangents( Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanU,
827  Kokkos::DynRankView<faceTanValueType,faceTanProperties...> faceTanV,
828  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
829  const Kokkos::DynRankView<faceOrdValueType,faceOrdProperties...> worksetFaceOrds,
830  const shards::CellTopology parentCell );
831 
832 
833 
894  template<typename sideNormalValueType, class ...sideNormalProperties,
895  typename worksetJacobianValueType, class ...worksetJacobianProperties>
896  static void
897  getPhysicalSideNormals( Kokkos::DynRankView<sideNormalValueType,sideNormalProperties...> sideNormals,
898  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
899  const ordinal_type worksetSideOrd,
900  const shards::CellTopology parentCell );
901 
902 
913  template<typename sideNormalValueType, class ...sideNormalProperties,
914  typename worksetJacobianValueType, class ...worksetJacobianProperties,
915  typename edgeOrdValueType, class ...edgeOrdProperties>
916  static void
917  getPhysicalSideNormals( Kokkos::DynRankView<sideNormalValueType,sideNormalProperties...> sideNormals,
918  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
919  const Kokkos::DynRankView<edgeOrdValueType,edgeOrdProperties...> worksetSideOrds,
920  const shards::CellTopology parentCell );
921 
960  template<typename faceNormalValueType, class ...faceNormalProperties,
961  typename worksetJacobianValueType, class ...worksetJacobianProperties>
962  static void
963  getPhysicalFaceNormals( Kokkos::DynRankView<faceNormalValueType,faceNormalProperties...> faceNormals,
964  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
965  const ordinal_type worksetFaceOrd,
966  const shards::CellTopology parentCell );
967 
968 
980  template<typename faceNormalValueType, class ...faceNormalProperties,
981  typename worksetJacobianValueType, class ...worksetJacobianProperties,
982  typename faceOrdValueType, class ...faceOrdProperties>
983  static void
984  getPhysicalFaceNormals( Kokkos::DynRankView<faceNormalValueType,faceNormalProperties...> faceNormals,
985  const Kokkos::DynRankView<worksetJacobianValueType,worksetJacobianProperties...> worksetJacobians,
986  const Kokkos::DynRankView<faceOrdValueType,faceOrdProperties...> worksetFaceOrds,
987  const shards::CellTopology parentCell );
988 
989  //============================================================================================//
990  // //
991  // Reference-to-physical frame mapping and its inverse //
992  // //
993  //============================================================================================//
994 
1031  template<typename PhysPointValueType,
1032  typename RefPointValueType,
1033  typename WorksetType,
1034  typename HGradBasisPtrType>
1035  static void
1036  mapToPhysicalFrame( PhysPointValueType physPoints,
1037  const RefPointValueType refPoints,
1038  const WorksetType worksetCell,
1039  const HGradBasisPtrType basis );
1040 
1081  template<typename PhysPointViewType,
1082  typename RefPointViewType,
1083  typename WorksetCellViewType>
1084  static void
1085  mapToPhysicalFrame( PhysPointViewType physPoints,
1086  const RefPointViewType refPoints,
1087  const WorksetCellViewType worksetCell,
1088  const shards::CellTopology cellTopo ) {
1089  using nonConstRefPointValueType = typename RefPointViewType::non_const_value_type;
1090  auto basis = createHGradBasis<nonConstRefPointValueType,nonConstRefPointValueType>(cellTopo);
1091  mapToPhysicalFrame(physPoints,
1092  refPoints,
1093  worksetCell,
1094  basis);
1095  }
1096 
1097 
1148  template<typename refSubcellViewType,
1149  typename paramPointViewType>
1150  static void
1151  mapToReferenceSubcell( refSubcellViewType refSubcellPoints,
1152  const paramPointViewType paramPoints,
1153  const ordinal_type subcellDim,
1154  const ordinal_type subcellOrd,
1155  const shards::CellTopology parentCell );
1156 
1157 
1164  template<typename refSubcellViewType, typename paramPointViewType>
1165  static void
1166  mapToReferenceSubcell( refSubcellViewType refSubcellPoints,
1167  const paramPointViewType paramPoints,
1168  const typename RefSubcellParametrization<DeviceType>::ConstViewType subcellParametrization,
1169  const ordinal_type subcellOrd);
1170 
1176  template<typename refSubcellViewType, typename paramPointViewType, typename ordViewType>
1177  static void
1178  mapToReferenceSubcell( refSubcellViewType refSubcellPoints,
1179  const paramPointViewType paramPoints,
1180  const typename RefSubcellParametrization<DeviceType>::ConstViewType subcellParametrization,
1181  const ordViewType subcellOrd);
1182 
1183 
1184  //============================================================================================//
1185  // //
1186  // Physical-to-reference frame mapping and its inverse //
1187  // //
1188  //============================================================================================//
1189 
1190 
1234  template<typename refPointValueType, class ...refPointProperties,
1235  typename physPointValueType, class ...physPointProperties,
1236  typename worksetCellValueType, class ...worksetCellProperties>
1237  static void
1238  mapToReferenceFrame( Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1239  const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1240  const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1241  const shards::CellTopology cellTopo );
1242 
1269  template<typename refPointValueType, class ...refPointProperties,
1270  typename initGuessValueType, class ...initGuessProperties,
1271  typename physPointValueType, class ...physPointProperties,
1272  typename worksetCellValueType, class ...worksetCellProperties,
1273  typename HGradBasisPtrType>
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 HGradBasisPtrType basis );
1280 
1281 
1312  template<typename refPointValueType, class ...refPointProperties,
1313  typename initGuessValueType, class ...initGuessProperties,
1314  typename physPointValueType, class ...physPointProperties,
1315  typename worksetCellValueType, class ...worksetCellProperties>
1316  static void
1317  mapToReferenceFrameInitGuess( Kokkos::DynRankView<refPointValueType,refPointProperties...> refPoints,
1318  const Kokkos::DynRankView<initGuessValueType,initGuessProperties...> initGuess,
1319  const Kokkos::DynRankView<physPointValueType,physPointProperties...> physPoints,
1320  const Kokkos::DynRankView<worksetCellValueType,worksetCellProperties...> worksetCell,
1321  const shards::CellTopology cellTopo ) {
1322  auto basis = createHGradBasis<refPointValueType,refPointValueType>(cellTopo);
1323  mapToReferenceFrameInitGuess(refPoints,
1324  initGuess,
1325  physPoints,
1326  worksetCell,
1327  basis);
1328  }
1329 
1330 
1331  //============================================================================================//
1332  // //
1333  // Control Volume Coordinates //
1334  // //
1335  //============================================================================================//
1336 
1410  template<typename subcvCoordValueType, class ...subcvCoordProperties,
1411  typename cellCoordValueType, class ...cellCoordProperties>
1412  static void
1413  getSubcvCoords( Kokkos::DynRankView<subcvCoordValueType,subcvCoordProperties...> subcvCoords,
1414  const Kokkos::DynRankView<cellCoordValueType,cellCoordProperties...> cellCoords,
1415  const shards::CellTopology primaryCell );
1416 
1417  //============================================================================================//
1418  // //
1419  // Inclusion tests //
1420  // //
1421  //============================================================================================//
1422 
1432  template<typename pointValueType, class ...pointProperties>
1433  static bool
1434  checkPointInclusion( const Kokkos::DynRankView<pointValueType,pointProperties...> point,
1435  const shards::CellTopology cellTopo,
1436  const double thres = threshold() );
1437 
1438  // template<class ArrayPoint>
1439  // static int checkPointsetInclusion(const ArrayPoint & points,
1440  // const shards::CellTopology & cellTopo,
1441  // const double & threshold = INTREPID2_THRESHOLD);
1442 
1443 
1444 
1471  template<typename inCellValueType, class ...inCellProperties,
1472  typename pointValueType, class ...pointProperties>
1473  static void checkPointwiseInclusion( Kokkos::DynRankView<inCellValueType,inCellProperties...> inCell,
1474  const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1475  const shards::CellTopology cellTopo,
1476  const double thres = threshold() );
1477 
1499  template<typename inCellValueType, class ...inCellProperties,
1500  typename pointValueType, class ...pointProperties,
1501  typename cellWorksetValueType, class ...cellWorksetProperties>
1502  static void checkPointwiseInclusion( Kokkos::DynRankView<inCellValueType,inCellProperties...> inCell,
1503  const Kokkos::DynRankView<pointValueType,pointProperties...> points,
1504  const Kokkos::DynRankView<cellWorksetValueType,cellWorksetProperties...> cellWorkset,
1505  const shards::CellTopology cellTopo,
1506  const double thres = threshold() );
1507 
1508 
1509  // //============================================================================================//
1510  // // //
1511  // // Debug //
1512  // // //
1513  // //============================================================================================//
1514 
1515 
1516  // /** \brief Prints the reference space coordinates of the vertices of the specified subcell
1517  // \param subcellDim [in] - dimension of the subcell where points are mapped to
1518  // \param subcellOrd [in] - subcell ordinal
1519  // \param parentCell [in] - cell topology of the parent cell.
1520  // */
1521  // static void printSubcellVertices(const int subcellDim,
1522  // const int subcellOrd,
1523  // const shards::CellTopology & parentCell);
1524 
1525 
1526 
1527  // /** \brief Prints the nodes of a subcell from a cell workset
1528 
1529  // */
1530  // template<class ArrayCell>
1531  // static void printWorksetSubcell(const ArrayCell & cellWorkset,
1532  // const shards::CellTopology & parentCell,
1533  // const int& pCellOrd,
1534  // const int& subcellDim,
1535  // const int& subcellOrd,
1536  // const int& fieldWidth = 3);
1537  };
1538 
1539  //============================================================================================//
1540  // //
1541  // Validation of input/output arguments for CellTools methods //
1542  // //
1543  //============================================================================================//
1544 
1551  template<typename jacobianViewType,
1552  typename PointViewType,
1553  typename worksetCellViewType>
1554  static void
1555  CellTools_setJacobianArgs( const jacobianViewType jacobian,
1556  const PointViewType points,
1557  const worksetCellViewType worksetCell,
1558  const shards::CellTopology cellTopo );
1559 
1564  template<typename jacobianInvViewType,
1565  typename jacobianViewType>
1566  static void
1567  CellTools_setJacobianInvArgs( const jacobianInvViewType jacobianInv,
1568  const jacobianViewType jacobian );
1569 
1570 
1575  template<typename jacobianDetViewType,
1576  typename jacobianViewType>
1577  static void
1578  CellTools_setJacobianDetArgs( const jacobianDetViewType jacobianDet,
1579  const jacobianViewType jacobian );
1580 
1581 
1588  template<typename physPointViewType,
1589  typename refPointViewType,
1590  typename worksetCellViewType>
1591  static void
1592  CellTools_mapToPhysicalFrameArgs( const physPointViewType physPoints,
1593  const refPointViewType refPoints,
1594  const worksetCellViewType worksetCell,
1595  const shards::CellTopology cellTopo );
1596 
1597 
1604  template<typename refPointViewType,
1605  typename physPointViewType,
1606  typename worksetCellViewType>
1607  static void
1608  CellTools_mapToReferenceFrameArgs( const refPointViewType refPoints,
1609  const physPointViewType physPoints,
1610  const worksetCellViewType worksetCell,
1611  const shards::CellTopology cellTopo );
1612 
1613 
1614 
1622  template<typename refPointViewType,
1623  typename initGuessViewType,
1624  typename physPointViewType,
1625  typename worksetCellViewType>
1626  static void
1627  CellTools_mapToReferenceFrameInitGuess( const refPointViewType refPoints,
1628  const initGuessViewType initGuess,
1629  const physPointViewType physPoints,
1630  const worksetCellViewType worksetCell,
1631  const shards::CellTopology cellTopo );
1632 
1633  // /** \brief Validates arguments to Intrepid2::CellTools::checkPointwiseInclusion
1634  // \param inCell [out] - rank-1 (P) array required
1635  // \param physPoints [in] - rank-2 (P,D) array required
1636  // \param cellWorkset [in] - rank-3 (C,N,D) array required
1637  // \param whichCell [in] - 0 <= whichCell < C required
1638  // \param cellTopo [in] - cell topology with a reference cell required
1639  // */
1640  // template<class ArrayIncl, class ArrayPoint, class ArrayCell>
1641  // static void
1642  // validateArguments_checkPointwiseInclusion(ArrayIncl & inCell,
1643  // const ArrayPoint & physPoints,
1644  // const ArrayCell & cellWorkset,
1645  // const int & whichCell,
1646  // const shards::CellTopology & cell);
1647 
1648 
1649 
1650 }
1651 
1653 
1656 
1660 
1662 
1663 // not yet converted ...
1665 
1666 // #include "Intrepid2_CellToolsDefDebug.hpp"
1667 
1668 
1669 #endif
1670 
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Quadrilateral cell...
Definition file for the reference to physical mappings in the Intrepid2::CellTools class...
Header file for the Intrepid2::Basis_HGRAD_TRI_C1_FEM class.
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Wedge cell.
static void mapToPhysicalFrame(PhysPointViewType physPoints, const RefPointViewType refPoints, const WorksetCellViewType worksetCell, const shards::CellTopology cellTopo)
Computes F, the reference-to-physical frame map.
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 .
Implementation of an H(grad)-compatible FEM basis of degree 2 on a Pyramid cell.
Header file for the Intrepid2::Basis_HGRAD_PYR_I2_FEM class.
Header file for the Intrepid2::Basis_HGRAD_QUAD_C1_FEM class.
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...
Header file for the Intrepid2::Basis_HGRAD_QUAD_C2_FEM class.
Definition file for the control volume functions of the Intrepid2::CellTools class.
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Triangle cell...
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Pyramid cell...
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.
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Hexahedron cell...
static void getReferenceCellCenter(Kokkos::DynRankView< cellCenterValueType, cellCenterProperties...> cellCenter, const shards::CellTopology cell)
Computes the Cartesian coordinates of reference cell barycenter.
Header file for the Intrepid2::Basis_HGRAD_HEX_C2_FEM class.
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_PYR_C1_FEM class.
A stateless class for operations on cell data. Provides methods for:
Header file for the Intrepid2::Basis_HGRAD_LINE_C2_FEM class.
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Triangle cell...
Header file for the Intrepid2::Basis_HGRAD_TRI_C2_FEM class.
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...
Header file for the Intrepid2::Basis_HGRAD_WEDGE_C2_FEM class.
Definition file for point inclusion functions of the Intrepid2::CellTools class.
Wrapper around a Kokkos::View that allows data that is constant or repeating in various logical dimen...
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Line cell.
CellTools()=default
Default constructor.
Header function for Intrepid2::Util class and other utility functions.
Header file for the Intrepid2::Basis_HGRAD_WEDGE_C1_FEM class.
static void setJacobianDet(JacobianDetViewType jacobianDet, const JacobianViewType jacobian)
Computes the determinant of the Jacobian matrix DF of the reference-to-physical frame map F...
Header file for the Intrepid2::Basis_HGRAD_TET_C2_FEM class.
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Wedge cell.
Header file for the classes: Intrepid2::RefSubcellParametrization, Intrepid2::RefCellNodes, Intrepid2::RefCellCenter.
Header file for the Intrepid2::Basis_HGRAD_HEX_C1_FEM class.
static void getReferenceEdgeTangent(RefEdgeTangentViewType refEdgeTangent, const ordinal_type edgeOrd, const shards::CellTopology parentCell)
Computes constant tangent vectors to edges of 2D or 3D reference cells.
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 void setJacobianDetInv(Data< PointScalar, DeviceType > &jacobianDet, const Data< PointScalar, DeviceType > &jacobian)
Computes reciprocals of determinants corresponding to the Jacobians in the Data container provided...
Definition file for the validate arguments functions of the Intrepid2::CellTools class.
Definition file for the physical to reference mappings in the Intrepid2::CellTools class...
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 bool isSupported(const unsigned cellTopoKey)
Checks if a cell topology has a reference parametrization.
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 > allocateJacobianInv(const Data< PointScalar, DeviceType > &jacobian)
Allocates and returns a Data container suitable for storing inverses corresponding to the Jacobians i...
static void getReferenceSideNormal(RefSideNormalViewType refSideNormal, const ordinal_type sideOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to sides of 2D or 3D reference cells.
~CellTools()=default
Destructor.
static void setJacobian(JacobianViewType jacobian, const PointViewType points, const WorksetCellViewType worksetCell, const shards::CellTopology cellTopo)
Computes the Jacobian matrix DF of the reference-to-physical frame map F.
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...
Definition file for the Jacobian functions in the Intrepid2::CellTools class.
static void getReferenceFaceNormal(RefFaceNormalViewType refFaceNormal, const ordinal_type faceOrd, const shards::CellTopology parentCell)
Computes constant normal vectors to faces of 3D reference cell.
Definition file for node data and subcell functions of the Intrepid2::CellTools class.
Header file for the Intrepid2::Basis_HGRAD_TET_C1_FEM class.
Contains definitions of custom data types in Intrepid2.
static void setJacobian(JacobianViewType jacobian, const PointViewType 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.
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Quadrilateral cell...
Header file with additional documentation for the Intrepid2::CellTools class.
Header file for the Intrepid2::Basis_HGRAD_LINE_C1_FEM class.
static void setJacobianInv(JacobianInvViewType jacobianInv, const JacobianViewType jacobian)
Computes the inverse of the Jacobian matrix DF of the reference-to-physical frame map F...
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.
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Tetrahedron cell...
Implementation of the default H(grad)-compatible FEM basis of degree 2 on Tetrahedron cell...
static void mapToReferenceSubcell(refSubcellViewType refSubcellPoints, const paramPointViewType paramPoints, const ordinal_type subcellDim, const ordinal_type subcellOrd, const shards::CellTopology parentCell)
Computes parameterization maps of 1- and 2-subcells of reference cells.
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 setJacobianDividedByDet(Data< PointScalar, DeviceType > &jacobianDividedByDet, const Data< PointScalar, DeviceType > &jacobian, const Data< PointScalar, DeviceType > &jacobianDetInv)
Multiplies the Jacobian with shape (C,P,D,D) by the reciprocals of the determinants, with shape (C,P), entrywise.
Header file for the Intrepid2::Basis_HGRAD_TET_COMP12_FEM class.
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Line 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.
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Tetrahedron cell...
Header file for Intrepid2::RealSpaceTools class providing basic linear algebra functionality in 1D...
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 Teuchos::RCP< Basis< DeviceType, outputValueType, pointValueType > > createHGradBasis(const shards::CellTopology cellTopo)
Generates default HGrad basis based on cell topology.
static bool hasReferenceCell(const shards::CellTopology cellTopo)
Checks if a cell topology has reference cell.
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 getReferenceSubcellNodes(SubcellNodeViewType 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 mapToPhysicalFrame(PhysPointValueType physPoints, const RefPointValueType refPoints, const WorksetType worksetCell, const HGradBasisPtrType basis)
Computes F, the reference-to-physical frame map.
Implementation of the default H(grad)-compatible FEM basis of degree 1 on Hexahedron cell...
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 ...
Header file for the abstract base class Intrepid2::Basis.
static void getReferenceFaceTangents(RefFaceTanViewType refFaceTanU, RefFaceTanViewType refFaceTanV, const ordinal_type faceOrd, const shards::CellTopology parentCell)
Computes pairs of constant tangent vectors to faces of a 3D reference cells.