Static class providing dynamics analysis methods.
More...
#include <DynamicsAnalyzer.hpp>
|
| static std::vector< real_t > | calculateVACF (const correlation::core::Trajectory &traj, MaxFrames max_correlation_frames, StartFrame start_frame={0}, EndFrame end_frame={static_cast< size_t >(-1)}) |
| | Calculates the Velocity Autocorrelation Function (VACF).
|
| static std::vector< real_t > | calculateNormalizedVACF (const correlation::core::Trajectory &traj, MaxFrames max_correlation_frames, StartFrame start_frame={0}, EndFrame end_frame={static_cast< size_t >(-1)}) |
| | Calculates the Normalized Velocity Autocorrelation Function. Divides the VACF by its initial value (at t=0).
|
| static std::vector< real_t > | calculateMSD (const correlation::core::Trajectory &traj, MaxFrames max_correlation_frames, StartFrame start_frame={0}, EndFrame end_frame={static_cast< size_t >(-1)}, bool remove_com_drift=true) |
| | Calculates the Mean Squared Displacement (MSD).
|
| static PartialMSDResult | calculatePartialMSD (const correlation::core::Trajectory &traj, MaxFrames max_correlation_frames, StartFrame start_frame={0}, EndFrame end_frame={static_cast< size_t >(-1)}, bool remove_com_drift=true) |
| | Calculates total and per-element Mean Squared Displacements (MSD).
|
| static PartialVACFResult | calculatePartialVACF (const correlation::core::Trajectory &traj, MaxFrames max_correlation_frames, StartFrame start_frame={0}, EndFrame end_frame={static_cast< size_t >(-1)}) |
| | Calculates total (unweighted and mass-weighted) and per-element VACFs.
|
| static std::pair< std::vector< real_t >, std::vector< real_t > > | calculateVDOS (const std::vector< real_t > &vacf, real_t time_step, VDOSWindowType window_type=VDOSWindowType::Hann, size_t zero_pad_factor=4) |
| | Calculates the Vibrational Density of States (VDOS) from the VACF.
|
| static real_t | computeDiffusionCoefficientMSD (const std::vector< real_t > &time, const std::vector< real_t > &msd) |
| | Computes the self-diffusion coefficient D from MSD using linear regression on the second half of the time series.
|
| static real_t | computeDiffusionCoefficientVACF (const std::vector< real_t > &time, const std::vector< real_t > &vacf) |
| | Computes the self-diffusion coefficient D from VACF using Green-Kubo integration (trapezoidal rule).
|
| static real_t | computeRelaxationTime (const std::vector< real_t > &time, const std::vector< real_t > &normalized_vacf) |
| | Computes the relaxation time tau from the normalized VACF using trapezoidal integration.
|
Static class providing dynamics analysis methods.
This class contains stateless static methods for calculating time-dependent properties like VACF and VDOS from correlation::core::Trajectory data.
◆ DynamicsAnalyzer()
| correlation::analysis::DynamicsAnalyzer::DynamicsAnalyzer |
( |
| ) |
|
|
delete |
◆ calculateMSD()
Calculates the Mean Squared Displacement (MSD).
MSD(t) = < |r_i(t0 + t) - r_i(t0)|^2 >
Uses unwrapped (continuous) trajectories to correctly handle atoms crossing periodic boundary conditions. The displacement is accumulated frame-by-frame using the minimum image convention, so no stored unwrapped positions are needed. Time-averaging over all valid origins is used for maximum statistical efficiency.
- Parameters
-
| traj | The trajectory containing atomic positions. |
| max_correlation_frames | The maximum lag (in frames) to compute. Pass -1 to use half the trajectory length (recommended). |
| start_frame | First frame to include (default: 0). |
| end_frame | One-past-last frame to include (default: all frames). |
| remove_com_drift | Remove center-of-mass drift when num_atoms > 1 (default: true). |
- Returns
- A vector of MSD values indexed by lag (in Ų).
◆ calculateNormalizedVACF()
Calculates the Normalized Velocity Autocorrelation Function. Divides the VACF by its initial value (at t=0).
- Parameters
-
| traj | The trajectory containing pre-calculated velocities. |
| max_correlation_frames | The maximum time lag. |
| start_frame | First frame to include (default: 0). |
| end_frame | One-past-last frame to include (default: all frames). |
- Returns
- A vector containing the normalized VACF values.
◆ calculatePartialMSD()
Calculates total and per-element Mean Squared Displacements (MSD).
- Parameters
-
| traj | The trajectory containing atomic positions. |
| max_correlation_frames | Maximum lag in frames (-1 = half trajectory). |
| start_frame | First frame to include (default: 0). |
| end_frame | One-past-last frame to include (default: all frames). |
| remove_com_drift | Remove center-of-mass drift when num_atoms > 1 (default: true). |
- Returns
- PartialMSDResult containing total and per-element MSDs (in Ų).
◆ calculatePartialVACF()
Calculates total (unweighted and mass-weighted) and per-element VACFs.
- Parameters
-
| traj | The trajectory containing pre-calculated velocities. |
| max_correlation_frames | Maximum time lag in frames (-1 = half trajectory). |
| start_frame | First frame to include (default: 0). |
| end_frame | One-past-last frame to include (default: all frames). |
- Returns
- PartialVACFResult containing total and per-element VACFs and mass weights.
◆ calculateVACF()
Calculates the Velocity Autocorrelation Function (VACF).
\( C(t) = \langle \mathbf{v}(t_0) \cdot \mathbf{v}(t_0 + t) \rangle \)
- Parameters
-
| traj | The trajectory containing pre-calculated velocities. |
| max_correlation_frames | The maximum time lag (in frames) to calculate correlation for. |
| start_frame | First frame to include (default: 0). |
| end_frame | One-past-last frame to include (default: all frames). |
- Returns
- A vector containing the VACF values for lag times 0 to max_correlation_frames.
◆ calculateVDOS()
Calculates the Vibrational Density of States (VDOS) from the VACF.
Evaluates the real one-sided Fourier cosine transform via a zero-padded even-symmetric FFT (DCT-I equivalent) after applying a smooth time-domain half-window:
\[ g(\nu) = 2 \int_0^{t_{\max}} C(t)\,w(t)\,\cos(2\pi \nu t)\,\mathrm{d}t \]
- Parameters
-
| vacf | The Velocity Autocorrelation Function. |
| time_step | The time step between frames (in femtoseconds). |
| window_type | Time-domain tapering half-window (default: Half-Hann). |
| zero_pad_factor | Zero-padding multiplier for frequency interpolation (>= 1, default: 4). |
- Returns
- A pair: {frequencies (THz, >= 0), intensities (>= 0)}.
◆ computeDiffusionCoefficientMSD()
| real_t correlation::analysis::DynamicsAnalyzer::computeDiffusionCoefficientMSD |
( |
const std::vector< real_t > & | time, |
|
|
const std::vector< real_t > & | msd ) |
|
staticnodiscard |
Computes the self-diffusion coefficient D from MSD using linear regression on the second half of the time series.
- Parameters
-
| time | The time values (bins). |
| msd | The MSD values. |
- Returns
- The diffusion coefficient in Ų/fs.
◆ computeDiffusionCoefficientVACF()
| real_t correlation::analysis::DynamicsAnalyzer::computeDiffusionCoefficientVACF |
( |
const std::vector< real_t > & | time, |
|
|
const std::vector< real_t > & | vacf ) |
|
staticnodiscard |
Computes the self-diffusion coefficient D from VACF using Green-Kubo integration (trapezoidal rule).
- Parameters
-
| time | The time values (bins). |
| vacf | The VACF values. |
- Returns
- The diffusion coefficient in Ų/fs.
◆ computeRelaxationTime()
| real_t correlation::analysis::DynamicsAnalyzer::computeRelaxationTime |
( |
const std::vector< real_t > & | time, |
|
|
const std::vector< real_t > & | normalized_vacf ) |
|
staticnodiscard |
Computes the relaxation time tau from the normalized VACF using trapezoidal integration.
- Parameters
-
| time | The time values (bins). |
| normalized_vacf | The normalized VACF values. |
- Returns
- The relaxation time in fs.
The documentation for this class was generated from the following files: