[]Struct lumol::Particle

pub struct Particle {
    pub name: String,
    pub kind: ParticleKind,
    pub charge: f64,
    pub mass: f64,
    pub position: Vector3D,
    pub velocity: Vector3D,
}

The Particle type hold basic data about a particle in the system. It is self contained, so that it will be easy to send data between parallels processes.

Fields

name: String

Particle name.

kind: ParticleKind

Particle kind, an index for potentials lookup

charge: f64

Particle charge

mass: f64

Particle mass

position: Vector3D

Particle positions

velocity: Vector3D

Particle velocity, if needed

Implementations

impl Particle

pub fn new<S>(name: S) -> Particle where
    S: Into<String>, 

Create a new Particle from a name, setting the mass to the atomic mass if the name can be found in the periodic table. The charge, position, and velocity are set to 0.

pub fn with_position<S>(name: S, position: Vector3D) -> Particle where
    S: Into<String>, 

Create a new Particle from a name and a position, setting the mass to the atomic mass if the name can be found in the periodic table. The charge and velocity are set to 0.

impl Particle

pub fn as_ref(&self) -> ParticleRef<'_>

Create a ParticleRef from a borrowed Particle .

pub fn as_mut(&mut self) -> ParticleRefMut<'_>

Create a ParticleRefMut from a mutably borrowed Particle .

Trait Implementations

impl Clone for Particle

impl Debug for Particle

impl<'a> From<&'a Atom> for Particle

impl FromIterator<Particle> for ParticleVec

Auto Trait Implementations

impl RefUnwindSafe for Particle

impl Send for Particle

impl Sync for Particle

impl Unpin for Particle

impl UnwindSafe for Particle

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> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,