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()

Enabling the module means that it will be executed at each time step.

enable()

Enabling the module means that it will be executed at each time step.

interpolate(f, destination)

Interpolate the field to the destination position.

interpolate_axis(f, axis, destination)

is_enabled()

Return whether the module is enabled or not.

reset()

Stop and start the module.

setup(mset)

Start the module

start()

Start the module

stop()

Stop the module

update(mz)

Update the module

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.

mset

The model settings

name

required_halo

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

Start the module

Description#

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

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

Interpolate the field to the destination position.

Parameters#

ffr.FieldVariable

The field to interpolate.

destinationfr.grid.Position

The position to interpolate to.

Returns#

fr.FieldVariable

The interpolated field.

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