Skip to content
Snippets Groups Projects
Commit f7e2b450 authored by René Fritze's avatar René Fritze Committed by René Fritze
Browse files

[py|functions] simplify bind_Spe10Model1Function

parent d3fad21b
No related branches found
No related tags found
1 merge request!31Sfinae and stuff
......@@ -29,11 +29,6 @@ namespace XT {
namespace Functions {
template <class G, size_t d, size_t r, size_t rC>
typename std::enable_if<Grid::is_grid<G>::value && d != 2, void>::type
bind_Spe10Model1Function(pybind11::module& /*m*/, const std::string& /*grid_id*/)
{}
/**
* \note We would like to drop the d template parameter and use either of
\code
......@@ -44,11 +39,7 @@ static const constexpr size_t d = G::dimension;
* everywhere: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59937
*/
template <class G, size_t d, size_t r, size_t rC>
typename std::enable_if<
Grid::is_grid<G>::value && d == 2,
pybind11::class_<Spe10::Model1Function<typename G::template Codim<0>::Entity, r, rC, double>,
GridFunctionInterface<typename G::template Codim<0>::Entity, r, rC, double>>>::type
bind_Spe10Model1Function(pybind11::module& m, const std::string& grid_id)
auto bind_Spe10Model1Function_2D(pybind11::module& m, const std::string& grid_id)
{
namespace py = pybind11;
using namespace pybind11::literals;
......@@ -113,10 +104,15 @@ bind_Spe10Model1Function(pybind11::module& m, const std::string& grid_id)
"min"_a = Spe10::internal::model1_min_value,
"max"_a = Spe10::internal::model1_max_value,
"name"_a = C::static_id());
return c;
} // ... bind_Spe10Model1Function(...)
template <class G, size_t d, size_t r, size_t rC>
void bind_Spe10Model1Function(pybind11::module& m, const std::string& grid_id)
{
if constexpr (Grid::is_grid<G>::value && d == 2) {
bind_Spe10Model1Function_2D<G, d, r, rC>(m, grid_id);
}
}
} // namespace Functions
} // namespace XT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment