Skip to main content

CMHandle

Struct CMHandle 

Source
pub struct CMHandle {
    pub(crate) model: Arc<CMModel>,
    pub(crate) balance: BalanceSettings,
    pub(crate) _root_result: String,
    pub(crate) eg_geometry: Arc<Geometry>,
    pub(crate) cm_geometry: Arc<CMGeometry>,
}

Fields§

§model: Arc<CMModel>§balance: BalanceSettings

Knobs of the balancing pass, the caller may replace them before generating

§_root_result: String§eg_geometry: Arc<Geometry>§cm_geometry: Arc<CMGeometry>

Implementations§

Source§

impl CMHandle

Source

pub fn set_balance_settings(&mut self, settings: BalanceSettings)

Replaces the balancing knobs used when a flow map is generated

Source

pub fn balance_settings(&self) -> &BalanceSettings

Source

pub fn grid(&self) -> &dyn CompartmentMesh

Source

pub fn init( n_div: [usize; 3], root: &str, geometry_filename: &str, _meshtype: MeshType, ) -> Result<Self, CoreError>

Source

pub fn dump_volume(&self)

Source

pub fn dump_all( &self, root_export: impl AsRef<Path>, root_input: impl AsRef<Path>, vars: &[VariableInfo], ) -> Result<(), CoreError>

Source

pub fn get_scalar(&self, path: impl AsRef<Path>) -> Result<Scalar, CoreError>

Source

pub(crate) fn s_get_scalar( path: impl AsRef<Path>, eg_geometry: Arc<Geometry>, cm_geometry: Arc<CMGeometry>, ) -> Result<Scalar, CoreError>

Source

pub(crate) fn ts_dump_scalar( res_name: impl AsRef<Path>, path: impl AsRef<Path>, eg_geometry: Arc<Geometry>, cm_geometry: Arc<CMGeometry>, model: Arc<CMModel>, ) -> Result<RawDataScalar, CoreError>

Source

pub fn dump_scalar( &self, res_name: impl AsRef<Path>, path: impl AsRef<Path>, ) -> Result<RawDataScalar, CoreError>

Source

pub fn dump_scalar_fraction( &self, res_name: impl AsRef<Path>, path: impl AsRef<Path>, phase_fraction: Scalar, ) -> Result<RawDataScalar, CoreError>

Integrates a scalar over each compartment, weighting every element by phase_fraction first, so a field carried by one phase is integrated over the volume that phase occupies. Scaling the compartment integral afterwards is not the same number unless the field and the fraction are uncorrelated inside the compartment.

Source

pub fn dump_real_volume( &self, res_name: impl AsRef<Path>, ) -> Result<(), CoreError>

Source

pub fn dump_vector_phase_fraction( &self, res_name: impl AsRef<Path>, path: impl AsRef<Path>, phase_fraction: Scalar, ) -> Result<(), CoreError>

Source

pub fn dump_vector_raw( &self, res_name: impl AsRef<Path>, vector: Vector, ) -> Result<(), CoreError>

Source

pub fn dump_vector( &self, res_name: impl AsRef<Path>, path: impl AsRef<Path>, ) -> Result<(), CoreError>

Source

pub fn vector_from_scalar( &self, path_i: impl AsRef<Path>, path_j: impl AsRef<Path>, path_k: impl AsRef<Path>, ) -> Result<Vector, CoreError>

Source

pub fn real_volume(&self) -> Vec<f64>

Volume of each compartment, as covered by the mesh

Source

pub fn dump_vector_from_scalar( &self, res_name: impl AsRef<Path>, path_i: impl AsRef<Path>, path_j: impl AsRef<Path>, path_k: impl AsRef<Path>, phase_fraction: Option<Scalar>, ) -> Result<RawDataFlux, CoreError>

Flow map out of the three components of a velocity, optionally scaled by the volume fraction of its phase: a phase only carries its own share of the flow

Source

pub fn export_geometry_compartments(&self)

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> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
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.