Skip to main content

PropertyAD

Trait PropertyAD 

Source
pub trait PropertyAD<N: Dim>: for<'a> From<&'a [f64]>{
    type Unit;

    const REFERENCE: Quantity<f64, Self::Unit>;

    // Required method
    fn evaluate<E: Residual<N, D>, D: DualNum<f64, Inner = f64> + Copy>(
        &self,
        eos: &E,
    ) -> FeosResult<Quantity<D, Self::Unit>>;

    // Provided methods
    fn evaluate_gradient<E: Residual<N, DualSVec<f64, f64, P>>, const P: usize>(
        &self,
        eos: &E,
    ) -> FeosResult<Quantity<DualSVec<f64, f64, P>, Self::Unit>> { ... }
    fn evaluate_parallel<E: Residual<N> + Sync>(
        eos: &E,
        input: ArrayView2<'_, f64>,
    ) -> (Array1<f64>, Array1<bool>) { ... }
    fn evaluate_parallel_derivatives<E: ParametersAD<N>, const P: usize>(
        parameter_names: [String; P],
        parameters: &[f64],
        input: ArrayView2<'_, f64>,
    ) -> (Array1<f64>, Array2<f64>, Array1<bool>)
       where E::Lifted<DualSVec<f64, f64, P>>: Sync { ... }
    fn evaluate_parallel_derivatives_params<E: ParametersAD<N>, const P: usize>(
        parameter_names: [String; P],
        parameters: ArrayView2<'_, f64>,
        input: ArrayView2<'_, f64>,
    ) -> (Array1<f64>, Array2<f64>, Array1<bool>) { ... }
}
Expand description

Properties that can be rapidly evaluated in parallel together with their gradients with respect to model parameters

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn evaluate<E: Residual<N, D>, D: DualNum<f64, Inner = f64> + Copy>( &self, eos: &E, ) -> FeosResult<Quantity<D, Self::Unit>>

Evaluate the property for an arbitrary derivative.

Provided Methods§

Source

fn evaluate_gradient<E: Residual<N, DualSVec<f64, f64, P>>, const P: usize>( &self, eos: &E, ) -> FeosResult<Quantity<DualSVec<f64, f64, P>, Self::Unit>>

Evaluate the property for the first derivative w.r.t. model parameters.

This can be overridden if there is a more performant implementation than the general implementation in evaluate.

Source

fn evaluate_parallel<E: Residual<N> + Sync>( eos: &E, input: ArrayView2<'_, f64>, ) -> (Array1<f64>, Array1<bool>)

Evaluate the property for all inputs in parallel.

Return the property values and the success of the calculations.

Source

fn evaluate_parallel_derivatives<E: ParametersAD<N>, const P: usize>( parameter_names: [String; P], parameters: &[f64], input: ArrayView2<'_, f64>, ) -> (Array1<f64>, Array2<f64>, Array1<bool>)
where E::Lifted<DualSVec<f64, f64, P>>: Sync,

Evaluate the property and its gradients for all inputs in parallel.

Return the property values, the gradients, and the success of the calculations.

Source

fn evaluate_parallel_derivatives_params<E: ParametersAD<N>, const P: usize>( parameter_names: [String; P], parameters: ArrayView2<'_, f64>, input: ArrayView2<'_, f64>, ) -> (Array1<f64>, Array2<f64>, Array1<bool>)

Evaluate the property and its gradients for all inputs and parameters in parallel.

Return the property values, the gradients, and the success of the calculations.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<N: Dim> PropertyAD<N> for LiquidDensity

Source§

const REFERENCE: Density

Source§

type Unit = <SIUnit<0, 0, 0, 0, 0, 1, 0> as Sub<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output>>::Output

Source§

impl<N: Gradients> PropertyAD<N> for BoilingTemperature

Source§

const REFERENCE: Temperature = KELVIN

Source§

type Unit = SIUnit<0, 0, 0, 0, 1, 0, 0>

Source§

impl<N: Gradients> PropertyAD<N> for BubblePointPressure

Source§

const REFERENCE: Pressure = PASCAL

Source§

type Unit = <<<SIUnit<0, 0, 1, 0, 0, 0, 0> as Add<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output>>::Output

Source§

impl<N: Gradients> PropertyAD<N> for DewPointPressure

Source§

const REFERENCE: Pressure = PASCAL

Source§

type Unit = <<<SIUnit<0, 0, 1, 0, 0, 0, 0> as Add<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output>>::Output

Source§

impl<N: Gradients> PropertyAD<N> for EnthalpyOfVaporization

Source§

const REFERENCE: MolarEnergy

Source§

type Unit = <<<SIUnit<0, 0, 1, 0, 0, 0, 0> as Add<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<0, 0, 0, 0, 0, 1, 0>>>::Output

Source§

impl<N: Gradients> PropertyAD<N> for EquilibriumLiquidDensity

Source§

const REFERENCE: Density

Source§

type Unit = <SIUnit<0, 0, 0, 0, 0, 1, 0> as Sub<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output>>::Output

Source§

impl<N: Gradients> PropertyAD<N> for ResidualIsobaricHeatCapacity

Source§

const REFERENCE: MolarEntropy

Source§

type Unit = <<<<SIUnit<0, 0, 1, 0, 0, 0, 0> as Add<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<0, 0, 0, 0, 1, 0, 0>>>::Output as Sub<SIUnit<0, 0, 0, 0, 0, 1, 0>>>::Output

Source§

impl<N: Gradients> PropertyAD<N> for VaporPressure

Source§

const REFERENCE: Pressure = PASCAL

Source§

type Unit = <<<SIUnit<0, 0, 1, 0, 0, 0, 0> as Add<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output>>::Output