cellular_raza_core/backend/chili/
result.rs

1use super::{CellIdentifier, SimulationError, SubDomainPlainIndex};
2use crate::storage::StorageManager;
3
4/// Gathers the [StorageManager] for cells and voxels of the previously run simulation
5pub struct StorageAccess<C, S> {
6    /// Access cells at their saved iteration steps
7    pub cells: StorageManager<CellIdentifier, C>,
8    /// Access voxels at their saved iteration steps
9    pub subdomains: StorageManager<SubDomainPlainIndex, S>,
10}
11
12impl<C, V> StorageAccess<C, V> {
13    /// Obtain the save path for cells and voxels of this simulation
14    pub fn get_path(&self) -> Result<std::path::PathBuf, SimulationError> {
15        match self.cells.extract_builder().get_full_path().parent() {
16            Some(p) => Ok(p.to_path_buf()),
17            None => Err(SimulationError::IoError(std::io::Error::from(
18                std::io::ErrorKind::NotFound,
19            ))),
20        }
21    }
22}