pub struct ParticleSoa {Show 18 fields
pub pos_x: Vec<f64>,
pub pos_y: Vec<f64>,
pub pos_z: Vec<f64>,
pub vel_x: Vec<f64>,
pub vel_y: Vec<f64>,
pub vel_z: Vec<f64>,
pub accel_x: Vec<f64>,
pub accel_y: Vec<f64>,
pub accel_z: Vec<f64>,
pub density: Vec<f64>,
pub pressure: Vec<f64>,
pub mass: Vec<f64>,
pub phase: Vec<u8>,
pub conf_xx: Vec<f64>,
pub conf_xy: Vec<f64>,
pub conf_yy: Vec<f64>,
pub temperature: Vec<f64>,
pub fuel: Vec<f64>,
}Expand description
Fields§
§pos_x: Vec<f64>§pos_y: Vec<f64>§pos_z: Vec<f64>§vel_x: Vec<f64>§vel_y: Vec<f64>§vel_z: Vec<f64>§accel_x: Vec<f64>§accel_y: Vec<f64>§accel_z: Vec<f64>§density: Vec<f64>§pressure: Vec<f64>§mass: Vec<f64>§phase: Vec<u8>§conf_xx: Vec<f64>§conf_xy: Vec<f64>§conf_yy: Vec<f64>§temperature: Vec<f64>§fuel: Vec<f64>Implementations§
Source§impl ParticleSoa
impl ParticleSoa
Sourcepub fn with_capacity(n: usize) -> Self
pub fn with_capacity(n: usize) -> Self
Create a SOA store with given capacity.
Sourcepub fn from_aos(particles: &[FluidParticle]) -> Self
pub fn from_aos(particles: &[FluidParticle]) -> Self
Convert from a slice of AOS particles.
Sourcepub fn to_aos(&self) -> Vec<FluidParticle>
pub fn to_aos(&self) -> Vec<FluidParticle>
Convert back to AOS particles.
Sourcepub fn write_to_aos(&self, particles: &mut [FluidParticle])
pub fn write_to_aos(&self, particles: &mut [FluidParticle])
Write SOA data back into an existing AOS slice (avoids allocation).
Sourcepub fn distance_squared(&self, i: usize, j: usize) -> f64
pub fn distance_squared(&self, i: usize, j: usize) -> f64
Squared distance between particles i and j.
Trait Implementations§
Source§impl Clone for ParticleSoa
impl Clone for ParticleSoa
Source§fn clone(&self) -> ParticleSoa
fn clone(&self) -> ParticleSoa
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParticleSoa
impl Debug for ParticleSoa
Source§impl Default for ParticleSoa
impl Default for ParticleSoa
Source§impl<'de> Deserialize<'de> for ParticleSoa
impl<'de> Deserialize<'de> for ParticleSoa
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ParticleSoa
impl RefUnwindSafe for ParticleSoa
impl Send for ParticleSoa
impl Sync for ParticleSoa
impl Unpin for ParticleSoa
impl UnsafeUnpin for ParticleSoa
impl UnwindSafe for ParticleSoa
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
Mutably borrows from an owned value. Read more