spline_distributions.py

Helper function to create non uniform distributions for SplineComp.

openmdao.utils.spline_distributions.cell_centered(num_cells, start=0.0, end=1.0)[source]

Cell centered distribution of control points.

Parameters
num_cellsint

Number of cells.

startint or float

Minimum value to interpolate at.

endint or float

Maximum value to interpolate at.

Returns
ndarray

Values to interpolate at.

openmdao.utils.spline_distributions.node_centered(num_points, start=0.0, end=1.0)[source]

Distribute control points.

Parameters
num_pointsint

Number of points to predict.

startint or float

Minimum value to interpolate at.

endint or float

Maximum value to interpolate at.

Returns
ndarray

Values to interpolate at.

openmdao.utils.spline_distributions.sine_distribution(num_points, start=0.0, end=1.0, phase=3.141592653589793)[source]

Sine distribution of control points.

Parameters
num_pointsint

Number of points to predict at.

startint or float

Minimum value to interpolate at.

endint or float

Maximum value to interpolate at.

phasefloat

Phase of the sine wave

Returns
ndarray

Values to interpolate at.