unitforge/quantities/
force_per_volume.rs1use crate::impl_macros::macros::*;
2
3#[cfg_attr(feature = "strum", derive(EnumIter))]
4#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5#[derive(Copy, Clone, PartialEq, Debug, Hash, Eq)]
6#[cfg_attr(feature = "pyo3", pyclass(eq, eq_int))]
7pub enum ForcePerVolumeUnit {
8 N_mcb,
9 N_mmcb,
10}
11
12impl PhysicsUnit for ForcePerVolumeUnit {
13 fn name(&self) -> &str {
14 match &self {
15 ForcePerVolumeUnit::N_mcb => "N/m³",
16 ForcePerVolumeUnit::N_mmcb => "N/mm³",
17 }
18 }
19
20 fn base_per_x(&self) -> (f64, i32) {
21 match self {
22 ForcePerVolumeUnit::N_mcb => (1., 0),
23 ForcePerVolumeUnit::N_mmcb => (1., 9),
24 }
25 }
26}
27
28impl_quantity!(
29 ForcePerVolume,
30 ForcePerVolumeUnit,
31 [ForcePerVolumeUnit::N_mcb]
32);
33impl_div_with_self_to_f64!(ForcePerVolume);