Skip to content

Commit

Permalink
Merge branch 'feature/GRIDEDIT-873_fix_interpolation_in_ridge_refinem…
Browse files Browse the repository at this point in the history
…ent' of https://github.com/Deltares/MeshKernel into feature/GRIDEDIT-873_fix_interpolation_in_ridge_refinement
  • Loading branch information
lucacarniato committed Jan 25, 2024
2 parents c07baeb + 8483d6a commit 37e3c1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ namespace meshkernel

/// @brief Defines the iterpolatable data types.
template <typename T>
concept InterpolatableType =
std::same_as<T, short> ||
std::same_as<T, int> ||
std::same_as<T, float> ||
std::same_as<T, double>;
concept InterpolatableType = std::same_as<T, short> || std::same_as<T, float>;

/// @brief A class for performing bilinear interpolation on gridded samples
template <InterpolatableType T>
Expand Down
12 changes: 6 additions & 6 deletions libs/MeshKernel/tests/src/MeshRefinementTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,9 @@ TEST(MeshRefinement, BilinearInterpolationWithGriddedSamplesOnLandShouldNotRefin
// Setup
auto mesh = MakeRectangularMeshForTesting(2, 2, 10.0, Projection::cartesian);

std::vector values{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
std::vector<float> values{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
Point origin{-5.0, -5.0};
auto interpolator = std::make_unique<BilinearInterpolationOnGriddedSamples<double>>(*mesh, 2, 2, origin, 10.0, values);
auto interpolator = std::make_unique<BilinearInterpolationOnGriddedSamples<float>>(*mesh, 2, 2, origin, 10.0, values);

MeshRefinementParameters meshRefinementParameters;
meshRefinementParameters.max_num_refinement_iterations = 1;
Expand All @@ -847,9 +847,9 @@ TEST(MeshRefinement, BilinearInterpolationWithGriddedSamplesOnLandAndSeaShouldRe
// Setup
auto mesh = MakeRectangularMeshForTesting(2, 2, 10.0, Projection::cartesian);

std::vector values{-1.0, -2.0, 3.0, -4.0, -5.0, 6.0, 7.0, 8.0, 9.0};
std::vector<float> values{-1.0, -2.0, 3.0, -4.0, -5.0, 6.0, 7.0, 8.0, 9.0};
Point origin{-5.0, -5.0};
auto interpolator = std::make_unique<BilinearInterpolationOnGriddedSamples<double>>(*mesh, 3, 3, origin, 10.0, values);
auto interpolator = std::make_unique<BilinearInterpolationOnGriddedSamples<float>>(*mesh, 3, 3, origin, 10.0, values);

MeshRefinementParameters meshRefinementParameters;
meshRefinementParameters.max_num_refinement_iterations = 1;
Expand All @@ -874,9 +874,9 @@ TEST(MeshRefinement, BilinearInterpolationWithAllGriddedSamplesOnSeaShouldRefine
// Setup
auto mesh = MakeRectangularMeshForTesting(2, 2, 10.0, Projection::cartesian);

std::vector values{-1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0, -9.0};
std::vector<float> values{-1.0, -2.0, -3.0, -4.0, -5.0, -6.0, -7.0, -8.0, -9.0};
Point origin{-5.0, -5.0};
auto interpolator = std::make_unique<BilinearInterpolationOnGriddedSamples<double>>(*mesh, 2, 2, origin, 10.0, values);
auto interpolator = std::make_unique<BilinearInterpolationOnGriddedSamples<float>>(*mesh, 2, 2, origin, 10.0, values);

MeshRefinementParameters meshRefinementParameters;
meshRefinementParameters.max_num_refinement_iterations = 1;
Expand Down

0 comments on commit 37e3c1c

Please sign in to comment.