pub struct CMCase {
pub n_div: [u32; 3],
pub description: String,
pub time_per_flow_map: f64,
paths: HashMap<CMAExportType, String>,
pub is_recursive: bool,
}Expand description
Represents a case configuration for a computational model analysis.
Each CMCase contains information about the number of divisions, a description of the case,
the time spent per flow map, and paths to exported data based on different types.
§Fields
n_div- An array of three unsigned integers representing the number of divisions in each dimension.description- A string describing the case configuration.time_per_flow_map- A floating-point value representing the time per flow map in seconds.paths- A map from export types to file paths where the data can be accessed.
Fields§
§n_div: [u32; 3]§description: String§time_per_flow_map: f64§paths: HashMap<CMAExportType, String>§is_recursive: boolWhether the case is spread over sibling i_0/, i_1/, … folders.
The serialized name is misspelled (is_reursive) and is kept as-is for
backwards compatibility with every case file already written; the
correctly spelled is_recursive is accepted on read as well.
Implementations§
Source§impl CMCase
impl CMCase
pub fn n_compartment(&self) -> u32
pub fn toggle_recursive(&mut self)
pub fn is_two_phase_flow(&self) -> bool
pub fn add(&mut self, stype: CMAExportType, relative_path: &str)
pub fn resolve(&self, root: &str, stype: CMAExportType) -> Option<String>
pub fn resolve_all( &self, root: &str, stype: CMAExportType, ) -> Option<Vec<String>>
pub fn prepend_path(self, prep: &str) -> Self
Sourcepub fn get_folders(&self, root: &str) -> Result<Vec<String>, DataError>
pub fn get_folders(&self, root: &str) -> Result<Vec<String>, DataError>
Lists the i_<n> sub-folders of root, ordered by <n>.
§Errors
Returns DataError::IO if root cannot be read (missing, not a
directory, no permission).
fn check(&self) -> bool
pub fn new( n_div: [u32; 3], time_per_flow_map: f64, description: Option<String>, recursive: bool, ) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CMCase
impl<'de> Deserialize<'de> for CMCase
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CMCase
impl RefUnwindSafe for CMCase
impl Send for CMCase
impl Sync for CMCase
impl Unpin for CMCase
impl UnsafeUnpin for CMCase
impl UnwindSafe for CMCase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.