Skip to main content

Function

Trait Function 

Source
pub trait Function<const N: usize> {
    type Error;

    // Required method
    fn evaluate(
        &self,
        engine: impl Engine<N>,
        input: ImageRef<'_>,
        output: ImageMut<'_>,
    ) -> Result<(), Self::Error>;

    // Provided method
    fn preprocess(
        &mut self,
        _mesh: &mut Mesh<N>,
        _input: ImageMut<'_>,
    ) -> Result<(), Self::Error> { ... }
}
Expand description

A function maps one set of scalar fields to another.

Required Associated Types§

Required Methods§

Source

fn evaluate( &self, engine: impl Engine<N>, input: ImageRef<'_>, output: ImageMut<'_>, ) -> Result<(), Self::Error>

Action of the function on an individual finite different block.

Provided Methods§

Source

fn preprocess( &mut self, _mesh: &mut Mesh<N>, _input: ImageMut<'_>, ) -> Result<(), Self::Error>

An (optional) preprocessing step run immediately before a function is applied, after boundary conditions have been filled.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, const N: usize, F: Function<N>> Function<N> for FunctionBorrowMut<'a, F>

Source§

type Error = <F as Function<N>>::Error