[−]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_mut(&mut self) -> ParticleRefMut<'_>

Create a ParticleRefMut from a mutably borrowed Particle .

Blanket Implementations

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.