Spline on multipatch geometry
This directory defines structures and methods to deal with different splines on every patches. The multipatch patch operators implemented are
- Multipatch spline builder - Definition of
SplineBuilderCollectionandSplineBuilder2DCollection. - Multipatch spline evaluator - Definition of
MultipatchSplineEvaluator2D. - Multipatch extrapolation rules - Definition of extrapolation rules depending on the geometries for
MultipatchSplineEvaluator2D.
Multipatch spline builder
The SplineBuilderCollection and SplineBuilder2DCollection allow all the given spline builders to be called in one single line.
The template parameters of this class reproduce the SplineBuilder and SplineBuilder2D classes from DDC.
The spline coefficients and values of the functions are stored in MultipatchType objects.
The spline builders are stored inside the class in a std::tuple.
For Hermite boundary conditions, derivatives have to be provided. They are also stored in MultipatchType objects.
Example of use of SplineBuilderCollection
We define all the builders for each patch,
SplineBuilderType1 builder_1(idx_range_1);
SplineBuilderType2 builder_2(idx_range_2);
SplineBuilderType3 builder_3(idx_range_3);
...
We can instantiate a SplineBuilderCollection from these builders,
SplineBuilderCollection builder (builder_1, builder_2, builder_3);
We allocate memory for the spline representations on each patch,
SplineType1 spline_1(spline_idx_range_1);
SplineType2 spline_2(spline_idx_range_2);
SplineType3 spline_3(spline_idx_range_3);
...
MultipatchType<SplineTypeOnPatch, Patch1, Patch2, Patch3> patches_splines (spline_1, spline_2, spline_3);
We do the same with the values of the function,
ValuesType1 values_1(idx_range_1);
ValuesType2 values_2(idx_range_2);
ValuesType3 values_3(idx_range_3);
...
// initialisation
...
MultipatchType<ValuesTypeOnPatch, Patch1, Patch2, Patch3> patches_values (values_1, values_2, values_3);
And we build the spline representation on every patch using,
builder(patches_splines, patches_values);
Multipatch spline evaluator
The MultipatchSplineEvaluator2D allows all the spline evaluators to be called in one single line.
Contrary to the SplineBuilderCollection class, the spline evaluators are not given as input but we directly
compute the evaluation inside the class. The template parameters and aliases are similar to the ones in the SplineEvaluator2D
class in DDC.
To instantiate a MultipatchSplineEvaluator2D, we need a patch locator operator to be able to determine on which patch the given (see Connectivity)
coordinates will be physically located. We also need extrapolation rules to know what value is returned if the
coordinates are outside the domain. Multi-patch extrapolation rules are implemented and defined below Multipatch extrapolation rules.
The coordinates are stored in fields stored in MultipatchType objects.
They are stored on patches. Each field corresponds to the coordinates stored on a given patch.
The coordinates are not enforced to be physically located on the storing patch.
For example, these coordinates can be characteristic feet stored on the patch where the initial coordinates were. Here the coordinates are in the same field if their initial coordinates were on the same patch. They are on the same storing patch, but some of them can be physically located outside the storing patch if the feet have crossed the edges.
Similarly to SplineEvaluator2D, methods to get the derivatives are implemented. No extrapolation rules are given, so MultipatchSplineEvaluator2D will throw an exception error if we give a coordinate outside the domain.
The methods implemented are
operator()to compute a single value or fields of values.deriv()to compute derivatives on the first and/or second dimension on a single coordinates or fields of coordinates.integrate()to compute the integral on each patch. The integral are stored in aKokkos::Viewdefined on host and of the same size as the number of patches.
Warning: The current version of MultipatchSplineEvaluator2D does not work on batched domain.
Warning: MultipatchSplineEvaluator2D applies to patches defined on the same continuous dimensions.
Multipatch extrapolation rules
To evaluate at a given coordinate outside the domain, extrapolation rules have been implemented. They are declined according to the geometry:
-
NullExtrapolationRule: general for every geometry. It sets the values at zero for every coordinates outside the domain. -
ConstantExtrapolationRuleOnion: specialised for onion geometries (seeOnionPatchLocatorand Connectivity). It callsddc::ConstantExtrapolationRuleto evaluate the outside coordinate. Two areas are considered as outside: with radius inferior to the minimum radius and with radius superior to the maximum radius.
Contents
constant_extrapolation_rules_onion.hpp: DefineConstantExtrapolationRuleOnion, constant extrapolation rule for onion geometries.spline_builder_2d_collection.hpp: Define theSplineBuilder2DCollectionoperator to apply 2D spline builders on every patch.spline_builder_collection.hpp: Define theSplineBuilderCollectionoperator to apply 1D spline builders on every patch.multipatch_spline_evaluator_2d.hpp: Define theMultipatchSplineEvaluator2Doperator to apply 2D spline evaluators on every patch.null_extrapolation_rules.hpp: DefineNullExtrapolationRule, a null extrapolation rule for every geometry.