pub struct Discrete1Form {
pub values: HashMap<(usize, usize), f64>,
}Expand description
A discrete 1-form on mesh edges, storing one value per directed edge.
A 1-form ω assigns a value ω(e) to each oriented edge such that ω(-e) = -ω(e).
Fields§
§values: HashMap<(usize, usize), f64>Values indexed by (vertex_i, vertex_j) with i < j.
Implementations§
Source§impl Discrete1Form
impl Discrete1Form
Sourcepub fn zeros(mesh: &DiscreteMesh) -> Self
pub fn zeros(mesh: &DiscreteMesh) -> Self
Construct a zero 1-form over all mesh edges.
Sourcepub fn eval(&self, a: usize, b: usize) -> f64
pub fn eval(&self, a: usize, b: usize) -> f64
Evaluate the 1-form on directed edge (a → b).
Returns +val if a < b, else -val.
Sourcepub fn integrate_path(&self, path: &[usize]) -> f64
pub fn integrate_path(&self, path: &[usize]) -> f64
Integrate the 1-form along a path given as a sequence of vertex indices.
Sourcepub fn exterior_derivative(&self, mesh: &DiscreteMesh) -> Vec<f64>
pub fn exterior_derivative(&self, mesh: &DiscreteMesh) -> Vec<f64>
Compute the exterior derivative (discrete 2-form = scalar on faces).
Returns a vector of face values dω[f] = ω(e01) + ω(e12) + ω(e20).
Trait Implementations§
Source§impl Clone for Discrete1Form
impl Clone for Discrete1Form
Source§fn clone(&self) -> Discrete1Form
fn clone(&self) -> Discrete1Form
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Discrete1Form
impl RefUnwindSafe for Discrete1Form
impl Send for Discrete1Form
impl Sync for Discrete1Form
impl Unpin for Discrete1Form
impl UnsafeUnpin for Discrete1Form
impl UnwindSafe for Discrete1Form
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> 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>
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.