pub enum Discretization {
Uniform(Subdivision),
PerSegment(Vec<Subdivision>),
Graded(Grading),
SkinDepth(SkinDepthGrading),
}Expand description
How the segments of a geometry are cut into filaments.
Variants§
Uniform(Subdivision)
The same uniform subdivision for every segment.
PerSegment(Vec<Subdivision>)
One uniform subdivision per segment, in segment order.
Graded(Grading)
The same surface-graded grid for every segment.
SkinDepth(SkinDepthGrading)
A surface-graded grid whose counts follow the skin depth at a frequency of interest, segment by segment.
Implementations§
Source§impl Discretization
impl Discretization
Sourcepub const fn uniform(nw: usize, nh: usize) -> Self
pub const fn uniform(nw: usize, nh: usize) -> Self
The same nw × nh subdivision for every segment.
Sourcepub const fn graded(nw: usize, nh: usize, ratio: f64) -> Self
pub const fn graded(nw: usize, nh: usize, ratio: f64) -> Self
The same nw × nh grid for every segment, graded inward by ratio.
Sourcepub const fn skin_depth(
frequency_hz: f64,
target_skin_depths: f64,
ratio: f64,
) -> Self
pub const fn skin_depth( frequency_hz: f64, target_skin_depths: f64, ratio: f64, ) -> Self
Filament counts chosen per segment to put surface filaments within
target_skin_depths skin depths at frequency_hz, graded inward by
ratio, subject to the per-axis cap. See SkinDepthGrading.
Sourcepub fn filament_count(&self, geometry: &Geometry) -> Result<usize, SolveError>
pub fn filament_count(&self, geometry: &Geometry) -> Result<usize, SolveError>
How many filaments this discretization cuts geometry into, without
cutting it: the sum of nw·nh over the segments.
Cheap (one pass over the segments), so a front end can size the
problem — and pick a solve path with
SolverChoice::resolve — before paying for assembly.
§Errors
SolveError::InvalidGrading for an out-of-range grading parameter
and SolveError::Mesh for a per-segment discretization of the wrong
length, exactly as assembly would report them.
Trait Implementations§
Source§impl Clone for Discretization
impl Clone for Discretization
Source§impl Debug for Discretization
impl Debug for Discretization
Source§impl<'de> Deserialize<'de> for Discretization
impl<'de> Deserialize<'de> for Discretization
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Discretization
impl PartialEq for Discretization
Source§impl Serialize for Discretization
impl Serialize for Discretization
impl StructuralPartialEq for Discretization
Auto Trait Implementations§
impl Freeze for Discretization
impl RefUnwindSafe for Discretization
impl Send for Discretization
impl Sync for Discretization
impl Unpin for Discretization
impl UnsafeUnpin for Discretization
impl UnwindSafe for Discretization
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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
impl<T> Scalar 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>
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.