CExA-project / ddc

DDC is a discrete domain computation library.
https://ddc.mdls.fr
Other
33 stars 5 forks source link

There is no way to obtain the solver type from the SplineBuilder #611

Closed EmilyBourne closed 2 months ago

EmilyBourne commented 2 months ago

There is no class variable saving the solver type of a SplineBuilder. This makes it difficult to create builder objects in a generic way (e.g. building a refined builder)

tpadioleau commented 2 months ago

We need to inject SplineSolver Solver ? If so, in the meantime you can retrieve it with

template <typename SplineBuilder>
struct spline_builder_spline_solver;

template <
        class ExecSpace,
        class MemorySpace,
        class BSplines,
        class InterpolationDDim,
        ddc::BoundCond BcLower,
        ddc::BoundCond BcUpper,
        SplineSolver Solver,
        class... IDimX>
struct spline_builder_spline_solver<ddc::SplineBuilder<ExecSpace, MemorySpace, BSplines, InterpolationDDim, BcLower, BcUpper, Solver, IDimX...>>
{
    SplineSolver value = Solver;
};

template <typename SplineBuilder>
inline constexpr spline_builder_spline_solver_v = spline_builder_spline_solver<SplineBuilder>::value;