|
fitpack
Modern Fortran library for curve and surface fitting with splines
|
Bicubic spline fitter for data scattered over a general polar domain. More...


Public Member Functions | |
| procedure | destroy (this) |
| Clean memory. | |
| procedure | new_points (this, x, y, z, boundary, w, boundary_bc) |
| Set new points. | |
| procedure | new_fit (this, x, y, z, boundary, w, boundary_bc, smoothing) |
| Generate new fit. | |
| procedure | fit (this, smoothing, keep_knots) |
| Generate/update fitting curve, with optional smoothing. | |
| procedure | least_squares (this, smoothing, reset_knots) |
| Fit a least-squares polar surface with fixed knots. | |
| procedure | interpolate (this, reset_knots) |
| Fit an interpolating polar surface ( \( s = 0 \)). | |
| generic | eval (this, x, y, ierr) |
| Evaluate polar domain at given x,y coordinates. | |
| generic | eval (this, x, y, ierr) |
| Evaluate the polar surface at multiple Cartesian points. | |
| procedure | comm_size (this) |
| Communication interface. | |
| procedure | comm_pack (this, buffer) |
| Pack polar surface data into a communication buffer. | |
| procedure | comm_expand (this, buffer) |
| Expand polar surface data from a communication buffer. | |
| type(fitpack_polar) function | polr_new_from_points (x, y, z, boundary, w, boundary_bc, ierr) |
| Construct a polar surface from scattered data and perform a default fit. | |
Public Member Functions inherited from fitpack_fitters::fitpack_fitter | |
| procedure, non_overridable | mse (this) |
| MSE accessor (shared by all types) | |
| procedure, non_overridable | core_comm_size (this) |
| Base field helpers for comm (non-overridable, called by subtypes) | |
| procedure, non_overridable | core_comm_pack (this, buffer) |
| Pack base fields into communication buffer. | |
| procedure, non_overridable | core_comm_expand (this, buffer) |
| Expand base fields from communication buffer. | |
| procedure, non_overridable | destroy_base (this) |
| Base field reset (called by subtype destroy methods) | |
| procedure(comm_size_if), deferred | comm_size (this) |
| Deferred communication interface. | |
| procedure(comm_pack_if), deferred | comm_pack (this, buffer) |
| procedure(comm_expand_if), deferred | comm_expand (this, buffer) |
Public Attributes | |
| integer | m = 0 |
| Scattered data points. | |
| real(fp_real), dimension(:), allocatable | x |
| real(fp_real), dimension(:), allocatable | y |
| real(fp_real), dimension(:), allocatable | z |
| Function values at the points. | |
| real(fp_real), dimension(:), allocatable | u |
| Coordinates of the data points in rectangular coordinates (u,v) | |
| real(fp_real), dimension(:), allocatable | v |
| real(fp_real), dimension(:), allocatable | w |
| integer | lwrk2 = 0 |
| real(fp_real), dimension(:), allocatable | wrk2 |
| integer | bc_continuity_origin = 2 |
| integer | bc_boundary = OUTSIDE_EXTRAPOLATE |
| integer, dimension(2) | nest = 0 |
| integer | nmax = 0 |
| integer, dimension(2) | knots = 0 |
| real(fp_real), dimension(:,:), allocatable | t |
Public Attributes inherited from fitpack_fitters::fitpack_fitter | |
| integer(fp_flag) | iopt = IOPT_NEW_SMOOTHING |
| Fitting state flag. | |
| real(fp_real) | smoothing = 1000.0_FP_REAL |
| Smoothing parameter. | |
| real(fp_real) | fp = zero |
| Weighted sum of squared residuals. | |
| real(fp_real), dimension(:), allocatable | c |
| B-spline coefficients. | |
| integer(fp_size) | lwrk = 0 |
| Real workspace and its size. | |
| real(fp_real), dimension(:), allocatable | wrk |
| integer(fp_size) | liwrk = 0 |
| Integer workspace and its size. | |
| integer(fp_size), dimension(:), allocatable | iwrk |
Static Public Attributes | |
| procedure(fitpack_polar_boundary), pointer, nopass | rad => null() |
| Function that describes shape of the polar boundary: radius as a function of angle theta: x = rad(v)*cos(v) , y = rad(v)*sin(v), -pi <= v <= pi. | |
Private Member Functions | |
| procedure, private | polr_eval_one (this, x, y, ierr) |
| Evaluate polar domain at given x,y coordinates. | |
| procedure, private | polr_eval_many (this, x, y, ierr) |
| Evaluate the polar surface at multiple Cartesian points. | |
Bicubic spline fitter for data scattered over a general polar domain.
Stores the scattered Cartesian data \( (x_i, y_i, z_i) \), the user-supplied boundary function \( r(\theta) \), optional weights, and the fitted B-spline representation. The smoothing parameter controls the trade-off between closeness of fit and smoothness, while continuity at the origin ( \( u = 0 \)) is enforced up to order \( C^0 \), \( C^1 \), or \( C^2 \).
| procedure fitpack_polar_domains::fitpack_polar::comm_expand | ( | class(fitpack_polar), intent(inout) | this, |
| real(fp_comm), dimension(:), intent(in) | buffer ) |
Expand polar surface data from a communication buffer.

| procedure fitpack_polar_domains::fitpack_polar::comm_pack | ( | class(fitpack_polar), intent(in) | this, |
| real(fp_comm), dimension(:), intent(out) | buffer ) |
Pack polar surface data into a communication buffer.
| procedure fitpack_polar_domains::fitpack_polar::comm_size | ( | class(fitpack_polar), intent(in) | this | ) |
Communication interface.
| procedure fitpack_polar_domains::fitpack_polar::destroy | ( | class(fitpack_polar), intent(inout) | this | ) |
Clean memory.
| generic fitpack_polar_domains::fitpack_polar::eval | ( | class(fitpack_polar), intent(inout) | this, |
| real(fp_real), intent(in) | x, | ||
| real(fp_real), intent(in) | y, | ||
| integer, intent(out), optional | ierr ) |
Evaluate polar domain at given x,y coordinates.
Internally transforms to normalized polar coordinates before evaluation.

