[][src]Struct ohsl::mesh2d::Mesh2D

pub struct Mesh2D<T> { /* fields omitted */ }

Implementations

impl<T: Clone + Number> Mesh2D<T>[src]

pub fn new(x_nodes: Vector<f64>, y_nodes: Vector<f64>, nvars: usize) -> Self[src]

Create a new 2D mesh

pub fn nvars(&self) -> usize[src]

Return the number of variables stored at each node in the mesh

pub fn nnodes(&self) -> (usize, usize)[src]

Return the number of nodal points in each direction

pub fn coord(&self, nodex: usize, nodey: usize) -> (f64, f64)[src]

Return the spatial position of a specfied nodes as a tuple

pub fn xnodes(&self) -> Vector<f64>[src]

Return the vector of x-nodal positions

pub fn ynodes(&self) -> Vector<f64>[src]

Return the vector of y-nodal positions

pub fn set_nodes_vars(&mut self, nodex: usize, nodey: usize, vec: Vector<T>)[src]

Set the variables stored at a specified node

pub fn get_nodes_vars(&self, nodex: usize, nodey: usize) -> Vector<T>[src]

Get the vector of variables stored at a specified node

pub fn assign(&mut self, element: T)[src]

Assign an element to all entries in the mesh

pub fn cross_section_xnode(&self, nodex: usize) -> Mesh1D<T, f64>[src]

Return a cross section of the 2D mesh at a specified x node

pub fn cross_section_ynode(&self, nodey: usize) -> Mesh1D<T, f64>[src]

Return a cross section of the 2D mesh at a specified y node

pub fn var_as_matrix(&self, var: usize) -> Matrix<T>[src]

Return a matrix for a variable corresponding to each nodal point

pub fn apply(&mut self, func: &dyn Fn(f64, f64) -> T, var: usize)[src]

Apply a function to the a specified variable in the mesh

impl Mesh2D<f64>[src]

pub fn trapezium(&self, var: usize) -> f64[src]

Integrate a given variable over the domain (trapezium rule)

pub fn square_trapezium(&self, var: usize) -> f64[src]

Integrate the square of a given variable over the domain (trapezium rule)

impl<T: Display> Mesh2D<T>[src]

pub fn output(&self, filename: &str, precision: usize)[src]

Print the mesh to a file

pub fn output_var(&self, filename: &str, var: usize, precision: usize)[src]

Print the mesh of a single variable to a file

Trait Implementations

impl<T> Index<(usize, usize)> for Mesh2D<T>[src]

type Output = Vector<T>

The returned type after indexing.

pub fn index<'a>(&'a self, node: (usize, usize)) -> &'a Vector<T>[src]

Indexing operator [] (read only) - returns the vector of variables stored at the node specified by a tuple.

impl<T> IndexMut<(usize, usize)> for Mesh2D<T>[src]

pub fn index_mut(&mut self, node: (usize, usize)) -> &mut Vector<T>[src]

Indexing operator [] (read/write) - returns the vector of variables stored at the node specified by a tuple.

Auto Trait Implementations

impl<T> RefUnwindSafe for Mesh2D<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Mesh2D<T> where
    T: Send
[src]

impl<T> Sync for Mesh2D<T> where
    T: Sync
[src]

impl<T> Unpin for Mesh2D<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Mesh2D<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,