pub trait Section {
type Point: Copy + Ord;
fn dof(&self, p: Self::Point) -> usize;
fn offset(&self, p: Self::Point) -> usize;
}
pub fn section_on_closure<S, Sec>(
sieve: &S,
sec: &Sec,
cell: S::Point,
) -> impl Iterator<Item = (usize, usize)>
where
S: crate::topology::sieve::oriented::OrientedSieve,
Sec: Section<Point = S::Point>,
{
sieve
.closure_o([cell])
.into_iter()
.map(move |(p, _)| (sec.offset(p), sec.dof(p)))
}
pub fn section_on_closure_o<S, Sec>(
sieve: &S,
sec: &Sec,
cell: S::Point,
) -> impl Iterator<Item = (usize, usize, S::Orient)>
where
S: crate::topology::sieve::oriented::OrientedSieve,
Sec: Section<Point = S::Point>,
{
sieve
.closure_o([cell])
.into_iter()
.map(move |(p, o)| (sec.offset(p), sec.dof(p), o))
}
pub trait ApplyOrientation {
type Orient: crate::topology::sieve::oriented::Orientation;
fn apply(&self, o: Self::Orient, buf: &mut [f64]);
}