pub trait Mesh {
type T: Scalar;
type Entity<'a>: Entity<EntityDescriptor = Self::EntityDescriptor, T = Self::T>
where Self: 'a;
type GeometryMap<'a>: GeometryMap<T = Self::T>
where Self: 'a;
type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash;
type EntityIter<'a>: Iterator<Item = Self::Entity<'a>>
where Self: 'a;
// Required methods
fn geometry_dim(&self) -> usize;
fn topology_dim(&self) -> usize;
fn entity(
&self,
entity_type: Self::EntityDescriptor,
local_index: usize,
) -> Option<Self::Entity<'_>>;
fn entity_types(&self, tdim: usize) -> &[Self::EntityDescriptor];
fn entity_count(&self, entity_type: Self::EntityDescriptor) -> usize;
fn entity_iter(
&self,
entity_type: Self::EntityDescriptor,
) -> Self::EntityIter<'_>;
fn entity_from_id(
&self,
entity_type: Self::EntityDescriptor,
id: usize,
) -> Option<Self::Entity<'_>>;
fn geometry_map<Array2Impl: ValueArrayImpl<Self::T, 2>>(
&self,
entity_type: Self::EntityDescriptor,
geometry_degree: usize,
points: &Array<Array2Impl, 2>,
) -> Self::GeometryMap<'_>;
// Provided methods
fn cell_count(&self) -> usize { ... }
fn cell_types(&self) -> &[Self::EntityDescriptor] { ... }
fn owned_cell_count(&self) -> usize { ... }
}Expand description
A mesh provides access to entities, their geometrical and their topological properties.
Required Associated Types§
Sourcetype Entity<'a>: Entity<EntityDescriptor = Self::EntityDescriptor, T = Self::T>
where
Self: 'a
type Entity<'a>: Entity<EntityDescriptor = Self::EntityDescriptor, T = Self::T> where Self: 'a
Type used as identifier of different entity types
Sourcetype GeometryMap<'a>: GeometryMap<T = Self::T>
where
Self: 'a
type GeometryMap<'a>: GeometryMap<T = Self::T> where Self: 'a
Geometry map type
Sourcetype EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash
type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash
Type used as identifier of different entity types
Sourcetype EntityIter<'a>: Iterator<Item = Self::Entity<'a>>
where
Self: 'a
type EntityIter<'a>: Iterator<Item = Self::Entity<'a>> where Self: 'a
Iterator over sub-entities
Required Methods§
Sourcefn geometry_dim(&self) -> usize
fn geometry_dim(&self) -> usize
Dimension of the geometry of this mesh
Sourcefn topology_dim(&self) -> usize
fn topology_dim(&self) -> usize
Dimension of the topology of this mesh
Sourcefn entity(
&self,
entity_type: Self::EntityDescriptor,
local_index: usize,
) -> Option<Self::Entity<'_>>
fn entity( &self, entity_type: Self::EntityDescriptor, local_index: usize, ) -> Option<Self::Entity<'_>>
An entity in this mesh
Sourcefn entity_types(&self, tdim: usize) -> &[Self::EntityDescriptor]
fn entity_types(&self, tdim: usize) -> &[Self::EntityDescriptor]
The entity types of topological dimension dim contained in this mesh
Sourcefn entity_count(&self, entity_type: Self::EntityDescriptor) -> usize
fn entity_count(&self, entity_type: Self::EntityDescriptor) -> usize
Number of entities of type entity_type
Sourcefn entity_iter(
&self,
entity_type: Self::EntityDescriptor,
) -> Self::EntityIter<'_>
fn entity_iter( &self, entity_type: Self::EntityDescriptor, ) -> Self::EntityIter<'_>
Iterator over entities
Sourcefn entity_from_id(
&self,
entity_type: Self::EntityDescriptor,
id: usize,
) -> Option<Self::Entity<'_>>
fn entity_from_id( &self, entity_type: Self::EntityDescriptor, id: usize, ) -> Option<Self::Entity<'_>>
An entity in this mesh from an insertion id
Sourcefn geometry_map<Array2Impl: ValueArrayImpl<Self::T, 2>>(
&self,
entity_type: Self::EntityDescriptor,
geometry_degree: usize,
points: &Array<Array2Impl, 2>,
) -> Self::GeometryMap<'_>
fn geometry_map<Array2Impl: ValueArrayImpl<Self::T, 2>>( &self, entity_type: Self::EntityDescriptor, geometry_degree: usize, points: &Array<Array2Impl, 2>, ) -> Self::GeometryMap<'_>
Geometry map from reference entity to physical entities at the given points
points should have shape [entity_topology_dim, npts] and use column-major ordering
Provided Methods§
Sourcefn cell_count(&self) -> usize
fn cell_count(&self) -> usize
Number of cells in the mesh
Sourcefn cell_types(&self) -> &[Self::EntityDescriptor]
fn cell_types(&self) -> &[Self::EntityDescriptor]
Return the cell types in the mesh
Sourcefn owned_cell_count(&self) -> usize
fn owned_cell_count(&self) -> usize
Owned cell count
Note. The default implementation iterates through all mesh to count the number of owned elements. Override this method if a more efficient implementation is available.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".