pub struct NodeSpace<const N: usize> {
pub size: [usize; N],
pub ghost: usize,
pub bounds: HyperBox<N>,
pub boundary: FaceArray<N, BoundaryClass>,
}Expand description
A uniform rectangular domain of nodes to which various derivative and interpolations can be applied.
Fields§
§size: [usize; N]Number of cells along each axis (one less than then number of vertices).
ghost: usizeNumber of ghost nodes along each face.
bounds: HyperBox<N>Position of the node space.
boundary: FaceArray<N, BoundaryClass>Implementations§
Source§impl<const N: usize> NodeSpace<N>
impl<const N: usize> NodeSpace<N>
pub fn ghost(&self) -> usize
pub fn cell_size(&self) -> [usize; N]
pub fn vertex_size(&self) -> [usize; N]
pub fn node_size(&self) -> [usize; N]
pub fn spacing_axis(&self, axis: usize) -> f64
Sourcepub fn is_interior(&self, node: [isize; N]) -> bool
pub fn is_interior(&self, node: [isize; N]) -> bool
Returns true if the node lies inside the interior of the nodespace (i.e. it is not a ghost node).
Sourcepub fn index_from_node(&self, node: [isize; N]) -> usize
pub fn index_from_node(&self, node: [isize; N]) -> usize
Computes a linear index from a nodal index.
Sourcepub fn index_from_vertex(&self, vertex: [usize; N]) -> usize
pub fn index_from_vertex(&self, vertex: [usize; N]) -> usize
Computes a linear index from a vertex index.
Sourcepub fn inner_window(&self) -> NodeWindow<N>
pub fn inner_window(&self) -> NodeWindow<N>
Returns a window of just the interior and edges of the node space (no ghost nodes).
Sourcepub fn full_window(&self) -> NodeWindow<N>
pub fn full_window(&self) -> NodeWindow<N>
Returns the window which encompasses the whole node space
Sourcepub fn region_window(&self, extent: usize, region: Region<N>) -> NodeWindow<N>
pub fn region_window(&self, extent: usize, region: Region<N>) -> NodeWindow<N>
Returns a window over a region of the node space.
Sourcepub fn face_window(&self, _: Face<N>) -> NodeWindow<N>
pub fn face_window(&self, _: Face<N>) -> NodeWindow<N>
Returns a window over all nodes on a given face.
pub fn face_window_disjoint(&self, face: Face<N>) -> NodeWindow<N>
pub fn contains_window(&self, window: NodeWindow<N>) -> bool
Sourcepub fn fill_boundary(
&self,
extent: usize,
cond: impl BoundaryConds<N>,
dest: &mut [f64],
)
pub fn fill_boundary( &self, extent: usize, cond: impl BoundaryConds<N>, dest: &mut [f64], )
Set strongly enforced boundary conditions. This enforces parity and dirichlet boundary
conditions on this particular NodeSpace.
Sourcepub fn apply(
&self,
corner: [isize; N],
stencils: [&[f64]; N],
field: &[f64],
) -> f64
pub fn apply( &self, corner: [isize; N], stencils: [&[f64]; N], field: &[f64], ) -> f64
Applies a tensor product of stencils to a given field.
Sourcepub fn apply_axis(
&self,
corner: [isize; N],
stencil: &[f64],
field: &[f64],
axis: usize,
) -> f64
pub fn apply_axis( &self, corner: [isize; N], stencil: &[f64], field: &[f64], axis: usize, ) -> f64
Applies a single stencil along an axis to a given field.
pub fn evaluate_interior( &self, convolution: impl Convolution<N>, node: [isize; N], field: &[f64], ) -> f64
pub fn evaluate_axis_interior( &self, kernel: impl Kernel, node: [isize; N], field: &[f64], axis: usize, ) -> f64
Sourcepub fn evaluate(
&self,
convolution: impl Convolution<N>,
node: [isize; N],
field: &[f64],
) -> f64
pub fn evaluate( &self, convolution: impl Convolution<N>, node: [isize; N], field: &[f64], ) -> f64
Evaluates the operation of a convolution at a given node.
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for NodeSpace<N>
impl<const N: usize> RefUnwindSafe for NodeSpace<N>
impl<const N: usize> Send for NodeSpace<N>
impl<const N: usize> Sync for NodeSpace<N>
impl<const N: usize> Unpin for NodeSpace<N>
impl<const N: usize> UnsafeUnpin for NodeSpace<N>
impl<const N: usize> UnwindSafe for NodeSpace<N>
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.