LinearInterpolation#

class fridom.framework.grid.cartesian.linear_interpolation.LinearInterpolation[source]#

Bases: InterpolationModule

Simple linear interpolation for cartesian grids.

\[f(x + 0.5 \Delta x) = \frac{1}{2} (f(x) + f(x + \Delta x))\]
__init__() None[source]#

Methods

__init__()

disable()

Disable the module.

enable()

Enable the module.

interpolate(f, destination)

Interpolate the field to the destination position.

interpolate_axis(f, axis, destination)

is_enabled()

Whether the module is enabled or not.

reset()

Stop and start the module.

setup(mset)

Set the module up.

start()

Start the module.

stop()

Stop the module.

update(mz)

Update the model state.

Attributes

diff_module

The differentiation module to be used by this module.

grid

The grid of the model settings.

info

Return a dictionary with information about the time stepper.

interp_module

The interpolation module to be used by this module.

is_setup

Whether the module is set up.

mset

The model settings.

name

required_halo

The required halo points for this module.

name = 'Linear Interpolation'#
setup(mset: ModelSettingsBase) None[source]#

Set the module up.

Description#

This method is called by the ModelSettings.setup() and sets the ModelSettings as well as the differentiation and interpolation modules.

Parameters#

msetfr.ModelSettingsBase

The model settings object.

setup_modeLiteral[“default”, “forced”]

The setup mode. If the setup mode is “default” and the module is already setup, the method will return. If the setup mode is “forced”, the module will be setup again.

interpolate(f: ScalarField, destination: Position) ScalarField[source]#

Interpolate the field to the destination position.

Parameters#

ffr.ScalarField

The field to interpolate.

destinationfr.grid.Position

The position to interpolate to.

Returns#

fr.ScalarField

The interpolated field.

interpolate_axis(f: ScalarField, axis: int, destination: AxisPosition) ScalarField[source]#