pub struct TriangularMesh {
pub points: Vec<Point>,
pub elements: Vec<Triangle>,
pub boundary_edges: Vec<(usize, usize, Option<i32>)>,
pub boundary_nodes: HashMap<usize, BoundaryNodeInfo>,
}Expand description
A mesh of triangular elements
Fields§
§points: Vec<Point>Points/nodes in the mesh
elements: Vec<Triangle>Triangular elements
boundary_edges: Vec<(usize, usize, Option<i32>)>Boundary edges (node indices for each edge)
boundary_nodes: HashMap<usize, BoundaryNodeInfo>Map from node index to its boundary condition type (if on boundary)
Implementations§
Source§impl TriangularMesh
impl TriangularMesh
Sourcepub fn generate_rectangular(
x_range: (f64, f64),
y_range: (f64, f64),
nx: usize,
ny: usize,
) -> Self
pub fn generate_rectangular( x_range: (f64, f64), y_range: (f64, f64), nx: usize, ny: usize, ) -> Self
Generate a simple triangular mesh on a rectangular domain
Sourcepub fn set_boundary_conditions(
&mut self,
boundary_conditions: &[BoundaryCondition<f64>],
) -> PDEResult<()>
pub fn set_boundary_conditions( &mut self, boundary_conditions: &[BoundaryCondition<f64>], ) -> PDEResult<()>
Set boundary conditions based on boundary markers
Sourcepub fn triangle_area(&self, element: &Triangle) -> f64
pub fn triangle_area(&self, element: &Triangle) -> f64
Compute area of a triangle
Trait Implementations§
Source§impl Clone for TriangularMesh
impl Clone for TriangularMesh
Source§fn clone(&self) -> TriangularMesh
fn clone(&self) -> TriangularMesh
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TriangularMesh
impl Debug for TriangularMesh
Auto Trait Implementations§
impl Freeze for TriangularMesh
impl RefUnwindSafe for TriangularMesh
impl Send for TriangularMesh
impl Sync for TriangularMesh
impl Unpin for TriangularMesh
impl UnwindSafe for TriangularMesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more