From 797645a4fddd212d6f5ed346a1131d0eb2f3d8f4 Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Thu, 7 Mar 2024 14:22:42 +0000 Subject: [PATCH] create_grid should consume the builder --- src/grid/flat_triangle_grid/builder.rs | 2 +- src/grid/mixed_grid/builder.rs | 2 +- src/grid/single_element_grid/builder.rs | 2 +- src/traits/builder.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grid/flat_triangle_grid/builder.rs b/src/grid/flat_triangle_grid/builder.rs index 1ba7379..cdaba99 100644 --- a/src/grid/flat_triangle_grid/builder.rs +++ b/src/grid/flat_triangle_grid/builder.rs @@ -68,7 +68,7 @@ where self.cells.extend_from_slice(&cell_data); } - fn create_grid(&self) -> Self::GridType { + fn create_grid(self) -> Self::GridType { // TODO: remove this transposing let npts = self.point_indices_to_ids.len(); let mut points = rlst_dynamic_array2!(T, [npts, 3]); diff --git a/src/grid/mixed_grid/builder.rs b/src/grid/mixed_grid/builder.rs index d8fd934..9e27a51 100644 --- a/src/grid/mixed_grid/builder.rs +++ b/src/grid/mixed_grid/builder.rs @@ -98,7 +98,7 @@ where self.cell_degrees.push(cell_data.2); } - fn create_grid(&self) -> Self::GridType { + fn create_grid(self) -> Self::GridType { // TODO: remove this transposing let npts = self.point_indices_to_ids.len(); let mut points = rlst_dynamic_array2!(T, [npts, 3]); diff --git a/src/grid/single_element_grid/builder.rs b/src/grid/single_element_grid/builder.rs index 6b46d67..d2eea9d 100644 --- a/src/grid/single_element_grid/builder.rs +++ b/src/grid/single_element_grid/builder.rs @@ -92,7 +92,7 @@ where self.cells.extend_from_slice(&cell_data); } - fn create_grid(&self) -> Self::GridType { + fn create_grid(self) -> Self::GridType { // TODO: remove this transposing let npts = self.point_indices_to_ids.len(); let mut points = rlst_dynamic_array2!(T, [npts, 3]); diff --git a/src/traits/builder.rs b/src/traits/builder.rs index c057ccd..9f9371e 100644 --- a/src/traits/builder.rs +++ b/src/traits/builder.rs @@ -22,5 +22,5 @@ pub trait Builder { fn add_cell(&mut self, id: usize, cell_data: Self::CellData); /// Create the grid - fn create_grid(&self) -> Self::GridType; + fn create_grid(self) -> Self::GridType; }