Structure
This submodule contains utility functions to analyse and modify atomic structure data, such as interatomic distances, centres of mass, both with and without support for periodic boundary conditions.
These functions can be used to build more sophisticated output functions, or for basic analysis of simulation results in post.
This module doesn't contain:
- Basic definitions of atomic structures (e.g.
Atoms
,PeriodicCell
, ...). These are defined inNQCBase
. - Functions to generate atomic structures. These should be added to
NQCDynamics.InitialConditions
. - Analysis functions for specific systems (e.g. molecules on surfaces). These should be added to
NQCDynamics.Analysis
.
Method reference
NQCDynamics.Structure.angle_between
— Methodangle_between(v1::Vector, v2::Vector)
Returns the angle between two vectors in º based on the scalar product definition.
NQCDynamics.Structure.center_of_mass
— Methodcenter_of_mass(config::Matrix, ind1::Int, ind2::Int, atoms::Atoms)
Generates center of mass coordinates for two atoms.
NQCDynamics.Structure.distance
— Methoddistance(config::AbstractVector, i1::int_or_index, i2::int_or_index)
Interatomic distance in Angstrom for DynamicsVariables.
NQCDynamics.Structure.distance
— Methoddistance(config::Matrix, i1, i2)
Interatomic distance in Angstrom for a position Matrix.
NQCDynamics.Structure.fractional_mass
— Methodfractional_mass(sim::Simulation, index1::Int, index2::Int)
Returns m1/(m1+m2) and m2/(m1+m2) as a vector.
NQCDynamics.Structure.fractional_mass
— Methodfractional_mass(sim::NQCDynamics.AbstractSimulation, index1::Int, index2::Int)
Returns m1/(m1+m2) and m2/(m1+m2) as a vector.
NQCDynamics.Structure.minimum_distance_translation
— Methodminimum_distance_translation(config::Matrix, ind1::Int, ind2::Int, simulation::AbstractSimulation)
Outputs a translation vector to move config[:,ind2] such that the closest distance between ind1
and ind2
is reached. **The search of neighbouring unit cells will expand until the cutoff. If configurations are already subject to a minimum image convention, cutoff=1
reduces unnecessary overhead. **
NQCDynamics.Structure.pbc_center_of_mass
— Methodpbc_center_of_mass(config::Matrix, ind1::Int, ind2::Int, cell::PeriodicCell, atoms::Atoms;args...)
Generates center of mass coordinates for two atoms, including a check if the copy of the second atom in any neighbouring unit cell is closer.
NQCDynamics.Structure.pbc_distance
— Methodpbc_distance(config::Matrix, ind1::int_or_index, ind2::int_or_index, simulation::NQCDynamics.AbstractSimulation)
Returns in Angstom, not in Bohr - Check units.
Calculates the distance between two atoms, including a check if the copy of the second atom in any neighbouring unit cell is closer. This variant is designed for trajectories where cell boundary wrapping has been used.
NQCDynamics.Structure.reduced_mass
— Methodreduced_mass(sim::Simulation, index1::Int, index2::Int)
Returns the reduced mass of the diatomic in atomic unit.
NQCDynamics.Structure.velocity_center_of_mass
— Methodvelocity_center_of_mass(config::Matrix, ind1::Int, ind2::Int, simulation::NQCDynamics.AbstractSimulation)
sum(m_i*v_i)/sum(m_i)