pub struct GpuFemMesh {
pub node_coords: Vec<f64>,
pub elements: Vec<usize>,
pub youngs_modulus: Vec<f64>,
pub area: Vec<f64>,
pub k_global: Vec<f64>,
pub displacements: Vec<f64>,
pub ext_forces: Vec<f64>,
pub residual: Vec<f64>,
pub dirichlet_flags: Vec<bool>,
}Expand description
A FEM mesh with element connectivity and material parameters.
Elements are 2-node bar/rod elements. Each element connects two nodes. Global DOF count equals the number of nodes.
Fields§
§node_coords: Vec<f64>Node coordinates (one per node).
elements: Vec<usize>Element connectivity: [node_a0, node_b0, node_a1, node_b1, …].
youngs_modulus: Vec<f64>Young’s modulus for each element.
area: Vec<f64>Cross-sectional area for each element.
k_global: Vec<f64>Global stiffness matrix (n_dofs × n_dofs, row-major).
displacements: Vec<f64>Global displacement vector (n_dofs).
ext_forces: Vec<f64>Global external force vector (n_dofs).
residual: Vec<f64>Residual vector r = f − K·u (n_dofs).
dirichlet_flags: Vec<bool>Dirichlet (fixed) DOF flags: true means constrained.
Implementations§
Source§impl GpuFemMesh
impl GpuFemMesh
Sourcepub fn new(node_coords: Vec<f64>, elements: Vec<usize>) -> Self
pub fn new(node_coords: Vec<f64>, elements: Vec<usize>) -> Self
Create a new GpuFemMesh from node coordinates and element connectivity.
elements must be a flat list of node-index pairs [a0, b0, a1, b1, …].
All material parameters default to 1.0.
Sourcepub fn n_elements(&self) -> usize
pub fn n_elements(&self) -> usize
Number of elements.
Trait Implementations§
Source§impl Clone for GpuFemMesh
impl Clone for GpuFemMesh
Source§fn clone(&self) -> GpuFemMesh
fn clone(&self) -> GpuFemMesh
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for GpuFemMesh
impl RefUnwindSafe for GpuFemMesh
impl Send for GpuFemMesh
impl Sync for GpuFemMesh
impl Unpin for GpuFemMesh
impl UnsafeUnpin for GpuFemMesh
impl UnwindSafe for GpuFemMesh
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
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>
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>
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