pub trait Parameter where
Self: Sized, {
type Pure: Clone + DeserializeOwned + Default;
type IdealGas: Clone + DeserializeOwned + Default;
type Binary: Clone + DeserializeOwned + Default;
fn from_records(
pure_records: Vec<PureRecord<Self::Pure, Self::IdealGas>>,
binary_records: Array2<Self::Binary>
) -> Self;
fn records(
&self
) -> (&[PureRecord<Self::Pure, Self::IdealGas>], &Array2<Self::Binary>);
fn new_pure(pure_record: PureRecord<Self::Pure, Self::IdealGas>) -> Self { ... }
fn new_binary(
pure_records: Vec<PureRecord<Self::Pure, Self::IdealGas>>,
binary_record: Option<Self::Binary>
) -> Self { ... }
fn from_json<P>(
substances: Vec<&str>,
file_pure: P,
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError>
where
P: AsRef<Path>,
{ ... }
fn from_multiple_json<P>(
input: &[(Vec<&str>, P)],
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError>
where
P: AsRef<Path>,
{ ... }
fn from_segments(
chemical_records: Vec<ChemicalRecord>,
segment_records: Vec<SegmentRecord<Self::Pure, Self::IdealGas>>,
binary_segment_records: Option<Vec<BinaryRecord<String, Self::Binary>>>
) -> Result<Self, ParameterError>
where
Self::Pure: FromSegments,
Self::IdealGas: FromSegments,
Self::Binary: FromSegmentsBinary + Default,
{ ... }
fn from_json_segments<P>(
substances: &[&str],
file_pure: P,
file_segments: P,
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError>
where
P: AsRef<Path>,
Self::Pure: FromSegments,
Self::IdealGas: FromSegments,
Self::Binary: FromSegmentsBinary,
{ ... }
fn subset(&self, component_list: &[usize]) -> Self { ... }
}
Expand description
Constructor methods for parameters.
By implementing Parameter
for a type, you define how parameters
of an equation of state can be constructed from a sequence of
single substance records and possibly binary interaction parameters.
Associated Types
type Pure: Clone + DeserializeOwned + Default
type IdealGas: Clone + DeserializeOwned + Default
type Binary: Clone + DeserializeOwned + Default
Required methods
fn from_records(
pure_records: Vec<PureRecord<Self::Pure, Self::IdealGas>>,
binary_records: Array2<Self::Binary>
) -> Self
fn from_records(
pure_records: Vec<PureRecord<Self::Pure, Self::IdealGas>>,
binary_records: Array2<Self::Binary>
) -> Self
Creates parameters from records for pure substances and possibly binary parameters.
Provided methods
fn new_pure(pure_record: PureRecord<Self::Pure, Self::IdealGas>) -> Self
fn new_pure(pure_record: PureRecord<Self::Pure, Self::IdealGas>) -> Self
Creates parameters for a pure component from a pure record.
fn new_binary(
pure_records: Vec<PureRecord<Self::Pure, Self::IdealGas>>,
binary_record: Option<Self::Binary>
) -> Self
fn new_binary(
pure_records: Vec<PureRecord<Self::Pure, Self::IdealGas>>,
binary_record: Option<Self::Binary>
) -> Self
Creates parameters for a binary system from pure records and an optional binary interaction parameter.
fn from_json<P>(
substances: Vec<&str>,
file_pure: P,
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError> where
P: AsRef<Path>,
fn from_json<P>(
substances: Vec<&str>,
file_pure: P,
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError> where
P: AsRef<Path>,
Creates parameters from substance information stored in json files.
fn from_multiple_json<P>(
input: &[(Vec<&str>, P)],
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError> where
P: AsRef<Path>,
fn from_multiple_json<P>(
input: &[(Vec<&str>, P)],
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError> where
P: AsRef<Path>,
Creates parameters from substance information stored in multiple json files.
fn from_segments(
chemical_records: Vec<ChemicalRecord>,
segment_records: Vec<SegmentRecord<Self::Pure, Self::IdealGas>>,
binary_segment_records: Option<Vec<BinaryRecord<String, Self::Binary>>>
) -> Result<Self, ParameterError> where
Self::Pure: FromSegments,
Self::IdealGas: FromSegments,
Self::Binary: FromSegmentsBinary + Default,
fn from_segments(
chemical_records: Vec<ChemicalRecord>,
segment_records: Vec<SegmentRecord<Self::Pure, Self::IdealGas>>,
binary_segment_records: Option<Vec<BinaryRecord<String, Self::Binary>>>
) -> Result<Self, ParameterError> where
Self::Pure: FromSegments,
Self::IdealGas: FromSegments,
Self::Binary: FromSegmentsBinary + Default,
Creates parameters from the molecular structure and segment information.
The FromSegments trait needs to be implemented for both the model record and the ideal gas record.
fn from_json_segments<P>(
substances: &[&str],
file_pure: P,
file_segments: P,
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError> where
P: AsRef<Path>,
Self::Pure: FromSegments,
Self::IdealGas: FromSegments,
Self::Binary: FromSegmentsBinary,
fn from_json_segments<P>(
substances: &[&str],
file_pure: P,
file_segments: P,
file_binary: Option<P>,
search_option: IdentifierOption
) -> Result<Self, ParameterError> where
P: AsRef<Path>,
Self::Pure: FromSegments,
Self::IdealGas: FromSegments,
Self::Binary: FromSegmentsBinary,
Creates parameters from segment information stored in json files.
The FromSegments trait needs to be implemented for both the model record and the ideal gas record.