Skip to content

Commit

Permalink
template interpolation test
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Feb 8, 2025
1 parent 3d577ff commit b0892b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ class SurfaceInterpolation
interpolationKernel_->interpolate(volField, surfaceField);
}

void interpolate(const VolumeField<Vector>& volField, SurfaceField<Vector>& surfaceField) const
{
interpolationKernel_->interpolate(volField, surfaceField);
}


ScalarSurfaceField interpolate(const VolumeField<scalar>& volField) const
{
std::string nameInterpolated = "interpolated_" + volField.name;
Expand Down
13 changes: 10 additions & 3 deletions test/finiteVolume/cellCentred/interpolation/linear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#include <catch2/catch_session.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators_all.hpp>
#include <catch2/catch_template_test_macros.hpp>

#include "NeoFOAM/NeoFOAM.hpp"

using NeoFOAM::finiteVolume::cellCentred::SurfaceInterpolation;
using NeoFOAM::finiteVolume::cellCentred::VolumeField;
using NeoFOAM::finiteVolume::cellCentred::SurfaceField;

TEST_CASE("linear")
TEMPLATE_TEST_CASE("linear", "", NeoFOAM::scalar, NeoFOAM::Vector)
{
NeoFOAM::Executor exec = GENERATE(
NeoFOAM::Executor(NeoFOAM::SerialExecutor {}),
Expand All @@ -26,8 +27,14 @@ TEST_CASE("linear")
NeoFOAM::Input input = NeoFOAM::TokenList({std::string("linear")});
auto linear = SurfaceInterpolation(exec, mesh, input);

auto in = VolumeField<NeoFOAM::scalar>(exec, "in", mesh, {});
auto out = SurfaceField<NeoFOAM::scalar>(exec, "out", mesh, {});
auto in = VolumeField<TestType>(exec, "in", mesh, {});
auto out = SurfaceField<TestType>(exec, "out", mesh, {});

// FIXME add fill

Check failure on line 33 in test/finiteVolume/cellCentred/interpolation/linear.cpp

View workflow job for this annotation

GitHub Actions / FIXME check

// FIXME add fill
// fill(in.internalField(), 1);

linear.interpolate(in, out);

// FIXME add fill

Check failure on line 38 in test/finiteVolume/cellCentred/interpolation/linear.cpp

View workflow job for this annotation

GitHub Actions / FIXME check

// FIXME add fill
// REQUIRE(out.internalField()[0] == one<TestType>::value);
}

0 comments on commit b0892b2

Please sign in to comment.