pub struct XdmfStructuredGrid {
pub name: String,
pub ni: usize,
pub nj: usize,
pub nk: usize,
pub origin: [f64; 3],
pub dx: f64,
pub dy: f64,
pub dz: f64,
pub node_scalars: Vec<(String, Vec<f64>)>,
pub node_vectors: Vec<(String, Vec<[f64; 3]>)>,
pub cell_scalars: Vec<(String, Vec<f64>)>,
}Expand description
A structured (regular) Cartesian grid with optional scalar/vector fields.
This is the primary building block for CFD output on structured meshes.
Fields§
§name: StringGrid name shown in post-processors.
ni: usizeNumber of nodes along X (nodes = cells + 1 per axis).
nj: usizeNumber of nodes along Y.
nk: usizeNumber of nodes along Z.
origin: [f64; 3]Physical origin of the grid.
dx: f64Grid spacing along X.
dy: f64Grid spacing along Y.
dz: f64Grid spacing along Z.
node_scalars: Vec<(String, Vec<f64>)>Node-centered scalar fields (name, flat values, len = ni*nj*nk).
node_vectors: Vec<(String, Vec<[f64; 3]>)>Node-centered vector fields (name, flat values, len = ni*nj*nk).
cell_scalars: Vec<(String, Vec<f64>)>Cell-centered scalar fields (name, flat values, len = (ni-1)*(nj-1)*(nk-1)).
Implementations§
Source§impl XdmfStructuredGrid
impl XdmfStructuredGrid
Sourcepub fn new(
name: &str,
ni: usize,
nj: usize,
nk: usize,
origin: [f64; 3],
dx: f64,
dy: f64,
dz: f64,
) -> Self
pub fn new( name: &str, ni: usize, nj: usize, nk: usize, origin: [f64; 3], dx: f64, dy: f64, dz: f64, ) -> Self
Create a new structured grid with no fields.
Sourcepub fn add_node_scalar(&mut self, name: &str, data: Vec<f64>)
pub fn add_node_scalar(&mut self, name: &str, data: Vec<f64>)
Add a node-centered scalar field.
Sourcepub fn add_node_vector(&mut self, name: &str, data: Vec<[f64; 3]>)
pub fn add_node_vector(&mut self, name: &str, data: Vec<[f64; 3]>)
Add a node-centered vector field.
Sourcepub fn add_cell_scalar(&mut self, name: &str, data: Vec<f64>)
pub fn add_cell_scalar(&mut self, name: &str, data: Vec<f64>)
Add a cell-centered scalar field.
Trait Implementations§
Source§impl Clone for XdmfStructuredGrid
impl Clone for XdmfStructuredGrid
Source§fn clone(&self) -> XdmfStructuredGrid
fn clone(&self) -> XdmfStructuredGrid
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for XdmfStructuredGrid
impl RefUnwindSafe for XdmfStructuredGrid
impl Send for XdmfStructuredGrid
impl Sync for XdmfStructuredGrid
impl Unpin for XdmfStructuredGrid
impl UnsafeUnpin for XdmfStructuredGrid
impl UnwindSafe for XdmfStructuredGrid
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.