pub trait Builder {
type EntityDescriptor: Debug + PartialEq + Eq + Clone + Copy + Hash;
type Mesh: Mesh<EntityDescriptor = Self::EntityDescriptor>;
type T: Scalar;
type CellData<'a>;
Show 19 methods
// Required methods
fn add_point(&mut self, id: usize, data: &[Self::T]);
fn add_point_parametric_coords(
&mut self,
_id: usize,
_entity_dim: usize,
_coords: &[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_mesh(&self) -> Self::Mesh;
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 point_parametric_coords(
&self,
_index: usize,
) -> Option<(usize, &[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 mesh call Builder::create_mesh.
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 Mesh: Mesh<EntityDescriptor = Self::EntityDescriptor>
type Mesh: Mesh<EntityDescriptor = Self::EntityDescriptor>
The type of the mesh that the builder creates
Required Methods§
Sourcefn add_point_parametric_coords(
&mut self,
_id: usize,
_entity_dim: usize,
_coords: &[Self::T],
)
fn add_point_parametric_coords( &mut self, _id: usize, _entity_dim: usize, _coords: &[Self::T], )
Add parametric coordinates for a point (optional)
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 mesh
Sourcefn create_mesh(&self) -> Self::Mesh
fn create_mesh(&self) -> Self::Mesh
Create the mesh
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 point_parametric_coords(&self, _index: usize) -> Option<(usize, &[Self::T])>
fn point_parametric_coords(&self, _index: usize) -> Option<(usize, &[Self::T])>
Get parametric coordinates for a point, if available
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".