pub struct UniformGridField {
pub shape: [usize; 3],
pub origin: [f64; 3],
pub cell: [[f64; 3]; 3],
pub pbc: [bool; 3],
pub values: Vec<f64>,
}Expand description
Uniform real-space grid samples of a scalar field.
Fields§
§shape: [usize; 3]Number of samples along each cell direction.
origin: [f64; 3]Cartesian origin of the grid in Angstrom.
cell: [[f64; 3]; 3]Cell vectors in Angstrom. Positions are
origin + (i/nx) a + (j/ny) b + (k/nz) c.
pbc: [bool; 3]Periodicity flags for the sampled domain.
values: Vec<f64>Scalar field samples stored in row-major [ix, iy, iz] order.
Implementations§
Source§impl UniformGridField
impl UniformGridField
Sourcepub fn validate(&self) -> Result<(), MolRsError>
pub fn validate(&self) -> Result<(), MolRsError>
Validate grid dimensions and storage.
Sourcepub fn sample_position(&self, ix: usize, iy: usize, iz: usize) -> [f64; 3]
pub fn sample_position(&self, ix: usize, iy: usize, iz: usize) -> [f64; 3]
Return the sample position in Cartesian Angstrom.
Sourcepub fn index(&self, ix: usize, iy: usize, iz: usize) -> usize
pub fn index(&self, ix: usize, iy: usize, iz: usize) -> usize
Flattened sample index for row-major [ix, iy, iz] order.
Sourcepub fn to_point_cloud_frame(
&self,
threshold: f64,
stride: usize,
) -> Result<Frame, MolRsError>
pub fn to_point_cloud_frame( &self, threshold: f64, stride: usize, ) -> Result<Frame, MolRsError>
Convert to a coarse point-cloud frame for debugging/validation.
Trait Implementations§
Source§impl Clone for UniformGridField
impl Clone for UniformGridField
Source§fn clone(&self) -> UniformGridField
fn clone(&self) -> UniformGridField
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 UniformGridField
impl Debug for UniformGridField
Source§impl<'de> Deserialize<'de> for UniformGridField
impl<'de> Deserialize<'de> for UniformGridField
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UniformGridField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UniformGridField, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for UniformGridField
impl PartialEq for UniformGridField
Source§impl Serialize for UniformGridField
impl Serialize for UniformGridField
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for UniformGridField
Auto Trait Implementations§
impl Freeze for UniformGridField
impl RefUnwindSafe for UniformGridField
impl Send for UniformGridField
impl Sync for UniformGridField
impl Unpin for UniformGridField
impl UnsafeUnpin for UniformGridField
impl UnwindSafe for UniformGridField
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