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

Align the constructors of the different DiscreteDomain #749

Merged
merged 1 commit into from
Jan 9, 2025
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
7 changes: 3 additions & 4 deletions include/ddc/discrete_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,9 @@ class DiscreteDomain<>

KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteDomain() = default;

// Construct a DiscreteDomain from a reordered copy of `domain`
template <class... ODDims>
KOKKOS_FUNCTION constexpr explicit DiscreteDomain(
[[maybe_unused]] DiscreteDomain<ODDims...> const& domain)
/// Construct a DiscreteDomain by copies and merge of domains
template <class... DDoms, class = std::enable_if_t<(is_discrete_domain_v<DDoms> && ...)>>
KOKKOS_FUNCTION constexpr explicit DiscreteDomain([[maybe_unused]] DDoms const&... domains)
{
}

Expand Down
8 changes: 3 additions & 5 deletions tests/splines/batched_2d_spline_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,9 @@ void Batched2dSplineTest()
= GrevillePoints<BSplines<I1>>::template get_domain<DDimI1>();
ddc::DiscreteDomain<DDimI2> const interpolation_domain2
= GrevillePoints<BSplines<I2>>::template get_domain<DDimI2>();
// The following line creates a discrete domain over all dimensions (DDims...) where we immediately
// remove the dimensions DDimI1 and DDimI2.
ddc::remove_dims_of_t<ddc::DiscreteDomain<DDims...>, DDimI1, DDimI2> const dom_vals_tmp(
ddc::DiscreteDomain<DDims...>(
ddc::DiscreteDomain<DDims>(DElem<DDims>(0), DVect<DDims>(ncells))...));
// The following line creates a discrete domain over all dimensions (DDims...) except DDimI1 and DDimI2.
auto const dom_vals_tmp = ddc::remove_dims_of_t<ddc::DiscreteDomain<DDims...>, DDimI1, DDimI2>(
ddc::DiscreteDomain<DDims>(DElem<DDims>(0), DVect<DDims>(ncells))...);
ddc::DiscreteDomain<DDims...> const
dom_vals(dom_vals_tmp, interpolation_domain1, interpolation_domain2);

Expand Down
8 changes: 3 additions & 5 deletions tests/splines/batched_spline_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,9 @@ void BatchedSplineTest()
// Create the values domain (mesh)
ddc::DiscreteDomain<DDimI> const interpolation_domain
= GrevillePoints<BSplines<I>>::template get_domain<DDimI>();
// The following line creates a discrete domain over all dimensions (DDims...) where we immediately
// remove the dimension DDimI.
ddc::remove_dims_of_t<ddc::DiscreteDomain<DDims...>, DDimI> const dom_vals_tmp(
ddc::DiscreteDomain<DDims...>(
ddc::DiscreteDomain<DDims>(DElem<DDims>(0), DVect<DDims>(ncells))...));
// The following line creates a discrete domain over all dimensions (DDims...) except DDimI.
auto const dom_vals_tmp = ddc::remove_dims_of_t<ddc::DiscreteDomain<DDims...>, DDimI>(
ddc::DiscreteDomain<DDims>(DElem<DDims>(0), DVect<DDims>(ncells))...);
ddc::DiscreteDomain<DDims...> const dom_vals(dom_vals_tmp, interpolation_domain);

#if defined(BC_HERMITE)
Expand Down
8 changes: 3 additions & 5 deletions tests/splines/extrapolation_rule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,9 @@ void ExtrapolationRuleSplineTest()
ddc::DiscreteDomain<DDimI1, DDimI2> const interpolation_domain(
GrevillePoints1<BSplines<I1>>::template get_domain<DDimI1>(),
GrevillePoints2<BSplines<I2>>::template get_domain<DDimI2>());
// The following line creates a discrete domain over all dimensions (DDims...) where we immediately
// remove the dimensions DDimI1 and DDimI2.
ddc::remove_dims_of_t<ddc::DiscreteDomain<DDims...>, DDimI1, DDimI2> const dom_vals_tmp(
ddc::DiscreteDomain<DDims...>(
ddc::DiscreteDomain<DDims>(DElem<DDims>(0), DVect<DDims>(ncells))...));
// The following line creates a discrete domain over all dimensions (DDims...) except DDimI1 and DDimI2.
auto const dom_vals_tmp = ddc::remove_dims_of_t<ddc::DiscreteDomain<DDims...>, DDimI1, DDimI2>(
ddc::DiscreteDomain<DDims>(DElem<DDims>(0), DVect<DDims>(ncells))...);
ddc::DiscreteDomain<DDims...> const dom_vals(dom_vals_tmp, interpolation_domain);

// Create a SplineBuilder over BSplines<I> and batched along other dimensions using some boundary conditions
Expand Down
Loading