pub trait FunctionalContribution: Sync + Send {
// Required methods
fn name(&self) -> &'static str;
fn weight_functions<N: DualNum<f64> + Copy>(
&self,
temperature: N,
) -> WeightFunctionInfo<N>;
fn helmholtz_energy_density<N: DualNum<f64> + Copy>(
&self,
temperature: N,
weighted_densities: ArrayView2<'_, N>,
) -> FeosResult<Array1<N>>;
// Provided methods
fn weight_functions_pdgt<N: DualNum<f64> + Copy>(
&self,
temperature: N,
) -> WeightFunctionInfo<N> { ... }
fn bulk_helmholtz_energy_density<N: DualNum<f64> + Copy>(
&self,
state: &StateHD<N>,
) -> N { ... }
fn first_partial_derivatives<N: DualNum<f64> + Copy>(
&self,
temperature: N,
weighted_densities: Array2<N>,
helmholtz_energy_density: ArrayViewMut1<'_, N>,
first_partial_derivative: ArrayViewMut2<'_, N>,
) -> FeosResult<()> { ... }
fn second_partial_derivatives(
&self,
temperature: f64,
weighted_densities: ArrayView2<'_, f64>,
helmholtz_energy_density: ArrayViewMut1<'_, f64>,
first_partial_derivative: ArrayViewMut2<'_, f64>,
second_partial_derivative: ArrayViewMut3<'_, f64>,
) -> FeosResult<()> { ... }
}Expand description
Individual functional contribution that can be evaluated using generalized (hyper) dual numbers.
Required Methods§
Sourcefn weight_functions<N: DualNum<f64> + Copy>(
&self,
temperature: N,
) -> WeightFunctionInfo<N>
fn weight_functions<N: DualNum<f64> + Copy>( &self, temperature: N, ) -> WeightFunctionInfo<N>
Return the weight functions required in this contribution.
Sourcefn helmholtz_energy_density<N: DualNum<f64> + Copy>(
&self,
temperature: N,
weighted_densities: ArrayView2<'_, N>,
) -> FeosResult<Array1<N>>
fn helmholtz_energy_density<N: DualNum<f64> + Copy>( &self, temperature: N, weighted_densities: ArrayView2<'_, N>, ) -> FeosResult<Array1<N>>
Return the Helmholtz energy density for the given temperature and weighted densities.
Provided Methods§
Sourcefn weight_functions_pdgt<N: DualNum<f64> + Copy>(
&self,
temperature: N,
) -> WeightFunctionInfo<N>
fn weight_functions_pdgt<N: DualNum<f64> + Copy>( &self, temperature: N, ) -> WeightFunctionInfo<N>
Overwrite this if the weight functions in pDGT are different than for DFT.
fn bulk_helmholtz_energy_density<N: DualNum<f64> + Copy>( &self, state: &StateHD<N>, ) -> N
fn first_partial_derivatives<N: DualNum<f64> + Copy>( &self, temperature: N, weighted_densities: Array2<N>, helmholtz_energy_density: ArrayViewMut1<'_, N>, first_partial_derivative: ArrayViewMut2<'_, N>, ) -> FeosResult<()>
fn second_partial_derivatives( &self, temperature: f64, weighted_densities: ArrayView2<'_, f64>, helmholtz_energy_density: ArrayViewMut1<'_, f64>, first_partial_derivative: ArrayViewMut2<'_, f64>, second_partial_derivative: ArrayViewMut3<'_, f64>, ) -> FeosResult<()>
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.