Struct PostProcess

Source
pub struct PostProcess {
    results: Results,
}
Expand description

The PostProcess struct handles post-processing of simulation results.

It contains the path to the results folder, the root directory, and the processed results.

The struct uses the Results struct internally, which is expected to contain time and other data.

Fields§

§results: Results

Implementations§

Source§

impl PostProcess

Source

pub fn new(folder: &str, root: Option<String>) -> Result<Self, ApiError>

Creates a new instance of PostProcess.

§Arguments
  • folder - The name of the folder containing the simulation results.
  • root - Optional root directory. Defaults to “./results/” if not provided.
§Returns
  • Result<Self, String> - Returns the PostProcess instance or an error message if initialization fails.

Trait Implementations§

Source§

impl Debug for PostProcess

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ModelEstimator for PostProcess

Source§

fn mu_direct(&self) -> Result<Array1<f64>, ApiError>

Source§

fn estimate( &self, etype: Estimator, key: &str, i_export: usize, ) -> Result<f64, ApiError>

Source§

fn estimate_time( &self, etype: Estimator, key: &str, ) -> Result<Array1<f64>, ApiError>

Source§

impl PostProcessReader for PostProcess

Source§

fn time_array(&self) -> Array1<f64>

Returns an ArrayView1<f64> representing the time data from the simulation results.

§Returns
  • An ArrayView1<f64> containing the time data.
Source§

fn get_max_n_export_bio(&self) -> usize

Retrieves the maximum number of export events specifically related to biological dumps from the simulation results. This value represents the real number of biological export events, which may not always align with the total number of exports.

§Returns
  • usize - The maximum number of biological export events, or 0 if no events are found or if an error occurs.
Source§

fn n_export(&self) -> usize

Returns the total number of export events from the simulation results. This count includes all export actions, regardless of whether they are biological or not.

§Returns
  • usize - The total number of export events.
Source§

fn get_biomass_concentration(&self) -> Result<Array2<f64>, ApiError>

Calculates the biomass concentration over time for the simulation.

§Returns
  • Result<Array2<f64>, String> - A 2D array with biomass concentrations or an error message.
Source§

fn get_growth_in_number(&self) -> Array1<f64>

Calculates the total growth in number

§Returns
  • Array1<f64> - 1D array containing the summed growth numbers.
Source§

fn get_number_particle(&self) -> &Array2<f64>

Retrieves the 2D array of particle numbers.

§Returns
  • &Array2<f64> - Reference to the 2D array containing particle numbers.
Source§

fn get_properties( &self, key: &str, i_export: usize, ) -> Result<Array1<f64>, ApiError>

Fetches specific properties of the model at a given export index.

§Arguments
  • key - The property key to fetch.
  • i_export - The index of the export to retrieve.
§Returns
  • Result<Array1<f64>, String> - A 1D array of property values or an error message.
Source§

fn get_time_population_mean(&self, key: &str) -> Result<Array1<f64>, ApiError>

Calculates the population mean over time for a given property key.

§Arguments
  • key - The property key for which to calculate the mean.
§Returns
  • Result<Array1<f64>, String> - A 1D array of mean values over time or an error message.
Source§

fn time(&self) -> &[f64]

Returns a reference to the time data from the simulation results. Read more
Source§

fn weight(&self) -> &Weight

Returns a weight chosen for simulation Read more
Source§

fn get_property_names(&self) -> Vec<String>

Returns model’s property names Read more
Source§

fn get_spatial_average_mtr( &self, species: usize, ) -> Result<Array1<f64>, ApiError>

Source§

fn v_liquid(&self) -> ArrayView2<'_, f64>

Source§

fn get_variance_concentration( &self, species: usize, phase: Phase, ) -> Result<Array1<f64>, ApiError>

Source§

fn get_concentrations(&self, phase: Phase) -> ArrayView3<'_, f64>

Source§

fn get_spatial_average_concentration( &self, species: usize, phase: Phase, ) -> Array1<f64>

Computes the spatial average concentration for a specific species and phase. Read more
Source§

fn get_spatial_average_biomass_concentration( &self, ) -> Result<Array1<f64>, ApiError>

Source§

fn get_time_average_concentration( &self, species: usize, position: usize, phase: Phase, ) -> Result<Array1<f64>, ApiError>

Computes the time average concentration for a specific species, position, and phase. Read more
Source§

fn get_spatial_average_property( &self, key: &str, ) -> Result<Array2<f64>, ApiError>

Source§

fn get_probes(&self) -> Result<Array1<f64>, ApiError>

Source§

fn get_histogram_array( &self, n_bins: usize, i_export: usize, key: &str, ) -> Result<(Array1<f64>, Array1<f64>), ApiError>

Retrieves histogram data for a specific property key at a given export index. Read more
Source§

fn get_histogram( &self, n_bins: usize, i_export: usize, key: &str, ) -> Result<(Vec<f64>, Vec<f64>), ApiError>

Retrieves histogram data for a specific property key at a given export index. Read more
Source§

fn get_population_mean( &self, key: &str, i_export: usize, ) -> Result<f64, ApiError>

Retrieves the population mean for a specific property key at a given export index. Read more
Source§

fn tallies(&self) -> Option<&Tallies>

Returns Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.