Struct Point
pub struct Point {
pub e: Group,
pub t: Group,
pub i: f64,
pub j: f64,
pub k: f64,
pub kind: PointKind,
}
Expand description
Generic representation of a point in the mesh geometry
A Point represents a location somewhere in the mesh data. It must specify the time and energy groups, the (i,j,k) coordinates, and how these values should be interpreted.
Fields§
§e: Group
Energy Group
t: Group
Time Group
i: f64
i coordinate
j: f64
j coordinate
k: f64
k coordinate
kind: PointKind
Coordiante system
Implementations§
§impl Point
impl Point
pub fn from_xyz<T, U, V>(x: T, y: U, z: V) -> Point
pub fn from_xyz<T, U, V>(x: T, y: U, z: V) -> Point
Create a Point from (x,y,z) cartesian coordinates
Anything that can be turned into an f64
value will work. For example:
assert_eq!( Point::from_xyz(1, 2.0, 3),
Point{
i: 1.0,
j: 2.0,
k: 3.0,
kind: PointKind::Rectangular,
..Default::default()})
pub fn from_rzt<T, U, V>(r: T, z: U, t: V) -> Point
pub fn from_rzt<T, U, V>(r: T, z: U, t: V) -> Point
Create a Point from (r,z,t) cylindrical coordinates
Anything that can be turned into an f64
value will work. For example:
assert_eq!( Point::from_rzt(1, 10, 0.5),
Point{
i: 1.0,
j: 10.0,
k: 0.5,
kind: PointKind::Cylindrical,
..Default::default()})
pub fn from_ijk<T, U, V>(i: T, j: U, k: V) -> Point
pub fn from_ijk<T, U, V>(i: T, j: U, k: V) -> Point
Create a Point from (i,j,k) indexing
Note that any non-exact values will be cast to usize
at the time of
use. For example:
assert_eq!( Point::from_ijk(1, 2, 3),
Point{
i: 1.0,
j: 2.0,
k: 3.0,
kind: PointKind::Index,
..Default::default()})
pub fn from_xyz_vec<T>(values: &[T]) -> Result<Point, Error>
pub fn from_xyz_vec<T>(values: &[T]) -> Result<Point, Error>
Create a Point from an array of [x,y,z]
cartesian coordinates
Anything that can be turned into an f64
value will work. For example:
let xyz = vec![1.0, 2.0, 3.0];
assert_eq!( Point::from_xyz_vec(&xyz).unwrap(),
Point{
i: 1.0,
j: 2.0,
k: 3.0,
kind: PointKind::Rectangular,
..Default::default()})
pub fn from_rzt_vec<T>(values: &[T]) -> Result<Point, Error>
pub fn from_rzt_vec<T>(values: &[T]) -> Result<Point, Error>
Create a Point from an array of [r,z,t]
cylindrical coordinates
Anything that can be turned into an f64
value will work. For example:
let rzt = vec![1.0, 2.0, 3.0];
assert_eq!( Point::from_rzt_vec(&rzt).unwrap(),
Point{
i: 1.0,
j: 2.0,
k: 3.0,
kind: PointKind::Cylindrical,
..Default::default()})
pub fn from_ijk_vec<T>(values: &[T]) -> Result<Point, Error>
pub fn from_ijk_vec<T>(values: &[T]) -> Result<Point, Error>
Create a Point from an array of [i,j,k]
indices
Note that any non-exact values will be cast to usize
at the time of
use. For example:
let ijk = vec![1, 2, 3];
assert_eq!( Point::from_ijk_vec(&ijk).unwrap(),
Point{
i: 1.0,
j: 2.0,
k: 3.0,
kind: PointKind::Index,
..Default::default()})
Trait Implementations§
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.