pub struct PolyMesh<T, D>{ /* private fields */ }
Expand description
A volumetric polytopal mesh.
It is assumed that each polytopal cell is convex.
Implementations§
Source§impl<T, D> PolyMesh<T, D>
impl<T, D> PolyMesh<T, D>
pub fn from_poly_data( vertices: Vec<OPoint<T, D>>, faces: NestedVec<usize>, cells: NestedVec<usize>, ) -> Self
pub fn vertices(&self) -> &[OPoint<T, D>]
pub fn vertices_mut(&mut self) -> &mut [OPoint<T, D>]
pub fn num_faces(&self) -> usize
pub fn num_cells(&self) -> usize
pub fn face_vertices<'a>( &'a self, face_idx: usize, ) -> impl 'a + Iterator<Item = &'a OPoint<T, D>>
pub fn face_connectivity_iter<'a>( &'a self, ) -> impl 'a + Iterator<Item = &'a [usize]>
pub fn cell_connectivity_iter<'a>( &'a self, ) -> impl 'a + Iterator<Item = &'a [usize]>
pub fn get_face_connectivity(&self, index: usize) -> Option<&[usize]>
pub fn get_cell_connectivity(&self, index: usize) -> Option<&[usize]>
pub fn get_face(&self, index: usize) -> Option<PolyMeshFace<'_, T, D>>
Sourcepub fn compute_face_cell_connectivity(&self) -> NestedVec<usize>
pub fn compute_face_cell_connectivity(&self) -> NestedVec<usize>
Returns a nested array, in which each array i contains the indices of the cells associated with face i.
Sourcepub fn dedup_faces(&mut self)
pub fn dedup_faces(&mut self)
Removes duplicate instances of topologically equivalent faces.
Two faces are topologically equivalent if the sets of vertices connected by each face are equivalent.
Sourcepub fn find_boundary_faces(&self) -> Vec<usize>
pub fn find_boundary_faces(&self) -> Vec<usize>
Returns the indices of the faces which are only referenced by at most one cells.
Sourcepub fn concatenate<'a>(
meshes: impl IntoIterator<Item = &'a PolyMesh<T, D>>,
) -> Self
pub fn concatenate<'a>( meshes: impl IntoIterator<Item = &'a PolyMesh<T, D>>, ) -> Self
Merges multiple meshes into a single instance of PolyMesh
.
The mesh vertices, faces and cells are simply relabeled and glued together so that they form a well-defined PolyMesh. No mesh processing is performed.
Source§impl<T, D> PolyMesh<T, D>
impl<T, D> PolyMesh<T, D>
Sourcepub fn split_edges_n_times(&mut self, n_times: usize)
pub fn split_edges_n_times(&mut self, n_times: usize)
Recursively splits each edge in the mesh the specified number of times
Sourcepub fn split_edges(&mut self)
pub fn split_edges(&mut self)
Splits the edges of all faces in the mesh by inserting a vertex at the midpoint of each edge
Source§impl<T> PolyMesh<T, Const<3>>where
T: Scalar,
impl<T> PolyMesh<T, Const<3>>where
T: Scalar,
Sourcepub fn triangulate(&self) -> Result<PolyMesh3d<T>, Box<dyn Error>>
pub fn triangulate(&self) -> Result<PolyMesh3d<T>, Box<dyn Error>>
Triangulate the polyhedral mesh.
Note that the algorithm currently only gives non-degenerate results when each cell is strictly convex, in the sense that no two faces of a cell are co-planar.
TODO: Can we relax the strict convexity restriction without introducing additional Steiner points into the triangulation? The restriction is explained in the paper by Max (2000) (see comments in implementation).
pub fn keep_cells(&self, cell_indices: &[usize]) -> Self
Source§impl<T> PolyMesh<T, Const<3>>where
T: Real,
impl<T> PolyMesh<T, Const<3>>where
T: Real,
pub fn translate(&mut self, translation: &Vector3<T>)
pub fn translated(self, translation: &Vector3<T>) -> Self
pub fn compute_volume(&self) -> T
pub fn intersect_convex_polyhedron<'a>( &self, polyhedron: &impl ConvexPolyhedron<'a, T>, ) -> Self
pub fn intersect_half_space(&self, half_space: &HalfSpace<T>) -> Self
Trait Implementations§
Source§impl<'de, T, D> Deserialize<'de> for PolyMesh<T, D>where
T: Scalar,
D: DimName,
DefaultAllocator: Allocator<T, D>,
<DefaultAllocator as Allocator<T, D>>::Buffer: Deserialize<'de>,
OPoint<T, D>: Deserialize<'de>,
impl<'de, T, D> Deserialize<'de> for PolyMesh<T, D>where
T: Scalar,
D: DimName,
DefaultAllocator: Allocator<T, D>,
<DefaultAllocator as Allocator<T, D>>::Buffer: Deserialize<'de>,
OPoint<T, D>: Deserialize<'de>,
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<T, D> Serialize for PolyMesh<T, D>where
T: Scalar,
D: DimName,
DefaultAllocator: Allocator<T, D>,
<DefaultAllocator as Allocator<T, D>>::Buffer: Serialize,
OPoint<T, D>: Serialize,
impl<T, D> Serialize for PolyMesh<T, D>where
T: Scalar,
D: DimName,
DefaultAllocator: Allocator<T, D>,
<DefaultAllocator as Allocator<T, D>>::Buffer: Serialize,
OPoint<T, D>: Serialize,
impl<T, D> Eq for PolyMesh<T, D>
impl<T, D> StructuralPartialEq for PolyMesh<T, D>
Auto Trait Implementations§
impl<T, D> Freeze for PolyMesh<T, D>where
DefaultAllocator: Sized,
impl<T, D> !RefUnwindSafe for PolyMesh<T, D>
impl<T, D> !Send for PolyMesh<T, D>
impl<T, D> !Sync for PolyMesh<T, D>
impl<T, D> !Unpin for PolyMesh<T, D>
impl<T, D> !UnwindSafe for PolyMesh<T, D>
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,
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<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.