Skip to content

Commit

Permalink
fix: extract_mesh (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
gouarin authored Jul 11, 2023
1 parent 7be28c4 commit 3c2c05e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/samurai/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ namespace samurai
template <class F, class... CT>
class field_function;

template <template <class T> class OP, class... CT>
class field_operator_function;

namespace detail
{

Expand Down Expand Up @@ -151,6 +154,11 @@ namespace samurai
{
};

template <template <class T> class OP, class... CT>
struct is_field_function<field_operator_function<OP, CT...>> : std::true_type
{
};

template <class... T>
auto& extract_mesh(const std::tuple<T...>& t)
{
Expand Down
2 changes: 2 additions & 0 deletions test/test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <samurai/box.hpp>
#include <samurai/field.hpp>
#include <samurai/stencil_field.hpp>
#include <samurai/uniform_mesh.hpp>
#include <samurai/utils.hpp>

Expand All @@ -18,5 +19,6 @@ namespace samurai
auto u = make_field<double, 1>("u", mesh);

static_assert(detail::is_field_function<decltype(5 + u)>::value);
static_assert(detail::is_field_function<decltype(upwind(1, u))>::value);
}
}

0 comments on commit 3c2c05e

Please sign in to comment.