pub struct Point<P> {
pub position: P,
}Expand description
Fields§
§position: PThe location of the point in space.
Implementations§
Trait Implementations§
Source§impl<B, X> AppendMicrostate<B, Point<Cartesian<2>>, X, Closed<Hypercuboid<2>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, Point<Cartesian<2>>, X, Closed<Hypercuboid<2>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, Point<Cartesian<2>>, X, Closed<Hypercuboid<2>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, Point<Cartesian<2>>, X, Closed<Hypercuboid<2>>>, ) -> Result<Frame<'_>, AppendError>
Source§impl<B, X> AppendMicrostate<B, Point<Cartesian<2>>, X, Periodic<Hypercuboid<2>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, Point<Cartesian<2>>, X, Periodic<Hypercuboid<2>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, Point<Cartesian<2>>, X, Periodic<Hypercuboid<2>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, Point<Cartesian<2>>, X, Periodic<Hypercuboid<2>>>, ) -> Result<Frame<'_>, AppendError>
Source§impl<B, X> AppendMicrostate<B, Point<Cartesian<3>>, X, Closed<Hypercuboid<3>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, Point<Cartesian<3>>, X, Closed<Hypercuboid<3>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, Point<Cartesian<3>>, X, Closed<Hypercuboid<3>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, Point<Cartesian<3>>, X, Closed<Hypercuboid<3>>>, ) -> Result<Frame<'_>, AppendError>
Source§impl<B, X> AppendMicrostate<B, Point<Cartesian<3>>, X, Periodic<Hypercuboid<3>>> for HoomdGsdFile
impl<B, X> AppendMicrostate<B, Point<Cartesian<3>>, X, Periodic<Hypercuboid<3>>> for HoomdGsdFile
Source§fn append_microstate(
&mut self,
microstate: &Microstate<B, Point<Cartesian<3>>, X, Periodic<Hypercuboid<3>>>,
) -> Result<Frame<'_>, AppendError>
fn append_microstate( &mut self, microstate: &Microstate<B, Point<Cartesian<3>>, X, Periodic<Hypercuboid<3>>>, ) -> Result<Frame<'_>, AppendError>
Source§impl<'de, P> Deserialize<'de> for Point<P>where
P: Deserialize<'de>,
impl<'de, P> Deserialize<'de> for Point<P>where
P: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl GenerateGhosts<Point<Hyperbolic<3>>> for Periodic<EightEight>
impl GenerateGhosts<Point<Hyperbolic<3>>> for Periodic<EightEight>
Source§fn generate_ghosts(
&self,
site_properties: &Point<Hyperbolic<3>>,
) -> ArrayVec<Point<Hyperbolic<3>>, MAX_GHOSTS>
fn generate_ghosts( &self, site_properties: &Point<Hyperbolic<3>>, ) -> ArrayVec<Point<Hyperbolic<3>>, MAX_GHOSTS>
Place periodic images of sites near the edge of the periodic boundary
Source§fn maximum_interaction_range(&self) -> f64
fn maximum_interaction_range(&self) -> f64
Source§impl<const N: usize> Transform<Point<Cartesian<N>>> for Point<Cartesian<N>>
Move Point properties from the local body frame to the system frame.
impl<const N: usize> Transform<Point<Cartesian<N>>> for Point<Cartesian<N>>
Move Point properties from the local body frame to the system frame.
Source§fn transform(
&self,
site_properties: &Point<Cartesian<N>>,
) -> Point<Cartesian<N>>
fn transform( &self, site_properties: &Point<Cartesian<N>>, ) -> Point<Cartesian<N>>
Points transform by vector addition.
\vec{r} = \vec{r}_\mathrm{body} + \vec{r}_\mathrm{site}use hoomd_microstate::{Transform, property::Point};
use hoomd_vector::Cartesian;
let body_properties = Point::new(Cartesian::from([1.0, -2.0, 3.0]));
let site_properties = Point::new(Cartesian::from([-3.0, 2.0, 1.0]));
let system_site = body_properties.transform(&site_properties);
assert_eq!(system_site.position, [-2.0, 0.0, 4.0].into());Source§impl Transform<Point<Hyperbolic<3>>> for OrientedHyperbolicPoint<3, Angle>
Treat Point<Hyperbolic<3>> sites as constituents of oriented rigid bodies.
impl Transform<Point<Hyperbolic<3>>> for OrientedHyperbolicPoint<3, Angle>
Treat Point<Hyperbolic<3>> sites as constituents of oriented rigid bodies.
Source§fn transform(
&self,
site_properties: &Point<Hyperbolic<3>>,
) -> Point<Hyperbolic<3>>
fn transform( &self, site_properties: &Point<Hyperbolic<3>>, ) -> Point<Hyperbolic<3>>
Move Point<Hyperbolic<3>> properties from the local body frame to the system frame.
use approxim::assert_relative_eq;
use hoomd_manifold::Hyperbolic;
use hoomd_microstate::{
Transform,
property::{OrientedHyperbolicPoint, Point},
};
use hoomd_vector::Angle;
use std::f64::consts::PI;
let body_boost = 1.1;
let body_orientation = PI / 2.0;
let site_boost = 0.1;
let body = OrientedHyperbolicPoint {
position: Hyperbolic::<3>::from_polar_coordinates(body_boost, 0.0),
orientation: Angle::from(body_orientation),
};
let site = Point::new(Hyperbolic::<3>::from_polar_coordinates(
site_boost,
-PI / 4.0,
));
let transformed_site = body.transform(&site);
assert_relative_eq!(
*transformed_site.position.point(),
[
(body_boost.sinh()) * (site_boost.cosh())
+ ((PI / 4.0).cos())
* (body_boost.cosh())
* (site_boost.sinh()),
((PI / 4.0).sin()) * site_boost.sinh(),
(body_boost.cosh()) * (site_boost.cosh())
+ ((PI / 4.0).cos())
* (body_boost.sinh())
* (site_boost.sinh()),
]
.into(),
epsilon = 1e-12
);Source§impl Transform<Point<Hyperbolic<3>>> for Point<Hyperbolic<3>>
impl Transform<Point<Hyperbolic<3>>> for Point<Hyperbolic<3>>
Source§fn transform(
&self,
site_properties: &Point<Hyperbolic<3>>,
) -> Point<Hyperbolic<3>>
fn transform( &self, site_properties: &Point<Hyperbolic<3>>, ) -> Point<Hyperbolic<3>>
Move Point<Hyperbolic<3>> properties from the local body frame to the
system frame.
All positions in hyperbolic space are associated with some $SO(2,1)$
transformation which translates the origin to that position. The local
body frame is the frame in which the body position is the origin. The
position of the sites in the system frame is obtained by applying the
transformation associated with the body’s position to the sites in the
local body frame.
Source§impl Transform<Point<Hyperbolic<4>>> for Point<Hyperbolic<4>>
impl Transform<Point<Hyperbolic<4>>> for Point<Hyperbolic<4>>
Source§fn transform(
&self,
site_properties: &Point<Hyperbolic<4>>,
) -> Point<Hyperbolic<4>>
fn transform( &self, site_properties: &Point<Hyperbolic<4>>, ) -> Point<Hyperbolic<4>>
Move Point<Hyperbolic<4>> properties from the local body frame to the
system frame.
All positions in hyperbolic space are associated with some $SO(3,1)$
transformation which translates the origin to that position. The local
body frame is the frame in which the body position is the origin. The
position of the sites in the system frame is obtained by applying the
transformation associated with the body’s position to the sites in the
local body frame.
Source§impl Transform<Point<Spherical<3>>> for Point<Spherical<3>>
impl Transform<Point<Spherical<3>>> for Point<Spherical<3>>
Source§fn transform(
&self,
site_properties: &Point<Spherical<3>>,
) -> Point<Spherical<3>>
fn transform( &self, site_properties: &Point<Spherical<3>>, ) -> Point<Spherical<3>>
Move Point<Sphere<3>> properties from the local body frame to the
system frame.
All positions on the 2-sphere are associated with some $SO(3)$
transformation which translates the origin to that position. The local
body frame is the frame in which the body position is the origin. The
position of the sites in the system frame is obtained by applying the
transformation associated with the body’s position to the sites in the
local body frame.
Source§impl Transform<Point<Spherical<4>>> for Point<Spherical<4>>
impl Transform<Point<Spherical<4>>> for Point<Spherical<4>>
Source§fn transform(
&self,
site_properties: &Point<Spherical<4>>,
) -> Point<Spherical<4>>
fn transform( &self, site_properties: &Point<Spherical<4>>, ) -> Point<Spherical<4>>
Move Point<Sphere<4>> properties from the local body frame to the
system frame.
All positions on the 3-sphere are associated with some $SO(4)$
transformation which translates the origin to that position. The local
body frame is the frame in which the body position is the origin. The
position of the sites in the system frame is obtained by applying the
transformation associated with the body’s position to the sites in the
local body frame.
Source§impl<V, R> Transform<Point<V>> for OrientedPoint<V, R>
Treat Point sites as constituents of oriented rigid bodies.
impl<V, R> Transform<Point<V>> for OrientedPoint<V, R>
Treat Point sites as constituents of oriented rigid bodies.
Source§fn transform(&self, site_properties: &Point<V>) -> Point<V>
fn transform(&self, site_properties: &Point<V>) -> Point<V>
Move Point properties from the local body frame to the system frame.
\vec{r} = \vec{r}_\mathrm{body} + R_\mathrm{body}(\vec{r}_\mathrm{site})use approxim::assert_relative_eq;
use hoomd_microstate::{
Transform,
property::{OrientedPoint, Point},
};
use hoomd_vector::{Angle, Cartesian};
use std::f64::consts::PI;
let body_properties = OrientedPoint {
position: Cartesian::from([1.0, -2.0]),
orientation: Angle::from(PI / 2.0),
};
let site_properties = Point::new(Cartesian::from([-1.0, 0.0]));
let system_site = body_properties.transform(&site_properties);
assert_relative_eq!(system_site.position, [1.0, -3.0].into());Source§impl Wrap<Point<Hyperbolic<3>>> for Periodic<EightEight>
impl Wrap<Point<Hyperbolic<3>>> for Periodic<EightEight>
Source§fn wrap(
&self,
properties: Point<Hyperbolic<3>>,
) -> Result<Point<Hyperbolic<3>>, Error>
fn wrap( &self, properties: Point<Hyperbolic<3>>, ) -> Result<Point<Hyperbolic<3>>, Error>
Wrap a point on the Hyperbolic to the inside of the {8,8} tile.
Note that the function fails to wrap points that are outside the octagon
and further than EightEight::EDGE_LENGTH/2 from any of the vertices. In
this case, the function returns Error::CannotWrapProperties
§Example
use approxim::assert_relative_eq;
use hoomd_geometry::shape::EightEight;
use hoomd_manifold::Hyperbolic;
use hoomd_microstate::{
boundary::{Periodic, Wrap},
property::Point,
};
use std::f64::consts::PI;
const EIGHTEIGHT: f64 = EightEight::EIGHTEIGHT;
let offset = PI / 8.0;
let boost = 2.0;
let point =
Hyperbolic::<3>::from_polar_coordinates(boost, offset + PI / 4.0);
let point = Point::new(point);
let periodic = Periodic::new(0.5, EightEight {})?;
let wrapped_point = periodic.wrap(point)?;
let new_boost = 2.0
* (EIGHTEIGHT.tanh()
/ (offset.cos() - offset.sin() * (1.0 - (2.0_f64).sqrt())))
.atanh()
- boost;
let ans = Hyperbolic::<3>::from_polar_coordinates(
new_boost,
6.0 * PI / 4.0 - offset,
);
assert_relative_eq!(
ans.coordinates()[0],
wrapped_point.position.coordinates()[0],
epsilon = 1e-12
);
assert_relative_eq!(
ans.coordinates()[1],
wrapped_point.position.coordinates()[1],
epsilon = 1e-12
);
assert_relative_eq!(
ans.coordinates()[2],
wrapped_point.position.coordinates()[2],
epsilon = 1e-12
);impl<P: Copy> Copy for Point<P>
impl<P> StructuralPartialEq for Point<P>
Auto Trait Implementations§
impl<P> Freeze for Point<P>where
P: Freeze,
impl<P> RefUnwindSafe for Point<P>where
P: RefUnwindSafe,
impl<P> Send for Point<P>where
P: Send,
impl<P> Sync for Point<P>where
P: Sync,
impl<P> Unpin for Point<P>where
P: Unpin,
impl<P> UnsafeUnpin for Point<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Point<P>where
P: UnwindSafe,
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