58 (((ddc::is_uniform_bsplines_v<BSplineOnPatch<Patches>>)
59 || (ddc::is_non_uniform_bsplines_v<BSplineOnPatch<Patches>>))
61 "The BSplineOnPatch argument does not create 1D BSpline objects.");
63 (((ddc::is_uniform_point_sampling_v<GridOnPatch<Patches>>)
64 || (ddc::is_non_uniform_point_sampling_v<GridOnPatch<Patches>>))
66 "The GridOnPatch argument does not create 1D Grid objects.");
68 using PatchOrdering = ddc::detail::TypeSeq<Patches...>;
69 static constexpr std::size_t n_patches = ddc::type_seq_size_v<PatchOrdering>;
75 template <
class Patch,
class FieldType>
76 struct Build_BuilderType
79 !std::is_same_v<Patch, Patch>,
80 "The values should be saved in a constant field of doubles on the specified memory "
84 template <
class Patch,
class... Grid1D>
85 struct Build_BuilderType<
Patch, DConstField<IdxRange<Grid1D...>, MemorySpace>>
87 using lower_matching_edge = equivalent_edge_t<
89 typename Connectivity::interface_collection>;
90 using upper_matching_edge = equivalent_edge_t<
92 typename Connectivity::interface_collection>;
93 static constexpr std::size_t patch_id = ddc::type_seq_rank_v<Patch, PatchOrdering>;
94 using type = ddc::SplineBuilder<
97 BSplineOnPatch<Patch>,
99 std::is_same_v<lower_matching_edge, OutsideEdge> ? BcLower : BcTransition,
100 std::is_same_v<upper_matching_edge, OutsideEdge> ? BcUpper : BcTransition,
106 template <
class Patch>
107 using BuilderOnPatch =
typename Build_BuilderType<Patch, ValuesOnPatch<Patch>>::type;
110 template <
class Patch>
112 = DField<typename BuilderOnPatch<Patch>::batched_spline_domain_type, MemorySpace>;
115 template <
class Patch>
117 = DConstField<typename BuilderOnPatch<Patch>::batched_derivs_domain_type, MemorySpace>;
129 using BuilderTuple = std::tuple<BuilderOnPatch<Patches>
const&...>;
132 BuilderTuple
const m_builders;
135 template <
class Patch>
136 std::optional<DerivsOnPatch<Patch>> get_deriv_value(
137 std::optional<MultipatchDerivs> derivs)
const
139 if (derivs.has_value()) {
140 return derivs->template get<Patch>();
157 : m_builders(std::tie(builders...)) {};
173 std::optional<MultipatchDerivs> derivs_xmin = std::nullopt,
174 std::optional<MultipatchDerivs> derivs_xmax = std::nullopt)
const
176 ((std::get<BuilderOnPatch<Patches>
const&>(m_builders)(
177 splines.template get<Patches>(),
178 get_const_field(values.template get<Patches>()),
179 get_deriv_value<Patches>(derivs_xmin),
180 get_deriv_value<Patches>(derivs_xmax))),
void operator()(MultipatchSplineCoeffs splines, MultipatchValues const &values, std::optional< MultipatchDerivs > derivs_xmin=std::nullopt, std::optional< MultipatchDerivs > derivs_xmax=std::nullopt) const
Build the spline representation of each given function.
Definition multipatch_spline_builder.hpp:170
MultipatchSplineBuilder(BuilderOnPatch< Patches > const &... builders)
Instantiate the MultipatchSplineBuilder from a std::tuple of all the builder on each patch.
Definition multipatch_spline_builder.hpp:156