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§
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 Grid: Grid<EntityDescriptor = Self::EntityDescriptor>
type Grid: Grid<EntityDescriptor = Self::EntityDescriptor>
The type of the grid that the builder creates
Required Methods§
Sourcefn add_cell_from_nodes_and_type(
&mut self,
id: usize,
nodes: &[usize],
cell_type: Self::EntityDescriptor,
cell_degree: usize,
)
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
Sourcefn create_grid(&self) -> Self::Grid
fn create_grid(&self) -> Self::Grid
Create the grid
Sourcefn point_count(&self) -> usize
fn point_count(&self) -> usize
Number of points
Sourcefn cell_count(&self) -> usize
fn cell_count(&self) -> usize
Number of cells
Sourcefn point_indices_to_ids(&self) -> &[usize]
fn point_indices_to_ids(&self) -> &[usize]
Get the insertion ids of each point
Sourcefn cell_indices_to_ids(&self) -> &[usize]
fn cell_indices_to_ids(&self) -> &[usize]
Get the insertion ids of each cell
Sourcefn cell_points(&self, index: usize) -> &[usize]
fn cell_points(&self, index: usize) -> &[usize]
Get the indices of the points of a cell
Sourcefn cell_vertices(&self, index: usize) -> &[usize]
fn cell_vertices(&self, index: usize) -> &[usize]
Get the indices of the points of a cell
Sourcefn cell_type(&self, index: usize) -> Self::EntityDescriptor
fn cell_type(&self, index: usize) -> Self::EntityDescriptor
Get the type of a cell
Sourcefn cell_degree(&self, index: usize) -> usize
fn cell_degree(&self, index: usize) -> usize
Get the degree of a cell’s geometry
Sourcefn npts(&self, cell_type: Self::EntityDescriptor, degree: usize) -> usize
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.