Skip to main content

CMModel

Struct CMModel 

Source
pub struct CMModel {
    geometry: Arc<CMGeometry>,
    c_info: CompartmentInfo,
    interfaces: AInterfacesInfo,
}

Fields§

§geometry: Arc<CMGeometry>§c_info: CompartmentInfo§interfaces: AInterfacesInfo

Implementations§

Source§

impl CMModel

Source

fn check_flux(n_zone: u32, rf: &RawFlux) -> bool

Both directions must carry a usable flow and both ids must address a compartment, check_flow indexes mass_balance with them right after

Source

pub fn check_flow( &self, raw: &RawDataFlux, max_divergence: f64, ) -> Result<(), ModelError>

Source§

impl CMModel

Source

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

Source

pub fn init(geometry: Arc<CMGeometry>) -> Self

Source

fn compute_volume_integral_per_zone() -> Vec<f64>

Source

fn normal_velocity( &self, vector: &Vector, element_global_id: usize, axis: usize, ) -> f64

Velocity of one element along the normal of the interface it crosses.

The velocity stays a vector up to here and is projected on the local normal: on a radial or theta face the normal turns with theta, so it has to be taken at the position of the element and not once for the whole interface.

Source

pub fn compute_flux_between_compartments( &self, vector: Vector, settings: &BalanceSettings, ) -> Result<RawDataFlux, CoreError>

Source

fn balance( &self, flows: &mut [InterfaceFlow], settings: &BalanceSettings, ) -> BalanceReport

Balance flow

A flow is only ever multiplied by a positive factor. Scaling the flows leaving a compartment by sqrt(in / out) moves it halfway to its balance, and repeating it converges the same way Sinkhorn balancing does.

Source

pub fn export_volume_integral_per_zone( &self, model_scalar: Scalar, ) -> Result<RawDataScalar, CoreError>

Source

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

Source

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

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.