pub struct LevelSetEvolution {
pub dt: f64,
pub n_steps: usize,
}Expand description
Level-set evolution by advection and mean curvature flow.
Implements the upwind finite difference scheme for advection and the explicit mean-curvature-flow equation for smoothing.
Fields§
§dt: f64Time step for explicit integration.
n_steps: usizeNumber of time steps per evolution call.
Implementations§
Source§impl LevelSetEvolution
impl LevelSetEvolution
Sourcepub fn new(dt: f64, n_steps: usize) -> Self
pub fn new(dt: f64, n_steps: usize) -> Self
Create a new LevelSetEvolution solver.
§Arguments
dt– explicit time step (should satisfy CFL: dt ≤ dx/|v|_max)n_steps– number of time steps peradvectormean_curvature_flowcall
Sourcepub fn advect(&self, field: &mut LevelSetField, velocity: [f64; 3])
pub fn advect(&self, field: &mut LevelSetField, velocity: [f64; 3])
Advect the level-set field by a uniform velocity field using the upwind scheme.
Solves ∂φ/∂t + v · ∇φ = 0 with first-order upwind spatial discretisation.
§Arguments
field– level-set field (modified in place)velocity– uniform velocity vector [vx, vy, vz]
Sourcepub fn mean_curvature_flow(&self, field: &mut LevelSetField)
pub fn mean_curvature_flow(&self, field: &mut LevelSetField)
Evolve the level-set by mean curvature flow.
Solves ∂φ/∂t = κ |∇φ| where κ is the mean curvature. Uses explicit Euler integration.
§Arguments
field– level-set field (modified in place)
Sourcepub fn normal_velocity_extension(
&self,
field: &mut LevelSetField,
normal_velocity: f64,
)
pub fn normal_velocity_extension( &self, field: &mut LevelSetField, normal_velocity: f64, )
Normal velocity extension: propagate the interface normal velocity outward.
For each node computes the update φ_new = φ - dt * F |∇φ| where F is a prescribed scalar normal velocity.
§Arguments
field– level-set field (modified in place)normal_velocity– scalar normal speed (positive = expansion)
Auto Trait Implementations§
impl Freeze for LevelSetEvolution
impl RefUnwindSafe for LevelSetEvolution
impl Send for LevelSetEvolution
impl Sync for LevelSetEvolution
impl Unpin for LevelSetEvolution
impl UnsafeUnpin for LevelSetEvolution
impl UnwindSafe for LevelSetEvolution
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
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.