Skip to main content

Mesh

Trait Mesh 

Source
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§

Source

type T: Scalar

Scalar type

Source

type Entity<'a>: Entity<EntityDescriptor = Self::EntityDescriptor, T = Self::T> where Self: 'a

Type used as identifier of different entity types

Source

type GeometryMap<'a>: GeometryMap<T = Self::T> where Self: 'a

Geometry map type

Source

type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash

Type used as identifier of different entity types

Source

type EntityIter<'a>: Iterator<Item = Self::Entity<'a>> where Self: 'a

Iterator over sub-entities

Required Methods§

Source

fn geometry_dim(&self) -> usize

Dimension of the geometry of this mesh

Source

fn topology_dim(&self) -> usize

Dimension of the topology of this mesh

Source

fn entity( &self, entity_type: Self::EntityDescriptor, local_index: usize, ) -> Option<Self::Entity<'_>>

An entity in this mesh

Source

fn entity_types(&self, tdim: usize) -> &[Self::EntityDescriptor]

The entity types of topological dimension dim contained in this mesh

Source

fn entity_count(&self, entity_type: Self::EntityDescriptor) -> usize

Number of entities of type entity_type

Source

fn entity_iter( &self, entity_type: Self::EntityDescriptor, ) -> Self::EntityIter<'_>

Iterator over entities

Source

fn entity_from_id( &self, entity_type: Self::EntityDescriptor, id: usize, ) -> Option<Self::Entity<'_>>

An entity in this mesh from an insertion id

Source

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§

Source

fn cell_count(&self) -> usize

Number of cells in the mesh

Source

fn cell_types(&self) -> &[Self::EntityDescriptor]

Return the cell types in the mesh

Source

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", so this trait is not object safe.

Implementors§

Source§

impl<G: Mesh + Sync> Mesh for LocalMesh<G>

Source§

type T = <G as Mesh>::T

Source§

type Entity<'a> = MeshEntity<<G as Mesh>::Entity<'a>> where Self: 'a

Source§

type GeometryMap<'a> = <G as Mesh>::GeometryMap<'a> where Self: 'a

Source§

type EntityDescriptor = <G as Mesh>::EntityDescriptor

Source§

type EntityIter<'a> = MeshEntityIter<'a, <G as Mesh>::Entity<'a>, <G as Mesh>::EntityIter<'a>> where Self: 'a

Source§

impl<T: Scalar, E: MappedFiniteElement<CellType = ReferenceCellType, T = T>> Mesh for MixedMesh<T, E>

Source§

type T = T

Source§

type Entity<'a> = MixedMeshEntity<'a, T, E> where Self: 'a

Source§

type GeometryMap<'a> = GeometryMap<'a, T, BaseArray<VectorContainer<T>, 2>, BaseArray<VectorContainer<usize>, 2>> where Self: 'a

Source§

type EntityDescriptor = ReferenceCellType

Source§

type EntityIter<'a> = MixedMeshEntityIter<'a, T, E> where Self: 'a

Source§

impl<T: Scalar, E: MappedFiniteElement<CellType = ReferenceCellType, T = T>> Mesh for SingleElementMesh<T, E>

Source§

type T = T

Source§

type Entity<'a> = SingleElementMeshEntity<'a, T, E> where Self: 'a

Source§

type GeometryMap<'a> = GeometryMap<'a, T, BaseArray<VectorContainer<T>, 2>, BaseArray<VectorContainer<usize>, 2>> where Self: 'a

Source§

type EntityDescriptor = ReferenceCellType

Source§

type EntityIter<'a> = SingleElementMeshEntityIter<'a, T, E> where Self: 'a