pub struct LevelSetTopOpt {
pub grid: GridSize,
pub phi: Vec<f64>,
pub volume_fraction: f64,
pub dt: f64,
pub material: MaterialParams,
pub compliance_history: Vec<f64>,
}Expand description
Level-set topology optimization using the Hamilton-Jacobi equation.
The structural boundary is implicitly represented as the zero contour of
the level-set function φ. The Hamilton-Jacobi PDE governs its evolution:
∂φ/∂t + V_n |∇φ| = 0.
Fields§
§grid: GridSizeGrid size.
phi: Vec<f64>Level-set function values (one per grid node, length = (nx+1)*(ny+1)).
volume_fraction: f64Volume fraction target.
dt: f64Time step size for Hamilton-Jacobi update.
material: MaterialParamsMaterial parameters.
compliance_history: Vec<f64>Compliance history.
Implementations§
Source§impl LevelSetTopOpt
impl LevelSetTopOpt
Sourcepub fn new(
grid: GridSize,
volume_fraction: f64,
dt: f64,
material: MaterialParams,
) -> Self
pub fn new( grid: GridSize, volume_fraction: f64, dt: f64, material: MaterialParams, ) -> Self
Creates a new LevelSetTopOpt with a circular initial inclusion.
Sourcepub fn element_density(&self) -> Vec<f64>
pub fn element_density(&self) -> Vec<f64>
Extracts element density from level-set (Heaviside of nodal averages).
Sourcepub fn mock_compliance(&self, velocity: &[f64]) -> f64
pub fn mock_compliance(&self, velocity: &[f64]) -> f64
Computes mock compliance given a velocity field.
Sourcepub fn hj_update(&mut self, velocity: &[f64])
pub fn hj_update(&mut self, velocity: &[f64])
Performs one Hamilton-Jacobi update step.
φ_new = φ - dt * V_n * |∇φ| (using upwind difference for |∇φ|).
Sourcepub fn reinitialize(&mut self, n_iter: usize)
pub fn reinitialize(&mut self, n_iter: usize)
Re-initializes phi as a signed distance function using fast-marching approximation.
Trait Implementations§
Source§impl Clone for LevelSetTopOpt
impl Clone for LevelSetTopOpt
Source§fn clone(&self) -> LevelSetTopOpt
fn clone(&self) -> LevelSetTopOpt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LevelSetTopOpt
impl RefUnwindSafe for LevelSetTopOpt
impl Send for LevelSetTopOpt
impl Sync for LevelSetTopOpt
impl Unpin for LevelSetTopOpt
impl UnsafeUnpin for LevelSetTopOpt
impl UnwindSafe for LevelSetTopOpt
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.