use alloc::vec::Vec;
use deep_causality_topology::{LatticeComplex, Manifold};
use crate::solvers::dec::DecNsScalar;
pub trait BoundaryZone<const D: usize, R: DecNsScalar> {
fn collect_rate_source(&self, _manifold: &Manifold<LatticeComplex<D, R>, R>, _acc: &mut [R]) {}
fn collect_constrained_edges(
&self,
_manifold: &Manifold<LatticeComplex<D, R>, R>,
_out: &mut Vec<usize>,
) {
}
fn collect_lift(
&self,
_manifold: &Manifold<LatticeComplex<D, R>, R>,
_step: usize,
_out: &mut Vec<(usize, R)>,
) {
}
fn collect_prescribed_edges(
&self,
_manifold: &Manifold<LatticeComplex<D, R>, R>,
_out: &mut Vec<usize>,
) {
}
fn collect_reference_vertices(
&self,
_manifold: &Manifold<LatticeComplex<D, R>, R>,
_out: &mut Vec<usize>,
) {
}
fn collect_slip_edges(
&self,
_manifold: &Manifold<LatticeComplex<D, R>, R>,
_out: &mut Vec<usize>,
) {
}
}
impl<const D: usize, R: DecNsScalar> BoundaryZone<D, R> for () {}
impl<const D: usize, R: DecNsScalar, A, B> BoundaryZone<D, R> for (A, B)
where
A: BoundaryZone<D, R>,
B: BoundaryZone<D, R>,
{
fn collect_rate_source(&self, manifold: &Manifold<LatticeComplex<D, R>, R>, acc: &mut [R]) {
self.0.collect_rate_source(manifold, acc);
self.1.collect_rate_source(manifold, acc);
}
fn collect_constrained_edges(
&self,
manifold: &Manifold<LatticeComplex<D, R>, R>,
out: &mut Vec<usize>,
) {
self.0.collect_constrained_edges(manifold, out);
self.1.collect_constrained_edges(manifold, out);
}
fn collect_lift(
&self,
manifold: &Manifold<LatticeComplex<D, R>, R>,
step: usize,
out: &mut Vec<(usize, R)>,
) {
self.0.collect_lift(manifold, step, out);
self.1.collect_lift(manifold, step, out);
}
fn collect_prescribed_edges(
&self,
manifold: &Manifold<LatticeComplex<D, R>, R>,
out: &mut Vec<usize>,
) {
self.0.collect_prescribed_edges(manifold, out);
self.1.collect_prescribed_edges(manifold, out);
}
fn collect_reference_vertices(
&self,
manifold: &Manifold<LatticeComplex<D, R>, R>,
out: &mut Vec<usize>,
) {
self.0.collect_reference_vertices(manifold, out);
self.1.collect_reference_vertices(manifold, out);
}
fn collect_slip_edges(
&self,
manifold: &Manifold<LatticeComplex<D, R>, R>,
out: &mut Vec<usize>,
) {
self.0.collect_slip_edges(manifold, out);
self.1.collect_slip_edges(manifold, out);
}
}