pub struct CMModel {
geometry: Arc<CMGeometry>,
c_info: CompartmentInfo,
interfaces: AInterfacesInfo,
}Fields§
§geometry: Arc<CMGeometry>§c_info: CompartmentInfo§interfaces: AInterfacesInfoImplementations§
Source§impl CMModel
impl CMModel
Sourcefn check_flux(n_zone: u32, rf: &RawFlux) -> bool
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
pub fn check_flow( &self, raw: &RawDataFlux, max_divergence: f64, ) -> Result<(), ModelError>
Source§impl CMModel
impl CMModel
pub fn grid(&self) -> &dyn CompartmentMesh
pub fn init(geometry: Arc<CMGeometry>) -> Self
fn compute_volume_integral_per_zone() -> Vec<f64>
Sourcefn normal_velocity(
&self,
vector: &Vector,
element_global_id: usize,
axis: usize,
) -> f64
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.
pub fn compute_flux_between_compartments( &self, vector: Vector, settings: &BalanceSettings, ) -> Result<RawDataFlux, CoreError>
Sourcefn balance(
&self,
flows: &mut [InterfaceFlow],
settings: &BalanceSettings,
) -> BalanceReport
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.
pub fn export_volume_integral_per_zone( &self, model_scalar: Scalar, ) -> Result<RawDataScalar, CoreError>
pub fn compartments_volumes(&self) -> Vec<f64>
pub fn get_real_volume(&self) -> Vec<f64>
Auto Trait Implementations§
impl Freeze for CMModel
impl !RefUnwindSafe for CMModel
impl Send for CMModel
impl Sync for CMModel
impl Unpin for CMModel
impl UnsafeUnpin for CMModel
impl !UnwindSafe for CMModel
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
§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.