ForceAtom

class sknano.core.atoms.force_atoms.ForceAtom(*args, fx=None, fy=None, fz=None, **kwargs)[source] [edit on github][source]

Bases: sknano.core.atoms.atoms.Atom

An Atom sub-class with force attributes.

Parameters:
  • element ({str, int}, optional) – A string representation of the element symbol or an integer specifying an element atomic number.
  • fy, fz (fx,) – \(f_x, f_y, f_z\) components of ForceAtom velocity.

Attributes

Z Atomic number \(Z\).
element Element symbol.
f \(f_x, f_y, f_z\) array of force vector components.
fmtstr Format string.
fx \(x\) component of ForceAtom force vector
fy \(x\) component of ForceAtom force vector
fz \(z\) component of ForceAtom force vector
m An alias for mass.
mass Atomic mass \(m_a\) in atomic mass units.
symbol Element symbol.

Methods

getattr(attr[, default, recursive]) Get atom attribute named attr.
reset_attrs(**kwargs) Reset atom attributes.
rezero([epsilon]) Re-zero position vector components.
rotate(**kwargs) Rotate Atom position vector.
todict() Return dict of constructor parameters.
update_attrs(**kwargs) Update atom attributes.

Attributes Summary

f \(f_x, f_y, f_z\) array of force vector components.
fx \(x\) component of ForceAtom force vector
fy \(x\) component of ForceAtom force vector
fz \(z\) component of ForceAtom force vector

Methods Summary

rezero([epsilon]) Re-zero position vector components.
rotate(**kwargs) Rotate Atom position vector.
todict() Return dict of constructor parameters.

Attributes Documentation

f

\(f_x, f_y, f_z\) array of force vector components.

Returns:3-element ndarray of [\(f_x\), \(f_y\), \(f_z\)] force vector components of ForceAtom.
Return type:ndarray
fx

\(x\) component of ForceAtom force vector

fy

\(x\) component of ForceAtom force vector

fz

\(z\) component of ForceAtom force vector

Methods Documentation

rezero(epsilon=1e-10)[source] [edit on github][source]

Re-zero position vector components.

Set position vector components with absolute value less than epsilon to zero.

Parameters:epsilon (float) – smallest allowed absolute value of any \(x,y,z\) component.
rotate(**kwargs)[source] [edit on github][source]

Rotate Atom position vector.

Parameters:
  • angle (float) –
  • axis (Vector, optional) –
  • anchor_point (Point, optional) –
  • rot_point (Point, optional) –
  • to_vector (from_vector,) –
  • degrees (bool, optional) –
  • transform_matrix (ndarray) –
todict()[source] [edit on github][source]

Return dict of constructor parameters.