pub struct MpmSolver {
pub h: f64,
pub dt: f64,
pub alpha: f64,
pub bounds: (Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>),
/* private fields */
}Expand description
MPM solver using APIC (Affine Particle-In-Cell) transfer.
Fields§
§h: f64Grid spacing (m).
dt: f64Timestep (s).
alpha: f64APIC flip/pic blending parameter (0 = pure PIC, 1 = pure FLIP).
bounds: (Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>)Domain bounds (min, max).
Implementations§
Source§impl MpmSolver
impl MpmSolver
Sourcepub fn new(
h: f64,
dt: f64,
bounds: (Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>),
) -> MpmSolver
pub fn new( h: f64, dt: f64, bounds: (Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>), ) -> MpmSolver
Create a new MPM solver.
Sourcepub fn total_grid_mass(&self) -> f64
pub fn total_grid_mass(&self) -> f64
Get total mass of all particles on grid.
Sourcepub fn total_momentum(
particles: &[Particle],
) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
pub fn total_momentum( particles: &[Particle], ) -> Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>
Get total momentum of all particles.
Sourcepub fn kinetic_energy(particles: &[Particle]) -> f64
pub fn kinetic_energy(particles: &[Particle]) -> f64
Get total kinetic energy.
Auto Trait Implementations§
impl Freeze for MpmSolver
impl RefUnwindSafe for MpmSolver
impl Send for MpmSolver
impl Sync for MpmSolver
impl Unpin for MpmSolver
impl UnsafeUnpin for MpmSolver
impl UnwindSafe for MpmSolver
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.