From 5cd8597a77e0cdc991e22b6fefb08fe6180e6c75 Mon Sep 17 00:00:00 2001 From: Mauro Perego Date: Fri, 21 Jun 2019 16:48:50 -0600 Subject: [PATCH 1/4] Intrepid2: Lagrangian Interpolation, loop over cells using parallel_for --- .../src/Cell/Intrepid2_CellTools.hpp | 39 +- .../Cell/Intrepid2_CellToolsDefNodeInfo.hpp | 8 +- .../Intrepid2_OrientationTools.hpp | 2 +- ...trepid2_OrientationToolsDefModifyBasis.hpp | 1 - ...repid2_OrientationToolsDefModifyPoints.hpp | 2 +- .../Intrepid2_LagrangianInterpolationDef.hpp | 585 +++++++++++++----- 6 files changed, 461 insertions(+), 176 deletions(-) diff --git a/packages/intrepid2/src/Cell/Intrepid2_CellTools.hpp b/packages/intrepid2/src/Cell/Intrepid2_CellTools.hpp index dcca7b849c1d..6ae3423d3bf3 100644 --- a/packages/intrepid2/src/Cell/Intrepid2_CellTools.hpp +++ b/packages/intrepid2/src/Cell/Intrepid2_CellTools.hpp @@ -301,24 +301,6 @@ namespace Intrepid2 { */ static void setSubcellParametrization(); - /** \brief Returns array with the coefficients of the parametrization maps for the edges or faces - of a reference cell topology. - - See Intrepid2::CellTools::setSubcellParametrization and Section \ref sec_cell_topology_subcell_map - more information about parametrization maps. - - \param subcellParam [out] - coefficients of the parameterization map for all subcells of - the specified dimension - \param subcellDim [in] - dimension of subcells whose parametrization map is returned - \param parentCell [in] - topology of the reference cell owning the subcells - - */ - static void - getSubcellParametrization( subcellParamViewType &subcellParam, - const ordinal_type subcellDim, - const shards::CellTopology parentCell ); - - /** \brief Sets orientation-preserving parametrizations of reference edges and faces of cell topologies with reference cells. Used to populate Intrepid2::CellTools::SubcellParamData. @@ -1078,6 +1060,27 @@ namespace Intrepid2 { basis); } + + + + /** \brief Returns array with the coefficients of the parametrization maps for the edges or faces + of a reference cell topology. + + See Intrepid2::CellTools::setSubcellParametrization and Section \ref sec_cell_topology_subcell_map + more information about parametrization maps. + + \param subcellParam [out] - coefficients of the parameterization map for all subcells of + the specified dimension + \param subcellDim [in] - dimension of subcells whose parametrization map is returned + \param parentCell [in] - topology of the reference cell owning the subcells + + */ + static void + getSubcellParametrization( subcellParamViewType &subcellParam, + const ordinal_type subcellDim, + const shards::CellTopology parentCell ); + + /** \brief Computes parameterization maps of 1- and 2-subcells of reference cells. Applies \f$\hat{\Phi}_i\f$, the parametrization map of a subcell \f$\hat{\mathcal{S}}_i\f$ diff --git a/packages/intrepid2/src/Cell/Intrepid2_CellToolsDefNodeInfo.hpp b/packages/intrepid2/src/Cell/Intrepid2_CellToolsDefNodeInfo.hpp index b0f24222ce6a..a6a2959f0658 100644 --- a/packages/intrepid2/src/Cell/Intrepid2_CellToolsDefNodeInfo.hpp +++ b/packages/intrepid2/src/Cell/Intrepid2_CellToolsDefNodeInfo.hpp @@ -394,17 +394,17 @@ namespace Intrepid2 { #ifdef HAVE_INTREPID2_DEBUG INTREPID2_TEST_FOR_EXCEPTION( parentCell.getDimension() != 2 && parentCell.getDimension() != 3, std::invalid_argument, - ">>> ERROR (Intrepid2::CellTools::getReferenceFaceTangents): two or three-dimensional parent cell required"); + ">>> ERROR (Intrepid2::CellTools::getReferenceEdgeTangent): two or three-dimensional parent cell required"); INTREPID2_TEST_FOR_EXCEPTION( refEdgeTangent.rank() != 1, std::invalid_argument, - ">>> ERROR (Intrepid2::CellTools::getReferenceFaceTangents): rank = 1 required for output arrays"); + ">>> ERROR (Intrepid2::CellTools::getReferenceEdgeTangent): rank = 1 required for output arrays"); INTREPID2_TEST_FOR_EXCEPTION( refEdgeTangent.extent(0) != parentCell.getDimension(), std::invalid_argument, - ">>> ERROR (Intrepid2::CellTools::getReferenceFaceTangents): output array size is required to match space dimension"); + ">>> ERROR (Intrepid2::CellTools::getReferenceEdgeTangent): output array size is required to match space dimension"); INTREPID2_TEST_FOR_EXCEPTION( edgeOrd < 0 || edgeOrd >= static_cast(parentCell.getSubcellCount(1)), std::invalid_argument, - ">>> ERROR (Intrepid2::CellTools::getReferenceFaceTangents): edge ordinal out of bounds"); + ">>> ERROR (Intrepid2::CellTools::getReferenceEdgeTangent): edge ordinal out of bounds"); #endif // Edge parametrizations are computed in setSubcellParametrization and stored in rank-3 array diff --git a/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp b/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp index 2f1cec532aea..91292284e9e3 100644 --- a/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp +++ b/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp @@ -188,7 +188,7 @@ namespace Intrepid2 { */ template - inline + KOKKOS_INLINE_FUNCTION static void mapToModifiedReference(outPointViewType outPoints, const refPointViewType refPoints, diff --git a/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyBasis.hpp b/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyBasis.hpp index eaf9a57677ee..ecf9ca852eb8 100644 --- a/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyBasis.hpp +++ b/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyBasis.hpp @@ -286,7 +286,6 @@ namespace Intrepid2 { ">>> ERROR (OrientationTools::modifyBasisByOrientation): Field dimension of input/output does not match to basis cardinality."); } #endif - typedef typename decltype(input)::non_const_value_type input_value_type; if (basis->requireOrientation()) { auto ordinalToTag = Kokkos::create_mirror_view(typename SpT::memory_space(), basis->getAllDofTags()); diff --git a/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp b/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp index 1e16bc7075be..7c5481d6fe1e 100644 --- a/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp +++ b/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp @@ -274,7 +274,7 @@ namespace Intrepid2 { template - inline + KOKKOS_INLINE_FUNCTION void OrientationTools:: mapToModifiedReference(outPointViewType outPoints, diff --git a/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp b/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp index e67e33596c85..263090c8e62e 100644 --- a/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp +++ b/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp @@ -56,6 +56,213 @@ namespace Intrepid2 { namespace Experimental { + + +template +struct F_computeDofCoordsAdCoeff { + typedef typename scalarViewType::value_type value_type; + + scalarViewType dofCoords, dofCoeffs; + const ortViewType orts; + const t2oViewType tagToOrdinal; + const subcellParamViewType edgeParam, faceParam; + const intViewType edgeInternalDofOrdinals, facesInternalDofOrdinals; + const scalarViewType edgeInternalDofCoords, edgeDofCoeffs, ortJacobianEdge, refEdgesTan, refEdgesNormal; + const scalarViewType facesInternalDofCoords, faceDofCoeffs, ortJacobianFace, refFaceTangents, refFacesNormal; + scalarViewType edgeWorkView, faceWorkView; + const ordinal_type cellDim, numEdges, numFaces; + const ordinal_type edgeTopoKey, numEdgeInternalDofs; + const intViewType faceTopoKey, numFacesInternalDofs; + const value_type edgeScale, faceScale; + const bool isBasisHCURL, isBasisHDIV; + + F_computeDofCoordsAdCoeff( scalarViewType dofCoords_, + scalarViewType dofCoeffs_, + const ortViewType orts_, + const t2oViewType tagToOrdinal_, + const subcellParamViewType edgeParam_, + const subcellParamViewType faceParam_, + const intViewType edgeInternalDofOrdinals_, + const intViewType facesInternalDofOrdinals_, + const scalarViewType edgeInternalDofCoords_, + const scalarViewType edgeDofCoeffs_, + const scalarViewType refEdgesTan_, + const scalarViewType refEdgesNormal_, + const scalarViewType facesInternalDofCoords_, + const scalarViewType faceDofCoeffs_, + const scalarViewType refFaceTangents_, + const scalarViewType refFacesNormal_, + const ordinal_type cellDim_, + const ordinal_type numEdges_, + const ordinal_type numFaces_, + const ordinal_type edgeTopoKey_, + const ordinal_type numEdgeInternalDofs_, + const intViewType faceTopoKey_, + const intViewType numFacesInternalDofs_, + const value_type edgeScale_, + const value_type faceScale_, + const bool isBasisHCURL_, + const bool isBasisHDIV_ + ) + : dofCoords(dofCoords_), + dofCoeffs(dofCoeffs_), + orts(orts_), + tagToOrdinal(tagToOrdinal_), + edgeParam(edgeParam_), + faceParam(faceParam_), + edgeInternalDofOrdinals(edgeInternalDofOrdinals_), + facesInternalDofOrdinals(facesInternalDofOrdinals_), + edgeInternalDofCoords(edgeInternalDofCoords_), + edgeDofCoeffs(edgeDofCoeffs_), + refEdgesTan(refEdgesTan_), + refEdgesNormal(refEdgesNormal_), + facesInternalDofCoords(facesInternalDofCoords_), + faceDofCoeffs(faceDofCoeffs_), + refFaceTangents(refFaceTangents_), + refFacesNormal(refFacesNormal_), + cellDim(cellDim_), + numEdges(numEdges_), + numFaces(numFaces_), + edgeTopoKey(edgeTopoKey_), + numEdgeInternalDofs(numEdgeInternalDofs_), + faceTopoKey(faceTopoKey_), + numFacesInternalDofs(numFacesInternalDofs_), + edgeScale(edgeScale_), + faceScale(faceScale_), + isBasisHCURL(isBasisHCURL_), + isBasisHDIV(isBasisHDIV_) + { + if(numEdges > 0) + edgeWorkView = scalarViewType("edgeWorkView", dofCoords.extent(0), numEdgeInternalDofs, 1); + if(numFaces > 0) + faceWorkView = scalarViewType("faceWorkView", dofCoords.extent(0), facesInternalDofCoords.extent(1), 2); + } + + KOKKOS_INLINE_FUNCTION + void operator()(const ordinal_type cell) const { + typedef Kokkos::pair range_type; + + + if(numEdges > 0) { + ordinal_type eOrt[12]; + value_type ortJac; + scalarViewType ortJacobianEdge(&ortJac, 1, 1); + orts(cell).getEdgeOrientation(eOrt, numEdges); + auto edgeInternalDofCoordsOriented = Kokkos::subview(edgeWorkView,cell, Kokkos::ALL(), Kokkos::ALL()); + for (ordinal_type iedge=0; iedge < numEdges; ++iedge) { + Impl::OrientationTools::mapToModifiedReference(edgeInternalDofCoordsOriented,edgeInternalDofCoords,edgeTopoKey, eOrt[iedge]); + + for (ordinal_type j=0;j 0) { + ordinal_type fOrt[12]; + value_type ortJac[4]; + scalarViewType ortJacobianFace(ortJac, 2, 2); + orts(cell).getFaceOrientation(fOrt, numFaces); + for (ordinal_type iface=0; iface < numFaces; ++iface) { + ordinal_type ort = fOrt[iface]; + ordinal_type numInternalDofs = numFacesInternalDofs(iface); + auto dofRange = range_type(0, numInternalDofs); + auto faceInternalDofCoords = Kokkos::subview(facesInternalDofCoords, iface, dofRange, Kokkos::ALL()); + auto faceInternalDofCoordsOriented = Kokkos::subview(faceWorkView,cell, dofRange, Kokkos::ALL()); + Impl::OrientationTools::mapToModifiedReference(faceInternalDofCoordsOriented,faceInternalDofCoords,faceTopoKey(iface),ort); + + for (ordinal_type j=0;j template::getDofCoordsAndCoeffs( EPointType pointType, const Kokkos::DynRankView orts) { + typedef typename Kokkos::Impl::is_space::host_mirror_space::execution_space host_space_type; typedef typename BasisType::scalarType scalarType; typedef Kokkos::DynRankView scalarViewType; + typedef Kokkos::DynRankView scalarHostViewType; typedef Kokkos::DynRankView intViewType; + typedef Kokkos::pair range_type; const auto topo = basis->getBaseCellTopology(); const std::string name(basis->getName()); @@ -133,23 +343,13 @@ LagrangianInterpolation::getDofCoordsAndCoeffs( "method not implemented for this basis function"); } + auto tagToOrdinal = Kokkos::create_mirror_view(typename SpT::memory_space(), basis->getAllDofOrdinal()); + Kokkos::deep_copy(tagToOrdinal, basis->getAllDofOrdinal()); - auto ordinalToTag = basis->getAllDofTags(); - auto tagToOrdinal = basis->getAllDofOrdinal(); - - const ordinal_type dim = basis->getBaseCellTopology().getDimension(); + const ordinal_type dim = topo.getDimension(); const ordinal_type numCells = dofCoeffs.extent(0); - intViewType eOrt("eOrt", numEdges); - intViewType fOrt("fOrt", numFaces); - scalarViewType refEdgeTan("refEdgeTan", dim); - scalarViewType refFaceTangents("refFaceTangents", dim, 2); - auto refFaceTanU = Kokkos::subview(refFaceTangents, Kokkos::ALL, 0); - auto refFaceTanV = Kokkos::subview(refFaceTangents, Kokkos::ALL, 1); - scalarViewType refNormal("refNormal", dim); - - scalarViewType refDofCoords("refDofCoords", dofCoords.extent(1), dofCoords.extent(2)), refDofCoeffs; basis->getDofCoords(refDofCoords); RealSpaceTools::clone(dofCoords,refDofCoords); @@ -161,169 +361,252 @@ LagrangianInterpolation::getDofCoordsAndCoeffs( basis->getDofCoeffs(refDofCoeffs); RealSpaceTools::clone(dofCoeffs,refDofCoeffs); + //depending on how the reference basis is defined, the edges are scaled differently + auto edgeScale = (isBasisTriOrTet||isBasisI1) ? 2.0 :1.0; + ordinal_type edgeTopoKey = Teuchos::nonnull(edgeBasis) ? edgeBasis->getBaseCellTopology().getBaseKey() : 0; - //compute DofCoords Oriented - for (ordinal_type iedge=0; iedge < numEdges; ++iedge) { - scalarViewType ortJacobian("ortJacobian", 1, 1); - ordinal_type edgeBasisCardinality = edgeBasis->getCardinality(); - ordinal_type numInternalDofs = edgeBasis->getDofCount(1,0); - scalarViewType edgeDofCoords("edgeDofCoords", edgeBasisCardinality, 1); - scalarViewType edgeInternalDofCoords("edgeInternalDofCoords", numInternalDofs, 1); + intViewType eOrt("eOrt", numEdges); + scalarViewType refEdgesTan("refEdgesTan", numEdges, dim); + scalarViewType refEdgesNormal("refEdgesNormal", numEdges, dim); + scalarViewType edgeParam; + ordinal_type edgeBasisCardinality = Teuchos::nonnull(edgeBasis) ? edgeBasis->getCardinality() : ordinal_type(0); + ordinal_type numEdgeInternalDofs = Teuchos::nonnull(edgeBasis) ? edgeBasis->getDofCount(1,0) : ordinal_type(0); + scalarViewType edgeDofCoords("edgeDofCoords", edgeBasisCardinality, 1); + scalarViewType edgeDofCoeffs("edgeDofCoeffs", edgeBasisCardinality); + scalarViewType edgeInternalDofCoords("edgeInternalDofCoords", numEdgeInternalDofs, 1); + intViewType edgeInternalDofOrdinals("edgeInternalDofOrdinals", numEdgeInternalDofs); + + if(Teuchos::nonnull(edgeBasis)) { edgeBasis->getDofCoords(edgeDofCoords); - for(ordinal_type i=0; igetDofOrdinal(1, 0, i),0); + edgeBasis->getDofCoeffs(edgeDofCoeffs); + } - scalarViewType edgeInternalDofCoordsOriented("edgeInternalDofCoordsOriented", numInternalDofs, 1); - scalarViewType edgeDofCoordsOriented3d("edgeDofCoordsOriented3d", numInternalDofs, dim); - // auto numEdgeDOFs = basis->getDofCount(1,iedge); - for(ordinal_type i=0; igetBaseCellTopology(),eOrt(iedge)); - CellTools::mapToReferenceSubcell(edgeDofCoordsOriented3d, edgeInternalDofCoordsOriented, 1, iedge, topo); - - for(ordinal_type j=0; jgetDofOrdinal(1, iedge, j); - for(ordinal_type d=0; d ::getReferenceEdgeTangent(edgeTanHost, iedge, topo); + Kokkos::deep_copy(edgeTan,edgeTanHost); } + else if(isBasisHDIV) { + auto edgeNormal = Kokkos::subview(refEdgesNormal, iedge, Kokkos::ALL); + auto edgeNormalHost = Kokkos::create_mirror_view(edgeNormal); + CellTools::getReferenceSideNormal(edgeNormalHost, iedge, topo); + Kokkos::deep_copy(edgeNormal,edgeNormalHost); + } + } - //depending on how the reference basis is defined, the edges are scaled differently - auto edgeScale = (isBasisTriOrTet||isBasisI1) ? 2.0 :1.0; - if(isBasisHCURL) { + //compute DofCoords Oriented + for(ordinal_type i=0; igetDofOrdinal(1, 0, i); + edgeInternalDofCoords(i,0) = edgeDofCoords(edgeInternalDofOrdinals(i), 0); + CellTools::getSubcellParametrization(edgeParam, 1, topo); + } - scalarViewType edgeDofCoeffs("edgeDofCoeffs", edgeBasisCardinality); - edgeBasis->getDofCoeffs(edgeDofCoeffs); - CellTools::getReferenceEdgeTangent(refEdgeTan, iedge, topo); - for(ordinal_type i=0; igetBaseCellTopology(), eOrt(iedge)); - for(ordinal_type j=0; jgetDofOrdinal(1, iedge, j); - auto jdof = edgeBasis->getDofOrdinal(1, 0, j); - for(ordinal_type d=0; d ::getReferenceSideNormal(refNormal, iedge, topo); - scalarViewType edgeDofCoeffs("edgeDofCoeffs", edgeBasisCardinality); - edgeBasis->getDofCoeffs(edgeDofCoeffs); - for(ordinal_type i=0; igetBaseCellTopology(), eOrt(iedge)); - auto ortJacobianDet = ortJacobian(0,0); - for(ordinal_type j=0; jgetDofOrdinal(1, iedge, j); - auto jdof = edgeBasis->getDofOrdinal(1, 0, j); - for(ordinal_type d=0; d getDofCoeffs(edgeDofCoeffs); - for(ordinal_type i=0; igetDofOrdinal(1, iedge, j); - auto jdof = edgeBasis->getDofOrdinal(1, 0, j); - dofCoeffs(i,idof,0) = edgeDofCoeffs(jdof); - } - } - } + //depending on how the reference basis is defined, the faces are scaled differently + auto faceScale = (isBasisHEXI1) ? 4.0 : + (isBasisTETI1) ? 0.5 : 1.0; + intViewType faceTopoKey("faceTopoKey",numFaces); + intViewType fOrt("fOrt", numFaces); + scalarViewType refFaceTangents("refFaceTangents", numFaces, dim, 2); + scalarViewType refFacesNormal("refFacesNormal", numFaces, dim); + scalarViewType faceParam; + intViewType numFacesInternalDofs("numFacesInternalDofs", numFaces); + scalarViewType facesInternalDofCoords; + intViewType facesInternalDofOrdinals; + scalarViewType faceDofCoeffs; + + + ordinal_type maxNumFacesInternalDofs=0; + ordinal_type faceBasisMaxCardinality=0; + + for (ordinal_type iface=0; iface < numFaces; ++iface) { + ordinal_type numInternalDofs = faceBases[iface]->getDofCount(2,0); + numFacesInternalDofs(iface) = numInternalDofs; + maxNumFacesInternalDofs = std::max(maxNumFacesInternalDofs,numInternalDofs); + ordinal_type faceBasisCardinality = faceBases[iface]->getCardinality(); + faceBasisMaxCardinality = std::max(faceBasisMaxCardinality, faceBasisCardinality); } + facesInternalDofCoords = scalarViewType("faceInternalDofCoords", numFaces, maxNumFacesInternalDofs, 2); + facesInternalDofOrdinals = intViewType("faceInternalDofCoords", numFaces, maxNumFacesInternalDofs); + + if(isBasisHCURL) + faceDofCoeffs = scalarViewType("faceDofCoeffs", numFaces, faceBasisMaxCardinality,2); + else + faceDofCoeffs = scalarViewType("faceDofCoeffs", numFaces, faceBasisMaxCardinality); + for (ordinal_type iface=0; iface < numFaces; ++iface) { - scalarViewType ortJacobian("ortJacobian", 2, 2); auto faceBasis = faceBases[iface]; + faceTopoKey(iface) = faceBasis->getBaseCellTopology().getBaseKey(); ordinal_type faceBasisCardinality = faceBasis->getCardinality(); - ordinal_type numInternalDofs = faceBasis->getDofCount(2,0); scalarViewType faceDofCoords("faceDofCoords", faceBasisCardinality, 2); - scalarViewType faceInternalDofCoords("faceInternalDofCoords", numInternalDofs, 2); faceBasis->getDofCoords(faceDofCoords); - for(ordinal_type i=0; igetDofOrdinal(2, 0, i); for(ordinal_type d=0; d <2; ++d) - faceInternalDofCoords(i,d) = faceDofCoords(faceBasis->getDofOrdinal(2, 0, i),d); - - scalarViewType faceInternalDofCoordsOriented("faceInternalDofCoordsOriented", numInternalDofs, 2); - scalarViewType faceDofCoordsOriented3d("faceDofCoordsOriented3d", numInternalDofs, dim); - for(ordinal_type i=0; igetBaseCellTopology(),ort); - CellTools::mapToReferenceSubcell(faceDofCoordsOriented3d, faceInternalDofCoordsOriented, 2, iface, topo); - - for(ordinal_type j=0; jgetDofOrdinal(2, iface, j); - for(ordinal_type d=0; d getCardinality()); + faceBasis->getDofCoeffs(Kokkos::subview(faceDofCoeffs, iface, dofRange, Kokkos::ALL())); + if(isBasisHCURL) { - scalarViewType faceDofCoeffs("faceDofCoeffs", faceBasisCardinality, 2); - faceBasis->getDofCoeffs(faceDofCoeffs); - CellTools::getReferenceFaceTangents(refFaceTanU, refFaceTanV, iface, topo); - for(ordinal_type i=0; igetBaseCellTopology(), fOrt(iface)); - for(ordinal_type j=0; jgetDofOrdinal(2, iface, j); - auto jdof = faceBasis->getDofOrdinal(2, 0, j); - for(ordinal_type d=0; d ::getReferenceFaceTangents(refFaceTanUHost, refFaceTanVHost, iface, topo); + Kokkos::deep_copy(refFaceTanU, refFaceTanUHost); + Kokkos::deep_copy(refFaceTanV, refFaceTanVHost); + } else if(isBasisHDIV) { + auto faceNormal = Kokkos::subview(refFacesNormal,iface,Kokkos::ALL()); + auto faceNormalHost = Kokkos::create_mirror_view(faceNormal); + CellTools::getReferenceFaceNormal(faceNormalHost, iface, topo); + Kokkos::deep_copy(faceNormal, faceNormalHost); + } + } + + + if(dim > 2) + CellTools::getSubcellParametrization(faceParam, 2, topo); + + //* + const Kokkos::RangePolicy policy(0, numCells); + typedef F_computeDofCoordsAdCoeff + FunctorType; + Kokkos::parallel_for(policy, + FunctorType(dofCoords, dofCoeffs, + orts, tagToOrdinal, edgeParam, faceParam, + edgeInternalDofOrdinals, facesInternalDofOrdinals, + edgeInternalDofCoords, edgeDofCoeffs, refEdgesTan, refEdgesNormal, + facesInternalDofCoords, faceDofCoeffs, refFaceTangents, refFacesNormal, + dim, numEdges, numFaces, + edgeTopoKey, numEdgeInternalDofs, + faceTopoKey, numFacesInternalDofs, + edgeScale, faceScale, + isBasisHCURL, isBasisHDIV)); + + /*/ + scalarViewType edgeInternalDofCoordsOriented("edgeInternalDofCoordsOriented", numEdgeInternalDofs, 1); + scalarViewType faceInternalMaxDofCoordsOriented("faceInternalDofCoordsOriented", maxNumFacesInternalDofs, 2); + scalarViewType ortJacobianEdge("ortJacobianEdge", 1, 1); + scalarViewType ortJacobianFace("ortJacobian", 2, 2); + + + for(ordinal_type i=0; i 0) { + orts(i).getEdgeOrientation(eOrt.data(), numEdges); + for (ordinal_type iedge=0; iedge < numEdges; ++iedge) { + Impl::OrientationTools::mapToModifiedReference(edgeInternalDofCoordsOriented,edgeInternalDofCoords,edgeTopoKey, eOrt(iedge)); + + for (ordinal_type j=0;j::getReferenceFaceNormal(refNormal, iface, topo); - scalarViewType faceDofCoeffs("faceDofCoeffs", faceBasisCardinality); - faceBasis->getDofCoeffs(faceDofCoeffs); - for(ordinal_type i=0; i 0) { orts(i).getFaceOrientation(fOrt.data(), numFaces); - Impl::OrientationTools::getJacobianOfOrientationMap(ortJacobian, faceBasis->getBaseCellTopology(), fOrt(iface)); - auto ortJacobianDet = ortJacobian(0,0)*ortJacobian(1,1)-ortJacobian(1,0)*ortJacobian(0,1); - for(ordinal_type j=0; jgetDofOrdinal(2, iface, j); - auto jdof = faceBasis->getDofOrdinal(2, 0, j); - for(ordinal_type d=0; d getDofCoeffs(faceDofCoeffs); - for(ordinal_type i=0; igetDofOrdinal(2, iface, j); - auto jdof = faceBasis->getDofOrdinal(2, 0, j); - dofCoeffs(i,idof,0) = faceDofCoeffs(jdof); + if(isBasisHCURL) { + for (ordinal_type iface=0; iface < numFaces; ++iface) { + Impl::OrientationTools::getJacobianOfOrientationMap(ortJacobianFace, faceTopoKey(iface), fOrt(iface)); + for(ordinal_type j=0; jgetDofCount(dim,0); - for(ordinal_type j=0; jgetDofOrdinal(dim, 0, j); - for(ordinal_type d=0; d Date: Mon, 24 Jun 2019 10:53:27 -0600 Subject: [PATCH 2/4] Intrepid2: Enable Interpolation tests on OpenMP and Cuda (w/ UVM for now) --- .../unit-test/Projection/CMakeLists.txt | 7 +++ .../unit-test/Projection/Cuda/CMakeLists.txt | 35 +++++++++++ .../Cuda/test_DeRham_commutativity_HEX.cpp | 62 +++++++++++++++++++ .../Cuda/test_DeRham_commutativity_QUAD.cpp | 62 +++++++++++++++++++ .../Cuda/test_DeRham_commutativity_TET.cpp | 62 +++++++++++++++++++ .../Cuda/test_DeRham_commutativity_TRI.cpp | 62 +++++++++++++++++++ .../Projection/Cuda/test_convergence_HEX.cpp | 62 +++++++++++++++++++ .../Projection/Cuda/test_convergence_QUAD.cpp | 62 +++++++++++++++++++ .../Projection/Cuda/test_convergence_TET.cpp | 62 +++++++++++++++++++ .../Projection/Cuda/test_convergence_TRI.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_HEX.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_QUAD.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_TET.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_TRI.cpp | 62 +++++++++++++++++++ .../Projection/OpenMP/CMakeLists.txt | 35 +++++++++++ .../OpenMP/test_DeRham_commutativity_HEX.cpp | 62 +++++++++++++++++++ .../OpenMP/test_DeRham_commutativity_QUAD.cpp | 62 +++++++++++++++++++ .../OpenMP/test_DeRham_commutativity_TET.cpp | 62 +++++++++++++++++++ .../OpenMP/test_DeRham_commutativity_TRI.cpp | 62 +++++++++++++++++++ .../OpenMP/test_convergence_HEX.cpp | 62 +++++++++++++++++++ .../OpenMP/test_convergence_QUAD.cpp | 62 +++++++++++++++++++ .../OpenMP/test_convergence_TET.cpp | 62 +++++++++++++++++++ .../OpenMP/test_convergence_TRI.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_HEX.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_QUAD.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_TET.cpp | 62 +++++++++++++++++++ .../test_interpolation_projection_TRI.cpp | 62 +++++++++++++++++++ 27 files changed, 1565 insertions(+) create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/CMakeLists.txt create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_HEX.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_QUAD.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TET.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TRI.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_convergence_HEX.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_convergence_QUAD.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TET.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TRI.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_HEX.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_QUAD.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TET.cpp create mode 100644 packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TRI.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/CMakeLists.txt create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_HEX.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_QUAD.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TET.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TRI.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_HEX.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_QUAD.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TET.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TRI.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_HEX.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_QUAD.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TET.cpp create mode 100644 packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TRI.cpp diff --git a/packages/intrepid2/unit-test/Projection/CMakeLists.txt b/packages/intrepid2/unit-test/Projection/CMakeLists.txt index 9938dbcc5692..decfba6fc1ba 100644 --- a/packages/intrepid2/unit-test/Projection/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Projection/CMakeLists.txt @@ -4,4 +4,11 @@ IF(Kokkos_ENABLE_Serial) ADD_SUBDIRECTORY(Serial) ENDIF() +IF(Kokkos_ENABLE_OpenMP) + ADD_SUBDIRECTORY(OpenMP) +ENDIF() + +IF(Kokkos_ENABLE_Cuda AND Kokkos_ENABLE_Cuda_UVM) + ADD_SUBDIRECTORY(Cuda) +ENDIF() diff --git a/packages/intrepid2/unit-test/Projection/Cuda/CMakeLists.txt b/packages/intrepid2/unit-test/Projection/Cuda/CMakeLists.txt new file mode 100644 index 000000000000..c2e08f7f117b --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/CMakeLists.txt @@ -0,0 +1,35 @@ +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_HEX + SOURCES test_interpolation_projection_HEX.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_TET + SOURCES test_interpolation_projection_TET.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_QUAD + SOURCES test_interpolation_projection_QUAD.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_TRI + SOURCES test_interpolation_projection_TRI.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) \ No newline at end of file diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_HEX.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_HEX.cpp new file mode 100644 index 000000000000..7509f5eae136 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_HEX.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_HEX.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityHex(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_QUAD.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_QUAD.cpp new file mode 100644 index 000000000000..e36eaaaba4dc --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_QUAD.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_QUAD.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityQuad(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TET.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TET.cpp new file mode 100644 index 000000000000..5db74d4f06b0 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TET.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_TET.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityTet(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TRI.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TRI.cpp new file mode 100644 index 000000000000..0a10f618396c --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_DeRham_commutativity_TRI.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_TRI.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityTri(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_HEX.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_HEX.cpp new file mode 100644 index 000000000000..73c7375f8fc2 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_HEX.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_HEX.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceHex(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_QUAD.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_QUAD.cpp new file mode 100644 index 000000000000..cbb98a182fd3 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_QUAD.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_QUAD.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceQuad(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TET.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TET.cpp new file mode 100644 index 000000000000..f847ce283c8b --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TET.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_TET.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceTet(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TRI.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TRI.cpp new file mode 100644 index 000000000000..43d8fb34f25d --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_convergence_TRI.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_TRI.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceTri(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_HEX.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_HEX.cpp new file mode 100644 index 000000000000..be6ae26718e0 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_HEX.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_HEX.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionHex(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_QUAD.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_QUAD.cpp new file mode 100644 index 000000000000..32b4b3673fe8 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_QUAD.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_QUAD.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionQuad(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TET.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TET.cpp new file mode 100644 index 000000000000..2549fb5d55c0 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TET.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_TET.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionTet(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TRI.cpp b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TRI.cpp new file mode 100644 index 000000000000..46e43bbe455d --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/Cuda/test_interpolation_projection_TRI.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_TRI.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionTri(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/CMakeLists.txt b/packages/intrepid2/unit-test/Projection/OpenMP/CMakeLists.txt new file mode 100644 index 000000000000..c2e08f7f117b --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/CMakeLists.txt @@ -0,0 +1,35 @@ +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_HEX + SOURCES test_interpolation_projection_HEX.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_TET + SOURCES test_interpolation_projection_TET.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_QUAD + SOURCES test_interpolation_projection_QUAD.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) + +TRIBITS_ADD_EXECUTABLE_AND_TEST( + Test_InterpolationProjection_TRI + SOURCES test_interpolation_projection_TRI.cpp + ARGS PrintItAll + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "TEST PASSED" + ADD_DIR_TO_NAME + ) \ No newline at end of file diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_HEX.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_HEX.cpp new file mode 100644 index 000000000000..7509f5eae136 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_HEX.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_HEX.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityHex(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_QUAD.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_QUAD.cpp new file mode 100644 index 000000000000..e36eaaaba4dc --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_QUAD.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_QUAD.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityQuad(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TET.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TET.cpp new file mode 100644 index 000000000000..5db74d4f06b0 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TET.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_TET.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityTet(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TRI.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TRI.cpp new file mode 100644 index 000000000000..0a10f618396c --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_DeRham_commutativity_TRI.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_DeRham_commutativity_TRI.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::DeRhamCommutativityTri(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_HEX.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_HEX.cpp new file mode 100644 index 000000000000..73c7375f8fc2 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_HEX.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_HEX.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceHex(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_QUAD.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_QUAD.cpp new file mode 100644 index 000000000000..cbb98a182fd3 --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_QUAD.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_QUAD.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceQuad(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TET.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TET.cpp new file mode 100644 index 000000000000..f847ce283c8b --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TET.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_TET.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceTet(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TRI.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TRI.cpp new file mode 100644 index 000000000000..43d8fb34f25d --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_convergence_TRI.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for hexahedral elements. + \author Created by Mauro Perego +*/ + +#include "../test_convergence_TRI.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::ConvergenceTri(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_HEX.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_HEX.cpp new file mode 100644 index 000000000000..227736ca40eb --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_HEX.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_HEX.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionHex(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_QUAD.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_QUAD.cpp new file mode 100644 index 000000000000..9cb29ae56d3d --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_QUAD.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_QUAD.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionQuad(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TET.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TET.cpp new file mode 100644 index 000000000000..825d48fe7dca --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TET.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_TET.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionTet(verbose); + + Kokkos::finalize(); + return r_val; +} + diff --git a/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TRI.cpp b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TRI.cpp new file mode 100644 index 000000000000..aa88f3f27e1e --- /dev/null +++ b/packages/intrepid2/unit-test/Projection/OpenMP/test_interpolation_projection_TRI.cpp @@ -0,0 +1,62 @@ +// @HEADER +// ************************************************************************ +// +// Intrepid2 Package +// Copyright (2007) Sandia Corporation +// +// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive +// license for use of this work by or on behalf of the U.S. Government. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Kyungjoo Kim (kyukim@sandia.gov), or +// Mauro Perego (mperego@sandia.gov) +// +// ************************************************************************ +// @HEADER + +/** \file test_01.cpp + \brief Test for checking orientation tools for tetrahedral elements. + \author Created by Mauro Perego +*/ + +#include "test_interpolation_projection_TRI.hpp" +#include "Kokkos_Core.hpp" + + +int main(int argc, char *argv[]) { + + const bool verbose = (argc-1) > 0; + Kokkos::initialize(); + + const int r_val = Intrepid2::Test::InterpolationProjectionTri(verbose); + + Kokkos::finalize(); + return r_val; +} + From 4f20d956781afc40240745875ca602533e409f1a Mon Sep 17 00:00:00 2001 From: Mauro Perego Date: Mon, 24 Jun 2019 11:05:50 -0600 Subject: [PATCH 3/4] Intrepid2: Lagrangian Interpolation, cleaning --- .../Intrepid2_LagrangianInterpolationDef.hpp | 148 +++--------------- 1 file changed, 19 insertions(+), 129 deletions(-) diff --git a/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp b/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp index 263090c8e62e..fb6e495b91f6 100644 --- a/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp +++ b/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp @@ -148,11 +148,13 @@ struct F_computeDofCoordsAdCoeff { if(numEdges > 0) { + //compute coordinates associated to edge DoFs ordinal_type eOrt[12]; value_type ortJac; scalarViewType ortJacobianEdge(&ortJac, 1, 1); orts(cell).getEdgeOrientation(eOrt, numEdges); auto edgeInternalDofCoordsOriented = Kokkos::subview(edgeWorkView,cell, Kokkos::ALL(), Kokkos::ALL()); + //map edge DoFs coords into parent element coords for (ordinal_type iedge=0; iedge < numEdges; ++iedge) { Impl::OrientationTools::mapToModifiedReference(edgeInternalDofCoordsOriented,edgeInternalDofCoords,edgeTopoKey, eOrt[iedge]); @@ -164,6 +166,7 @@ struct F_computeDofCoordsAdCoeff { } } + //compute coefficients associated to edge DoFs if(isBasisHCURL) { for (ordinal_type iedge=0; iedge < numEdges; ++iedge) { Impl::OrientationTools::getJacobianOfOrientationMap(ortJacobianEdge, edgeTopoKey, eOrt[iedge]); @@ -202,10 +205,12 @@ struct F_computeDofCoordsAdCoeff { } if(numFaces > 0) { + //compute coordinates associated to face DoFs ordinal_type fOrt[12]; value_type ortJac[4]; scalarViewType ortJacobianFace(ortJac, 2, 2); orts(cell).getFaceOrientation(fOrt, numFaces); + //map face dofs coords into parent element coords for (ordinal_type iface=0; iface < numFaces; ++iface) { ordinal_type ort = fOrt[iface]; ordinal_type numInternalDofs = numFacesInternalDofs(iface); @@ -218,12 +223,11 @@ struct F_computeDofCoordsAdCoeff { const auto u = faceInternalDofCoordsOriented(j, 0); const auto v = faceInternalDofCoordsOriented(j, 1); auto idof = tagToOrdinal(2, iface, j); - - // map_dim(u,v) = c_0(cellDim) + c_1(cellDim)*u + c_2(cellDim)*v because both Quad and Tri ref faces are affine! for (ordinal_type d=0;d::getDofCoordsAndCoeffs( EPointType pointType, const Kokkos::DynRankView orts) { - typedef typename Kokkos::Impl::is_space::host_mirror_space::execution_space host_space_type; typedef typename BasisType::scalarType scalarType; typedef Kokkos::DynRankView scalarViewType; - typedef Kokkos::DynRankView scalarHostViewType; typedef Kokkos::DynRankView intViewType; typedef Kokkos::pair range_type; @@ -361,10 +363,9 @@ LagrangianInterpolation::getDofCoordsAndCoeffs( basis->getDofCoeffs(refDofCoeffs); RealSpaceTools::clone(dofCoeffs,refDofCoeffs); - //depending on how the reference basis is defined, the edges are scaled differently - auto edgeScale = (isBasisTriOrTet||isBasisI1) ? 2.0 :1.0; - ordinal_type edgeTopoKey = Teuchos::nonnull(edgeBasis) ? edgeBasis->getBaseCellTopology().getBaseKey() : 0; + //*** Pre-compute needed quantities related to edge DoFs that do not depend on the cell *** + ordinal_type edgeTopoKey = Teuchos::nonnull(edgeBasis) ? edgeBasis->getBaseCellTopology().getBaseKey() : 0; intViewType eOrt("eOrt", numEdges); scalarViewType refEdgesTan("refEdgesTan", numEdges, dim); scalarViewType refEdgesNormal("refEdgesNormal", numEdges, dim); @@ -375,6 +376,8 @@ LagrangianInterpolation::getDofCoordsAndCoeffs( scalarViewType edgeDofCoeffs("edgeDofCoeffs", edgeBasisCardinality); scalarViewType edgeInternalDofCoords("edgeInternalDofCoords", numEdgeInternalDofs, 1); intViewType edgeInternalDofOrdinals("edgeInternalDofOrdinals", numEdgeInternalDofs); + //depending on how the reference basis is defined, the edges are scaled differently + auto edgeScale = (isBasisTriOrTet||isBasisI1) ? 2.0 :1.0; if(Teuchos::nonnull(edgeBasis)) { edgeBasis->getDofCoords(edgeDofCoords); @@ -403,9 +406,9 @@ LagrangianInterpolation::getDofCoordsAndCoeffs( CellTools::getSubcellParametrization(edgeParam, 1, topo); } - //depending on how the reference basis is defined, the faces are scaled differently - auto faceScale = (isBasisHEXI1) ? 4.0 : - (isBasisTETI1) ? 0.5 : 1.0; + + //*** Pre-compute needed quantities related to face DoFs that do not depend on the cell *** + intViewType faceTopoKey("faceTopoKey",numFaces); intViewType fOrt("fOrt", numFaces); scalarViewType refFaceTangents("refFaceTangents", numFaces, dim, 2); @@ -415,6 +418,9 @@ LagrangianInterpolation::getDofCoordsAndCoeffs( scalarViewType facesInternalDofCoords; intViewType facesInternalDofOrdinals; scalarViewType faceDofCoeffs; + //depending on how the reference basis is defined, the faces are scaled differently + auto faceScale = (isBasisHEXI1) ? 4.0 : + (isBasisTETI1) ? 0.5 : 1.0; ordinal_type maxNumFacesInternalDofs=0; @@ -467,11 +473,12 @@ LagrangianInterpolation::getDofCoordsAndCoeffs( } } - if(dim > 2) CellTools::getSubcellParametrization(faceParam, 2, topo); - //* + + //*** Loop over cells *** + const Kokkos::RangePolicy policy(0, numCells); typedef F_computeDofCoordsAdCoeff ::getDofCoordsAndCoeffs( faceTopoKey, numFacesInternalDofs, edgeScale, faceScale, isBasisHCURL, isBasisHDIV)); - - /*/ - scalarViewType edgeInternalDofCoordsOriented("edgeInternalDofCoordsOriented", numEdgeInternalDofs, 1); - scalarViewType faceInternalMaxDofCoordsOriented("faceInternalDofCoordsOriented", maxNumFacesInternalDofs, 2); - scalarViewType ortJacobianEdge("ortJacobianEdge", 1, 1); - scalarViewType ortJacobianFace("ortJacobian", 2, 2); - - - for(ordinal_type i=0; i 0) { - orts(i).getEdgeOrientation(eOrt.data(), numEdges); - for (ordinal_type iedge=0; iedge < numEdges; ++iedge) { - Impl::OrientationTools::mapToModifiedReference(edgeInternalDofCoordsOriented,edgeInternalDofCoords,edgeTopoKey, eOrt(iedge)); - - for (ordinal_type j=0;j 0) { - orts(i).getFaceOrientation(fOrt.data(), numFaces); - for (ordinal_type iface=0; iface < numFaces; ++iface) { - ordinal_type ort = fOrt(iface); - ordinal_type numInternalDofs = numFacesInternalDofs(iface); - auto dofRange = range_type(0, numInternalDofs); - auto faceInternalDofCoords = Kokkos::subview(facesInternalDofCoords, iface, dofRange, Kokkos::ALL()); - auto faceInternalDofCoordsOriented = Kokkos::subview(faceInternalMaxDofCoordsOriented,dofRange, Kokkos::ALL()); - Impl::OrientationTools::mapToModifiedReference(faceInternalDofCoordsOriented,faceInternalDofCoords,faceTopoKey(iface),ort); - - for (ordinal_type j=0;j Date: Mon, 24 Jun 2019 17:59:30 -0600 Subject: [PATCH 4/4] Intrepid2, address issues in PR #5431 --- .../Intrepid2_OrientationTools.hpp | 2 +- ...repid2_OrientationToolsDefModifyPoints.hpp | 2 +- .../Intrepid2_LagrangianInterpolationDef.hpp | 270 +++++++++--------- .../test_interpolation_projection_HEX.hpp | 17 +- .../test_interpolation_projection_QUAD.hpp | 17 +- .../test_interpolation_projection_TET.hpp | 45 ++- .../test_interpolation_projection_TRI.hpp | 18 +- 7 files changed, 207 insertions(+), 164 deletions(-) diff --git a/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp b/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp index 91292284e9e3..381bf3fbca81 100644 --- a/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp +++ b/packages/intrepid2/src/Orientation/Intrepid2_OrientationTools.hpp @@ -247,7 +247,7 @@ namespace Intrepid2 { \param cellOrt [in] - cell orientation number (zero is aligned with shards default configuration */ template - inline + KOKKOS_INLINE_FUNCTION static void getJacobianOfOrientationMap(JacobianViewType jacobian, const unsigned cellTopoKey, diff --git a/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp b/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp index 7c5481d6fe1e..e89027b40095 100644 --- a/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp +++ b/packages/intrepid2/src/Orientation/Intrepid2_OrientationToolsDefModifyPoints.hpp @@ -343,7 +343,7 @@ namespace Intrepid2 { } template - inline + KOKKOS_INLINE_FUNCTION void OrientationTools:: getJacobianOfOrientationMap(outPointViewType jacobian, diff --git a/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp b/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp index fb6e495b91f6..b83133b34155 100644 --- a/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp +++ b/packages/intrepid2/src/Projection/Intrepid2_LagrangianInterpolationDef.hpp @@ -63,83 +63,83 @@ typename ortViewType, typename t2oViewType, typename subcellParamViewType, typename intViewType> -struct F_computeDofCoordsAdCoeff { +struct computeDofCoordsAndCoeffs { typedef typename scalarViewType::value_type value_type; - scalarViewType dofCoords, dofCoeffs; - const ortViewType orts; - const t2oViewType tagToOrdinal; - const subcellParamViewType edgeParam, faceParam; - const intViewType edgeInternalDofOrdinals, facesInternalDofOrdinals; - const scalarViewType edgeInternalDofCoords, edgeDofCoeffs, ortJacobianEdge, refEdgesTan, refEdgesNormal; - const scalarViewType facesInternalDofCoords, faceDofCoeffs, ortJacobianFace, refFaceTangents, refFacesNormal; - scalarViewType edgeWorkView, faceWorkView; - const ordinal_type cellDim, numEdges, numFaces; - const ordinal_type edgeTopoKey, numEdgeInternalDofs; - const intViewType faceTopoKey, numFacesInternalDofs; - const value_type edgeScale, faceScale; - const bool isBasisHCURL, isBasisHDIV; - - F_computeDofCoordsAdCoeff( scalarViewType dofCoords_, - scalarViewType dofCoeffs_, - const ortViewType orts_, - const t2oViewType tagToOrdinal_, - const subcellParamViewType edgeParam_, - const subcellParamViewType faceParam_, - const intViewType edgeInternalDofOrdinals_, - const intViewType facesInternalDofOrdinals_, - const scalarViewType edgeInternalDofCoords_, - const scalarViewType edgeDofCoeffs_, - const scalarViewType refEdgesTan_, - const scalarViewType refEdgesNormal_, - const scalarViewType facesInternalDofCoords_, - const scalarViewType faceDofCoeffs_, - const scalarViewType refFaceTangents_, - const scalarViewType refFacesNormal_, - const ordinal_type cellDim_, - const ordinal_type numEdges_, - const ordinal_type numFaces_, - const ordinal_type edgeTopoKey_, - const ordinal_type numEdgeInternalDofs_, - const intViewType faceTopoKey_, - const intViewType numFacesInternalDofs_, - const value_type edgeScale_, - const value_type faceScale_, - const bool isBasisHCURL_, - const bool isBasisHDIV_ + scalarViewType dofCoords_, dofCoeffs_; + const ortViewType orts_; + const t2oViewType tagToOrdinal_; + const subcellParamViewType edgeParam_, faceParam_; + const intViewType edgeInternalDofOrdinals_, facesInternalDofOrdinals_; + const scalarViewType edgeInternalDofCoords_, edgeDofCoeffs_, ortJacobianEdge_, refEdgesTan_, refEdgesNormal_; + const scalarViewType facesInternalDofCoords_, faceDofCoeffs_, ortJacobianFace_, refFaceTangents_, refFacesNormal_; + scalarViewType edgeWorkView_, faceWorkView_; + const ordinal_type cellDim_, numEdges_, numFaces_; + const ordinal_type edgeTopoKey_, numEdgeInternalDofs_; + const intViewType faceTopoKey_, numFacesInternalDofs_; + const value_type edgeScale_, faceScale_; + const bool isBasisHCURL_, isBasisHDIV_; + + computeDofCoordsAndCoeffs( scalarViewType dofCoords, + scalarViewType dofCoeffs, + const ortViewType orts, + const t2oViewType tagToOrdinal, + const subcellParamViewType edgeParam, + const subcellParamViewType faceParam, + const intViewType edgeInternalDofOrdinals, + const intViewType facesInternalDofOrdinals, + const scalarViewType edgeInternalDofCoords, + const scalarViewType edgeDofCoeffs, + const scalarViewType refEdgesTan, + const scalarViewType refEdgesNormal, + const scalarViewType facesInternalDofCoords, + const scalarViewType faceDofCoeffs, + const scalarViewType refFaceTangents, + const scalarViewType refFacesNormal, + const ordinal_type cellDim, + const ordinal_type numEdges, + const ordinal_type numFaces, + const ordinal_type edgeTopoKey, + const ordinal_type numEdgeInternalDofs, + const intViewType faceTopoKey, + const intViewType numFacesInternalDofs, + const value_type edgeScale, + const value_type faceScale, + const bool isBasisHCURL, + const bool isBasisHDIV ) - : dofCoords(dofCoords_), - dofCoeffs(dofCoeffs_), - orts(orts_), - tagToOrdinal(tagToOrdinal_), - edgeParam(edgeParam_), - faceParam(faceParam_), - edgeInternalDofOrdinals(edgeInternalDofOrdinals_), - facesInternalDofOrdinals(facesInternalDofOrdinals_), - edgeInternalDofCoords(edgeInternalDofCoords_), - edgeDofCoeffs(edgeDofCoeffs_), - refEdgesTan(refEdgesTan_), - refEdgesNormal(refEdgesNormal_), - facesInternalDofCoords(facesInternalDofCoords_), - faceDofCoeffs(faceDofCoeffs_), - refFaceTangents(refFaceTangents_), - refFacesNormal(refFacesNormal_), - cellDim(cellDim_), - numEdges(numEdges_), - numFaces(numFaces_), - edgeTopoKey(edgeTopoKey_), - numEdgeInternalDofs(numEdgeInternalDofs_), - faceTopoKey(faceTopoKey_), - numFacesInternalDofs(numFacesInternalDofs_), - edgeScale(edgeScale_), - faceScale(faceScale_), - isBasisHCURL(isBasisHCURL_), - isBasisHDIV(isBasisHDIV_) + : dofCoords_(dofCoords), + dofCoeffs_(dofCoeffs), + orts_(orts), + tagToOrdinal_(tagToOrdinal), + edgeParam_(edgeParam), + faceParam_(faceParam), + edgeInternalDofOrdinals_(edgeInternalDofOrdinals), + facesInternalDofOrdinals_(facesInternalDofOrdinals), + edgeInternalDofCoords_(edgeInternalDofCoords), + edgeDofCoeffs_(edgeDofCoeffs), + refEdgesTan_(refEdgesTan), + refEdgesNormal_(refEdgesNormal), + facesInternalDofCoords_(facesInternalDofCoords), + faceDofCoeffs_(faceDofCoeffs), + refFaceTangents_(refFaceTangents), + refFacesNormal_(refFacesNormal), + cellDim_(cellDim), + numEdges_(numEdges), + numFaces_(numFaces), + edgeTopoKey_(edgeTopoKey), + numEdgeInternalDofs_(numEdgeInternalDofs), + faceTopoKey_(faceTopoKey), + numFacesInternalDofs_(numFacesInternalDofs), + edgeScale_(edgeScale), + faceScale_(faceScale), + isBasisHCURL_(isBasisHCURL), + isBasisHDIV_(isBasisHDIV) { if(numEdges > 0) - edgeWorkView = scalarViewType("edgeWorkView", dofCoords.extent(0), numEdgeInternalDofs, 1); + edgeWorkView_ = scalarViewType("edgeWorkView", dofCoords.extent(0), numEdgeInternalDofs, 1); if(numFaces > 0) - faceWorkView = scalarViewType("faceWorkView", dofCoords.extent(0), facesInternalDofCoords.extent(1), 2); + faceWorkView_ = scalarViewType("faceWorkView", dofCoords.extent(0), facesInternalDofCoords.extent(1), 2); } KOKKOS_INLINE_FUNCTION @@ -147,119 +147,119 @@ struct F_computeDofCoordsAdCoeff { typedef Kokkos::pair range_type; - if(numEdges > 0) { + if(numEdges_ > 0) { //compute coordinates associated to edge DoFs ordinal_type eOrt[12]; value_type ortJac; scalarViewType ortJacobianEdge(&ortJac, 1, 1); - orts(cell).getEdgeOrientation(eOrt, numEdges); - auto edgeInternalDofCoordsOriented = Kokkos::subview(edgeWorkView,cell, Kokkos::ALL(), Kokkos::ALL()); + orts_(cell).getEdgeOrientation(eOrt, numEdges_); + auto edgeInternalDofCoordsOriented = Kokkos::subview(edgeWorkView_,cell, Kokkos::ALL(), Kokkos::ALL()); //map edge DoFs coords into parent element coords - for (ordinal_type iedge=0; iedge < numEdges; ++iedge) { - Impl::OrientationTools::mapToModifiedReference(edgeInternalDofCoordsOriented,edgeInternalDofCoords,edgeTopoKey, eOrt[iedge]); + for (ordinal_type iedge=0; iedge < numEdges_; ++iedge) { + Impl::OrientationTools::mapToModifiedReference(edgeInternalDofCoordsOriented,edgeInternalDofCoords_,edgeTopoKey_, eOrt[iedge]); - for (ordinal_type j=0;j 0) { + if(numFaces_ > 0) { //compute coordinates associated to face DoFs ordinal_type fOrt[12]; value_type ortJac[4]; scalarViewType ortJacobianFace(ortJac, 2, 2); - orts(cell).getFaceOrientation(fOrt, numFaces); + orts_(cell).getFaceOrientation(fOrt, numFaces_); //map face dofs coords into parent element coords - for (ordinal_type iface=0; iface < numFaces; ++iface) { + for (ordinal_type iface=0; iface < numFaces_; ++iface) { ordinal_type ort = fOrt[iface]; - ordinal_type numInternalDofs = numFacesInternalDofs(iface); + ordinal_type numInternalDofs = numFacesInternalDofs_(iface); auto dofRange = range_type(0, numInternalDofs); - auto faceInternalDofCoords = Kokkos::subview(facesInternalDofCoords, iface, dofRange, Kokkos::ALL()); - auto faceInternalDofCoordsOriented = Kokkos::subview(faceWorkView,cell, dofRange, Kokkos::ALL()); - Impl::OrientationTools::mapToModifiedReference(faceInternalDofCoordsOriented,faceInternalDofCoords,faceTopoKey(iface),ort); + auto faceInternalDofCoords = Kokkos::subview(facesInternalDofCoords_, iface, dofRange, Kokkos::ALL()); + auto faceInternalDofCoordsOriented = Kokkos::subview(faceWorkView_,cell, dofRange, Kokkos::ALL()); + Impl::OrientationTools::mapToModifiedReference(faceInternalDofCoordsOriented,faceInternalDofCoords,faceTopoKey_(iface),ort); for (ordinal_type j=0;j::getDofCoordsAndCoeffs( //*** Loop over cells *** const Kokkos::RangePolicy policy(0, numCells); - typedef F_computeDofCoordsAdCoeff + typedef computeDofCoordsAndCoeffs ::host_mirror_space::execution_space HostSpaceType ; + typedef Kokkos::DynRankView DynRankViewIntHost; *outStream << "DeviceSpace:: "; DeviceSpaceType::print_configuration(*outStream, false); *outStream << "HostSpace:: "; HostSpaceType::print_configuration(*outStream, false); @@ -322,7 +323,7 @@ int InterpolationProjectionHex(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&hexas[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&hexas[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, hex); @@ -504,6 +505,7 @@ int InterpolationProjectionHex(const bool verbose) { } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHGrad, numCells, basisCardinality); { @@ -646,6 +648,7 @@ int InterpolationProjectionHex(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -765,7 +768,7 @@ int InterpolationProjectionHex(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&hexas[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&hexas[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, hex); @@ -955,6 +958,7 @@ int InterpolationProjectionHex(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHCurl, numCells, basisCardinality); { @@ -1098,6 +1102,7 @@ int InterpolationProjectionHex(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1200,7 +1205,7 @@ int InterpolationProjectionHex(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&hexas[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&hexas[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, hex); @@ -1399,6 +1404,7 @@ int InterpolationProjectionHex(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHDiv, numCells, basisCardinality); { @@ -1543,6 +1549,7 @@ int InterpolationProjectionHex(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1596,7 +1603,7 @@ int InterpolationProjectionHex(const bool verbose) { physVertexes(i,j,k) = vertices[hexas[i][j]][k]; // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&hexas[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&hexas[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, hex); @@ -1734,6 +1741,7 @@ int InterpolationProjectionHex(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHVol, numCells, basisCardinality); { @@ -1854,6 +1862,7 @@ int InterpolationProjectionHex(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } catch (std::exception err) { std::cout << " Exeption\n"; diff --git a/packages/intrepid2/unit-test/Projection/test_interpolation_projection_QUAD.hpp b/packages/intrepid2/unit-test/Projection/test_interpolation_projection_QUAD.hpp index d7ee6f7bf6bb..129c3e66d122 100644 --- a/packages/intrepid2/unit-test/Projection/test_interpolation_projection_QUAD.hpp +++ b/packages/intrepid2/unit-test/Projection/test_interpolation_projection_QUAD.hpp @@ -128,6 +128,7 @@ int InterpolationProjectionQuad(const bool verbose) { typedef typename Kokkos::Impl::is_space::host_mirror_space::execution_space HostSpaceType ; + typedef Kokkos::DynRankView DynRankViewIntHost; *outStream << "DeviceSpace:: "; DeviceSpaceType::print_configuration(*outStream, false); *outStream << "HostSpace:: "; HostSpaceType::print_configuration(*outStream, false); @@ -271,7 +272,7 @@ int InterpolationProjectionQuad(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&quads[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&quads[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, quad); @@ -428,6 +429,7 @@ int InterpolationProjectionQuad(const bool verbose) { } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHGrad, numCells, basisCardinality); { @@ -569,6 +571,7 @@ int InterpolationProjectionQuad(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -650,7 +653,7 @@ int InterpolationProjectionQuad(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&quads[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&quads[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, quad); @@ -816,6 +819,7 @@ int InterpolationProjectionQuad(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHCurl, numCells, basisCardinality); { @@ -956,6 +960,7 @@ int InterpolationProjectionQuad(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1033,7 +1038,7 @@ int InterpolationProjectionQuad(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&quads[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&quads[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, quad); @@ -1209,6 +1214,7 @@ int InterpolationProjectionQuad(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHDiv, numCells, basisCardinality); { @@ -1352,6 +1358,7 @@ int InterpolationProjectionQuad(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1404,7 +1411,7 @@ int InterpolationProjectionQuad(const bool verbose) { physVertexes(i,j,k) = vertices[quads[i][j]][k]; // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&quads[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&quads[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, quad); @@ -1540,6 +1547,7 @@ int InterpolationProjectionQuad(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHVol, numCells, basisCardinality); { @@ -1659,6 +1667,7 @@ int InterpolationProjectionQuad(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } catch (std::exception err) { std::cout << " Exeption\n"; diff --git a/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TET.hpp b/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TET.hpp index f7bb465f7b9a..362fd28b1929 100644 --- a/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TET.hpp +++ b/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TET.hpp @@ -128,6 +128,7 @@ int InterpolationProjectionTet(const bool verbose) { typedef typename Kokkos::Impl::is_space::host_mirror_space::execution_space HostSpaceType ; + typedef Kokkos::DynRankView DynRankViewIntHost; *outStream << "DeviceSpace:: "; DeviceSpaceType::print_configuration(*outStream, false); *outStream << "HostSpace:: "; HostSpaceType::print_configuration(*outStream, false); @@ -297,7 +298,7 @@ int InterpolationProjectionTet(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&tets[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tets[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tet); @@ -322,7 +323,13 @@ int InterpolationProjectionTet(const bool verbose) { //compute Lagrangian Interpolation of fun { li::getDofCoordsAndCoeffs(dofCoordsOriented, dofCoeffsPhys, basisPtr.get(), POINTTYPE_EQUISPACED, elemOrts); - + Kokkos::fence(); + *outStream << "\n\nFunction DOFs for Tet 0 are:"; + for(ordinal_type j=0;j tetLinearBasis; //used for computing physical coordinates @@ -347,6 +354,7 @@ int InterpolationProjectionTet(const bool verbose) { } li::getBasisCoeffs(basisCoeffsLI, funAtDofCoords, dofCoeffsPhys); + Kokkos::fence(); } //Testing Kronecker property of basis functions @@ -420,17 +428,18 @@ int InterpolationProjectionTet(const bool verbose) { areDifferent = std::abs(basisCoeffsLI(0,basisPtr->getDofOrdinal(1,edgeIndexes[0][iEdge],j)) - basisCoeffsLI(1,basisPtr->getDofOrdinal(1,edgeIndexes[1][iEdge],j))) > 10*tol; } - if(areDifferent) { + if(areDifferent) + { errorFlag++; *outStream << std::setw(70) << "^^^^----FAILURE!" << "\n"; - *outStream << "Function DOFs on common edge " << iEdge << " computed using Tet 0 basis functions are not consistent with those computed using Tet 1\n"; - *outStream << "Function DOFs for Tet 0 are:"; - for(ordinal_type j=0;jgetDofOrdinal(1,edgeIndexes[0][iEdge],j)); - *outStream << "\nFunction DOFs for Tet 1 are:"; - for(ordinal_type j=0;jgetDofOrdinal(1,edgeIndexes[1][iEdge],j)); - *outStream << std::endl; + //*outStream << "Function DOFs on common edge " << iEdge << " computed using Tet 0 basis functions are not consistent with those computed using Tet 1\n"; + //*outStream << "Function DOFs for Tet 0 are:"; + //for(ordinal_type j=0;jgetDofOrdinal(1,edgeIndexes[0][iEdge],j)); + //*outStream << "\nFunction DOFs for Tet 1 are:"; + //for(ordinal_type j=0;jgetDofOrdinal(1,edgeIndexes[1][iEdge],j)); + //*outStream << std::endl; } } } @@ -479,6 +488,7 @@ int InterpolationProjectionTet(const bool verbose) { } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHGrad, numCells, basisCardinality); { @@ -620,6 +630,7 @@ int InterpolationProjectionTet(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -724,7 +735,7 @@ int InterpolationProjectionTet(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&tets[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tets[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tet); @@ -914,6 +925,7 @@ int InterpolationProjectionTet(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHCurl, numCells, basisCardinality); { @@ -1056,6 +1068,7 @@ int InterpolationProjectionTet(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1137,7 +1150,7 @@ int InterpolationProjectionTet(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&tets[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tets[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tet); @@ -1336,6 +1349,7 @@ int InterpolationProjectionTet(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHDiv, numCells, basisCardinality); { @@ -1480,6 +1494,7 @@ int InterpolationProjectionTet(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1534,7 +1549,7 @@ int InterpolationProjectionTet(const bool verbose) { physVertexes(i,j,k) = vertices[tets[i][j]][k]; // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&tets[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tets[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tet); @@ -1672,6 +1687,7 @@ int InterpolationProjectionTet(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHVol, numCells, basisCardinality); { @@ -1792,6 +1808,7 @@ int InterpolationProjectionTet(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } catch (std::exception err) { std::cout << " Exeption\n"; diff --git a/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TRI.hpp b/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TRI.hpp index 787381a009e3..b132a6466b4e 100644 --- a/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TRI.hpp +++ b/packages/intrepid2/unit-test/Projection/test_interpolation_projection_TRI.hpp @@ -128,6 +128,7 @@ int InterpolationProjectionTri(const bool verbose) { typedef typename Kokkos::Impl::is_space::host_mirror_space::execution_space HostSpaceType ; + typedef Kokkos::DynRankView DynRankViewIntHost; *outStream << "DeviceSpace:: "; DeviceSpaceType::print_configuration(*outStream, false); *outStream << "HostSpace:: "; HostSpaceType::print_configuration(*outStream, false); @@ -270,7 +271,7 @@ int InterpolationProjectionTri(const bool verbose) { } // compute orientations for cells - DynRankViewInt elemNodes(&tris[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tris[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tri); @@ -428,7 +429,7 @@ int InterpolationProjectionTri(const bool verbose) { } } - +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHGrad, numCells, basisCardinality); { @@ -570,6 +571,7 @@ int InterpolationProjectionTri(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -650,7 +652,7 @@ int InterpolationProjectionTri(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&tris[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tris[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tri); @@ -815,6 +817,7 @@ int InterpolationProjectionTri(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHCurl, numCells, basisCardinality); { @@ -955,6 +958,7 @@ int InterpolationProjectionTri(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1032,7 +1036,7 @@ int InterpolationProjectionTri(const bool verbose) { } // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&tris[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tris[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tri); @@ -1207,6 +1211,7 @@ int InterpolationProjectionTri(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHDiv, numCells, basisCardinality); { @@ -1350,6 +1355,7 @@ int InterpolationProjectionTri(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } } while(std::next_permutation(&reorder[0]+1, &reorder[0]+4)); //reorder vertices of common face @@ -1402,7 +1408,7 @@ int InterpolationProjectionTri(const bool verbose) { physVertexes(i,j,k) = vertices[tris[i][j]][k]; // compute orientations for cells (one time computation) - DynRankViewInt elemNodes(&tris[0][0], numCells, numElemVertexes); + DynRankViewIntHost elemNodes(&tris[0][0], numCells, numElemVertexes); Kokkos::DynRankView elemOrts("elemOrts", numCells); ots::getOrientation(elemOrts, elemNodes, tri); @@ -1540,6 +1546,7 @@ int InterpolationProjectionTri(const bool verbose) { } } +#ifndef KOKKOS_ENABLE_CUDA //compute projection-based interpolation of the Lagrangian interpolation DynRankView ConstructWithLabel(basisCoeffsHVol, numCells, basisCardinality); { @@ -1659,6 +1666,7 @@ int InterpolationProjectionTri(const bool verbose) { "\nThe max The infinite norm of the difference between the weights is: " << diffErr << std::endl; } } +#endif } } catch (std::exception err) { std::cout << " Exeption\n";