pub struct NematicEngine { /* private fields */ }Expand description
Active nematohydrodynamics engine on a Riemannian 2-manifold.
Implementations§
Source§impl NematicEngine
impl NematicEngine
Sourcepub fn new<M: Manifold>(
mesh: Mesh<M, 3, 2>,
manifold: M,
params: NematicParams,
gaussian_curvature: Vec<f64>,
) -> Result<Self, String>
pub fn new<M: Manifold>( mesh: Mesh<M, 3, 2>, manifold: M, params: NematicParams, gaussian_curvature: Vec<f64>, ) -> Result<Self, String>
Construct the engine from a mesh, manifold, and dimensionless parameters.
Precomputes all DEC operators, connection Laplacian, Stokes solver, and semi-Lagrangian data structures. The timestep is auto-computed from the diffusive CFL bound based on the mean edge length.
Sourcepub fn n_vertices(&self) -> usize
pub fn n_vertices(&self) -> usize
Number of vertices in the mesh.
Sourcepub fn params(&self) -> &NematicParams
pub fn params(&self) -> &NematicParams
The dimensionless parameters.
Sourcepub fn step(&self, q: &mut QFieldDec) -> VelocityFieldDec
pub fn step(&self, q: &mut QFieldDec) -> VelocityFieldDec
Advance the nematic field by one timestep using operator splitting.
- Stokes solve for velocity from active stress.
- Semi-Lagrangian advection (backward trace + barycentric interp).
- Diffusion + bulk LdG (explicit, connection Laplacian).
Sourcepub fn run(
&self,
q: &mut QFieldDec,
n_steps: usize,
snap_every: usize,
callback: impl FnMut(usize, &QFieldDec, &VelocityFieldDec, &EngineStats),
)
pub fn run( &self, q: &mut QFieldDec, n_steps: usize, snap_every: usize, callback: impl FnMut(usize, &QFieldDec, &VelocityFieldDec, &EngineStats), )
Run the engine for n_steps, calling the callback at each snapshot.
Auto Trait Implementations§
impl Freeze for NematicEngine
impl RefUnwindSafe for NematicEngine
impl Send for NematicEngine
impl Sync for NematicEngine
impl Unpin for NematicEngine
impl UnsafeUnpin for NematicEngine
impl UnwindSafe for NematicEngine
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for 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>
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.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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.