[]Struct lumol::sys::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

Methods

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<'a> From<&'a Atom> for Particle

impl Clone for Particle

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Particle

Auto Trait Implementations

impl Send for Particle

impl Sync for Particle

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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