given by the span of the given B-splines (basis functions). Therefore, initialization of a 1D spline object requires an existing B-splines object, to which a private (polymorphic) pointer is associated. The B-spline coefficients are stored in a public allocatable array; at initialization the array is allocated to the proper size and all values are set to zero. In most situations the B-spline coefficients are not set directly by the end user, but are computed by some other object (e.g., a Poisson solver or a spline interpolator). Various public methods allow the user to evaluate the 1D spline S(x) and its derivative ∂S(x)/∂x any position x.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | wp | = | f64 |
Working precision |
1D spline
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public, | allocatable | :: | bcoef(:) | |||
| class(sll_c_bsplines), | private, | pointer | :: | bspl | => | null() |
| procedure, public :: init => s_spline_1d__init | |
| procedure, public :: free => s_spline_1d__free | |
| procedure, public :: belongs_to_space => f_spline_1d__belongs_to_space | |
| procedure, public :: eval => f_spline_1d__eval | |
| procedure, public :: eval_deriv => f_spline_1d__eval_deriv | |
| procedure, public :: eval_array => s_spline_1d__eval_array | |
| procedure, public :: eval_array_deriv => s_spline_1d__eval_array_deriv |
Check if 1D spline belongs to span of given B-splines
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_t_spline_1d), | intent(in) | :: | self |
1D spline |
||
| class(sll_c_bsplines), | intent(in), | target | :: | bsplines |
B-splines |
Evaluate value of 1D spline at location x: y=S(x)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_t_spline_1d), | intent(in) | :: | self |
1D spline |
||
| real(kind=wp), | intent(in) | :: | x |
evaluation point |
Evaluate derivative of 1D spline at location x: y=S'(x)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_t_spline_1d), | intent(in) | :: | self |
1D spline |
||
| real(kind=wp), | intent(in) | :: | x |
evaluation point |
Initialize 1D spline object as element of span(B-splines)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_t_spline_1d), | intent(out) | :: | self |
1D spline: new element of 1D spline space |
||
| class(sll_c_bsplines), | intent(in), | target | :: | bsplines |
B-splines: given basis of 1D spline space |
Destroy 1D spline (re-initialization is possible afterwards)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_t_spline_1d), | intent(inout) | :: | self |
1D spline |
Evaluate value of 1D spline at all locations in array x
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_t_spline_1d), | intent(in) | :: | self |
1D spline |
||
| real(kind=wp), | intent(in) | :: | x(:) | |||
| real(kind=wp), | intent(out) | :: | y(:) |
Evaluate derivative of 1D spline at all locations in array x
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sll_t_spline_1d), | intent(in) | :: | self |
1D spline |
||
| real(kind=wp), | intent(in) | :: | x(:) | |||
| real(kind=wp), | intent(out) | :: | y(:) |