Struct castep_model_core::atom::AtomCollection
source · pub struct AtomCollection<T: ModelInfo> { /* private fields */ }Expand description
Struct of Atom as data-driven design.
Implementations§
source§impl<T: ModelInfo> AtomCollection<T>
impl<T: ModelInfo> AtomCollection<T>
sourcepub fn update_symbol_at(
&mut self,
index: usize,
new_symbol: &str
) -> Result<(), InvalidIndex>
pub fn update_symbol_at(
&mut self,
index: usize,
new_symbol: &str
) -> Result<(), InvalidIndex>
Update the element_symbol at the given index.
Errors
This function will return an error if the index is out of bounds.
sourcepub fn update_elm_id_at(
&mut self,
index: usize,
new_elm_id: u8
) -> Result<(), InvalidIndex>
pub fn update_elm_id_at(
&mut self,
index: usize,
new_elm_id: u8
) -> Result<(), InvalidIndex>
Update the element_id at the given index.
Errors
This function will return an error if the index is out of bounds.
sourcepub fn update_xyz_at(
&mut self,
index: usize,
new_xyz: Point3<f64>
) -> Result<(), InvalidIndex>
pub fn update_xyz_at(
&mut self,
index: usize,
new_xyz: Point3<f64>
) -> Result<(), InvalidIndex>
Update the xyz at the given index.
Errors
This function will return an error if the index is out of bounds.
sourcepub fn update_frac_xyz_at(
&mut self,
index: usize,
new_frac: Option<Point3<f64>>
) -> Result<(), InvalidIndex>
pub fn update_frac_xyz_at(
&mut self,
index: usize,
new_frac: Option<Point3<f64>>
) -> Result<(), InvalidIndex>
Update the fractional_xyz at the given index.
Errors
This function will return an error if the index is out of bounds.
sourcepub fn update_atom_id_at(
&mut self,
index: usize,
new_atom_id: u32
) -> Result<(), InvalidIndex>
pub fn update_atom_id_at(
&mut self,
index: usize,
new_atom_id: u32
) -> Result<(), InvalidIndex>
Update the atom_id at the given index.
Errors
This function will return an error if the index is out of bounds.
sourcepub fn update_atom_at(
&mut self,
index: usize,
new_atom: Atom<T>
) -> Result<(), InvalidIndex>
pub fn update_atom_at(
&mut self,
index: usize,
new_atom: Atom<T>
) -> Result<(), InvalidIndex>
Update the whole atom at the given index.
Errors
This function will return an error if the index is out of bounds.
pub fn element_symbols(&self) -> &[String]
pub fn atomic_nums(&self) -> &[u8] ⓘ
pub fn xyz_coords(&self) -> &[Point3<f64>]
pub fn xyz_coords_mut(&mut self) -> &mut [Point3<f64>]
pub fn fractional_xyz(&self) -> &[Option<Point3<f64>>]
pub fn fractional_xyz_mut(&mut self) -> &mut [Option<Point3<f64>>]
pub fn atom_ids(&self) -> &[u32]
pub fn size(&self) -> usize
Trait Implementations§
source§impl<T: ModelInfo> Add<AtomCollection<T>> for AtomCollection<T>
impl<T: ModelInfo> Add<AtomCollection<T>> for AtomCollection<T>
source§impl<T: ModelInfo> AsRef<AtomCollection<T>> for &AtomCollection<T>
impl<T: ModelInfo> AsRef<AtomCollection<T>> for &AtomCollection<T>
source§fn as_ref(&self) -> &AtomCollection<T>
fn as_ref(&self) -> &AtomCollection<T>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<T: Clone + ModelInfo> Clone for AtomCollection<T>
impl<T: Clone + ModelInfo> Clone for AtomCollection<T>
source§fn clone(&self) -> AtomCollection<T>
fn clone(&self) -> AtomCollection<T>
Returns a copy 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<T: Default + ModelInfo> Default for AtomCollection<T>
impl<T: Default + ModelInfo> Default for AtomCollection<T>
source§fn default() -> AtomCollection<T>
fn default() -> AtomCollection<T>
Returns the “default value” for a type. Read more
source§impl Display for AtomCollection<CellModel>
impl Display for AtomCollection<CellModel>
source§impl Display for AtomCollection<MsiModel>
impl Display for AtomCollection<MsiModel>
source§impl<'a, T: ModelInfo> From<&'a AtomCollection<T>> for Vec<AtomView<'a, T>>
impl<'a, T: ModelInfo> From<&'a AtomCollection<T>> for Vec<AtomView<'a, T>>
source§fn from(src: &'a AtomCollection<T>) -> Self
fn from(src: &'a AtomCollection<T>) -> Self
Converts to this type from the input type.
source§impl From<AtomCollection<MsiModel>> for AtomCollection<CellModel>
impl From<AtomCollection<MsiModel>> for AtomCollection<CellModel>
source§fn from(src: AtomCollection<MsiModel>) -> Self
fn from(src: AtomCollection<MsiModel>) -> Self
Converts to this type from the input type.
source§impl<T: ModelInfo> From<AtomCollection<T>> for Vec<Atom<T>>
impl<T: ModelInfo> From<AtomCollection<T>> for Vec<Atom<T>>
source§fn from(src: AtomCollection<T>) -> Self
fn from(src: AtomCollection<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<T> for AtomCollection<MsiModel>where
T: AsRef<AtomCollection<CellModel>>,
impl<T> From<T> for AtomCollection<MsiModel>where
T: AsRef<AtomCollection<CellModel>>,
source§impl<T> Transformation for AtomCollection<T>where
T: ModelInfo,
impl<T> Transformation for AtomCollection<T>where
T: ModelInfo,
fn rotate(&mut self, rotate_quatd: &UnitQuaternion<f64>)
fn translate(&mut self, translate_matrix: &Translation<f64, 3>)
source§impl<T> VisitCollection<T> for AtomCollection<T>where
T: ModelInfo,
impl<T> VisitCollection<T> for AtomCollection<T>where
T: ModelInfo,
fn get_xyz_by_id(&self, atom_id: u32) -> Option<&Point3<f64>>
fn get_multiple_xyz_by_id<'a, 'b>(
&'a self,
atom_ids: &'b [u32]
) -> Vec<Option<&'a Point3<f64>>> ⓘ
fn view_atom_at_index(
&self,
index: usize
) -> Result<AtomView<'_, T>, InvalidIndex>
fn view_atom_by_id(&self, atom_id: u32) -> Result<AtomView<'_, T>, InvalidIndex>
fn get_vector_ab(
&self,
a_id: u32,
b_id: u32
) -> Result<Vector3<f64>, InvalidIndex>
fn element_set(&self) -> Vec<String> ⓘ
fn spin_total(&self) -> u8
fn get_final_cutoff_energy(&self, potentials_loc: &str) -> Result<f64, Error>
Auto Trait Implementations§
impl<T> RefUnwindSafe for AtomCollection<T>where
T: RefUnwindSafe,
impl<T> Send for AtomCollection<T>where
T: Send,
impl<T> Sync for AtomCollection<T>where
T: Sync,
impl<T> Unpin for AtomCollection<T>where
T: Unpin,
impl<T> UnwindSafe for AtomCollection<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.