Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intrepid2: parallelize the Lagragian Interpolation tool #5431

Merged
merged 4 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions packages/intrepid2/src/Cell/Intrepid2_CellTools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ordinal_type>(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ namespace Intrepid2 {
*/
template<typename outPointViewType,
typename refPointViewType>
inline
KOKKOS_INLINE_FUNCTION
static void
mapToModifiedReference(outPointViewType outPoints,
const refPointViewType refPoints,
Expand Down Expand Up @@ -247,7 +247,7 @@ namespace Intrepid2 {
\param cellOrt [in] - cell orientation number (zero is aligned with shards default configuration
*/
template<typename JacobianViewType>
inline
KOKKOS_INLINE_FUNCTION
static void
getJacobianOfOrientationMap(JacobianViewType jacobian,
const unsigned cellTopoKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ namespace Intrepid2 {

template<typename outPointViewType,
typename refPointViewType>
inline
KOKKOS_INLINE_FUNCTION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that this works on GPUs ? I checked shards key is a variable (not constexpr). If inside uses the shards key value, it is not going to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an enum, isn't it fine? It works on GPUs tested by the PR testing.

void
OrientationTools::
mapToModifiedReference(outPointViewType outPoints,
Expand Down Expand Up @@ -343,7 +343,7 @@ namespace Intrepid2 {
}

template<typename outPointViewType>
inline
KOKKOS_INLINE_FUNCTION
void
OrientationTools::
getJacobianOfOrientationMap(outPointViewType jacobian,
Expand Down
Loading