| generic fitpack_polar_domains::fitpack_polar::eval | ( | class(fitpack_polar), intent(inout) | this, |
| real(fp_real), dimension(:), intent(in) | x, | ||
| real(fp_real), dimension(size(x)), intent(in) | y, | ||
| integer, intent(out), optional | ierr ) |
Evaluate the polar surface at multiple Cartesian points.
| procedure fitpack_polar_domains::fitpack_polar::fit | ( | class(fitpack_polar), intent(inout) | this, |
| real(fp_real), intent(in), optional | smoothing, | ||
| logical, intent(in), optional | keep_knots ) |
Generate/update fitting curve, with optional smoothing.
The fitting uses normalized polar coordinates \( (u, v) \) with a user-supplied boundary function \( r(\theta) \). Continuity at the origin is controlled by bc_continuity_origin.
| procedure fitpack_polar_domains::fitpack_polar::interpolate | ( | class(fitpack_polar), intent(inout) | this, |
| logical, intent(in), optional | reset_knots ) |
Fit an interpolating polar surface ( \( s = 0 \)).
| procedure fitpack_polar_domains::fitpack_polar::least_squares | ( | class(fitpack_polar), intent(inout) | this, |
| real(fp_real), intent(in), optional | smoothing, | ||
| logical, intent(in), optional | reset_knots ) |
Fit a least-squares polar surface with fixed knots.
| procedure fitpack_polar_domains::fitpack_polar::new_fit | ( | class(fitpack_polar), intent(inout) | this, |
| real(fp_real), dimension(:), intent(in) | x, | ||
| real(fp_real), dimension(size(x)), intent(in) | y, | ||
| real(fp_real), dimension(size(x)), intent(in) | z, | ||
| procedure(fitpack_polar_boundary) | boundary, | ||
| real(fp_real), dimension(size(x)), intent(in), optional | w, | ||
| integer, intent(in), optional | boundary_bc, | ||
| real(fp_real), intent(in), optional | smoothing ) |
Generate new fit.
| procedure fitpack_polar_domains::fitpack_polar::new_points | ( | class(fitpack_polar), intent(inout) | this, |
| real(fp_real), dimension(:), intent(in) | x, | ||
| real(fp_real), dimension(size(x)), intent(in) | y, | ||
| real(fp_real), dimension(size(x)), intent(in) | z, | ||
| procedure(fitpack_polar_boundary) | boundary, | ||
| real(fp_real), dimension(size(x)), intent(in), optional | w, | ||
| integer, intent(in), optional | boundary_bc ) |
Set new points.
| [in,out] | this | The polar surface (destroyed and reinitialized). |
| [in] | x | Cartesian x coordinates. |
| [in] | y | Cartesian y coordinates, same size as x. |
| [in] | z | Function values, same size as x. |
| [in] | boundary | Boundary function \( r(\theta) \) defining the polar domain. |
| [in] | w | Optional positive weights. |
| [in] | boundary_bc | Optional boundary extrapolation flag. |
|
private |
Evaluate the polar surface at multiple Cartesian points.
|
private |
Evaluate polar domain at given x,y coordinates.
Internally transforms to normalized polar coordinates before evaluation.
| type(fitpack_polar) function fitpack_polar_domains::fitpack_polar::polr_new_from_points | ( | real(fp_real), dimension(:), intent(in) | x, |
| real(fp_real), dimension(size(x)), intent(in) | y, | ||
| real(fp_real), dimension(size(x)), intent(in) | z, | ||
| procedure(fitpack_polar_boundary) | boundary, | ||
| real(fp_real), dimension(size(x)), intent(in), optional | w, | ||
| integer, intent(in), optional | boundary_bc, | ||
| integer, intent(out), optional | ierr ) |
Construct a polar surface from scattered data and perform a default fit.

| integer fitpack_polar_domains::fitpack_polar::bc_boundary = OUTSIDE_EXTRAPOLATE |
| integer fitpack_polar_domains::fitpack_polar::bc_continuity_origin = 2 |
| integer, dimension(2) fitpack_polar_domains::fitpack_polar::knots = 0 |
| integer fitpack_polar_domains::fitpack_polar::lwrk2 = 0 |
| integer fitpack_polar_domains::fitpack_polar::m = 0 |
Scattered data points.
| integer, dimension(2) fitpack_polar_domains::fitpack_polar::nest = 0 |
| integer fitpack_polar_domains::fitpack_polar::nmax = 0 |
|
static |
| real(fp_real), dimension(:,:), allocatable fitpack_polar_domains::fitpack_polar::t |
| real(fp_real), dimension(:), allocatable fitpack_polar_domains::fitpack_polar::u |
Coordinates of the data points in rectangular coordinates (u,v)
| real(fp_real), dimension(:), allocatable fitpack_polar_domains::fitpack_polar::v |
| real(fp_real), dimension(:), allocatable fitpack_polar_domains::fitpack_polar::w |
| real(fp_real), dimension(:), allocatable fitpack_polar_domains::fitpack_polar::wrk2 |
| real(fp_real), dimension(:), allocatable fitpack_polar_domains::fitpack_polar::x |
| real(fp_real), dimension(:), allocatable fitpack_polar_domains::fitpack_polar::y |
| real(fp_real), dimension(:), allocatable fitpack_polar_domains::fitpack_polar::z |
Function values at the points.