initialize the rProfile of type bspline
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | knots(:) |
knots of the B-Spline with repeated start and end points |
||
| real(kind=wp), | intent(in) | :: | coefs(:) |
B-Spline coefficients |
self
FUNCTION bsplProfile_new(knots, coefs) RESULT(sf) ! MODULES !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES REAL(wp), INTENT(IN) :: knots(:) !! knots of the B-Spline with repeated start and end points REAL(wp), INTENT(IN) :: coefs(:) !! B-Spline coefficients !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES TYPE(t_rProfile_bspl) :: sf !! self !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES INTEGER :: n_knots, n_coefs !=================================================================================================================================== n_knots=SIZE(knots) n_coefs=SIZE(coefs) sf%deg = COUNT((ABS(knots-knots(1)).LE.1E-12))-1 ! multiplicity of the first knot determines the degree IF(COUNT((ABS(knots-knots(n_knots)).LE.1E-12)).NE.sf%deg+1) THEN CALL abort(__STAMP__, & "The Bspline knot sequence need the same multiplicity at the beginning and end (=degree+1).") END IF IF (n_coefs .NE. n_knots-sf%deg-1) THEN CALL abort(__STAMP__, & "Number of Bspline coeffcients must be number of knots - (degree+1)!") END IF sf%n_knots = n_knots sf%n_coefs = n_coefs ALLOCATE(sf%knots(1:n_knots), sf%coefs(1:n_coefs)) sf%knots = knots sf%coefs = coefs IF (sf%deg>0) THEN CALL sll_s_bsplines_new(sf%bspl, sf%deg, .FALSE., & sf%knots(1),sf%knots(n_knots),& size(sf%knots(sf%deg+1:n_knots-sf%deg))-1 , & ! number of knots handed to the library sf%knots(sf%deg+1:n_knots-sf%deg)) ! remove repeated edge knots END IF END FUNCTION bsplProfile_new