Builder

Trait Builder 

Source
pub trait Builder {
    type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash;
    type Grid: Grid<EntityDescriptor = Self::EntityDescriptor>;
    type T: Scalar;
    type CellData<'a>;

Show 17 methods // Required methods fn add_point(&mut self, id: usize, data: &[Self::T]); fn add_cell(&mut self, id: usize, cell_data: Self::CellData<'_>); fn add_cell_from_nodes_and_type( &mut self, id: usize, nodes: &[usize], cell_type: Self::EntityDescriptor, cell_degree: usize, ); fn create_grid(&self) -> Self::Grid; fn point_count(&self) -> usize; fn cell_count(&self) -> usize; fn point_indices_to_ids(&self) -> &[usize]; fn cell_indices_to_ids(&self) -> &[usize]; fn cell_points(&self, index: usize) -> &[usize]; fn cell_vertices(&self, index: usize) -> &[usize]; fn point(&self, index: usize) -> &[Self::T]; fn points(&self) -> &[Self::T]; fn cell_type(&self, index: usize) -> Self::EntityDescriptor; fn cell_degree(&self, index: usize) -> usize; fn gdim(&self) -> usize; fn tdim(&self) -> usize; fn npts(&self, cell_type: Self::EntityDescriptor, degree: usize) -> usize;
}
Expand description

A builder is a factory that creates meshes.

After instantiation points and cells can be added. To build the actual grid call Builder::create_grid.

Required Associated Types§

Source

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

Type used as identifier of different entity types

Source

type Grid: Grid<EntityDescriptor = Self::EntityDescriptor>

The type of the grid that the builder creates

Source

type T: Scalar

The floating point type used for coordinates

Source

type CellData<'a>

The type of the data that is input to add a cell

Required Methods§

Source

fn add_point(&mut self, id: usize, data: &[Self::T])

Add a point to the grid

Source

fn add_cell(&mut self, id: usize, cell_data: Self::CellData<'_>)

Add a cell to the grid

Source

fn add_cell_from_nodes_and_type( &mut self, id: usize, nodes: &[usize], cell_type: Self::EntityDescriptor, cell_degree: usize, )

Add a cell to the grid

Source

fn create_grid(&self) -> Self::Grid

Create the grid

Source

fn point_count(&self) -> usize

Number of points

Source

fn cell_count(&self) -> usize

Number of cells

Source

fn point_indices_to_ids(&self) -> &[usize]

Get the insertion ids of each point

Source

fn cell_indices_to_ids(&self) -> &[usize]

Get the insertion ids of each cell

Source

fn cell_points(&self, index: usize) -> &[usize]

Get the indices of the points of a cell

Source

fn cell_vertices(&self, index: usize) -> &[usize]

Get the indices of the points of a cell

Source

fn point(&self, index: usize) -> &[Self::T]

Get the coordinates of a point

Source

fn points(&self) -> &[Self::T]

Get all points

Source

fn cell_type(&self, index: usize) -> Self::EntityDescriptor

Get the type of a cell

Source

fn cell_degree(&self, index: usize) -> usize

Get the degree of a cell’s geometry

Source

fn gdim(&self) -> usize

Geometric dimension

Source

fn tdim(&self) -> usize

Topoligical dimension

Source

fn npts(&self, cell_type: Self::EntityDescriptor, degree: usize) -> usize

Number of points in a cell with the given type and degree

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§