ppap4lmp
0.7.2
|
ProMeanSquareDisplacement computes mean square displacement (MSD). More...
#include <pro_mean_square_displacement.h>
Public Member Functions | |
ProMeanSquareDisplacement (const Vec< ElPtr > &elems) | |
Constructor of ProMeanSquareDisplacement class. More... | |
virtual void | prepare () override |
Set initial positions and resize displacement2_traj. More... | |
virtual void | finish () override |
Fill displacement2_array with values of displacement2_traj, and calculate mean_square_displacement by averaging over columns of displacement2_array. More... | |
void | set_dimension (bool include_x, bool include_y, bool include_z) |
Specify dimensions to be considered. By default, the mean square displacement is computed in three dimensions. To compute the mean square displacement in xy place, for example, the third parameter of this method must be set to false . More... | |
void | without_drift_correction (bool without_drift_correction_=true) |
Disable to correct a drift of center of mass of the simulation system. More... | |
const ArrayXXd & | get_displacement2_array () |
Get computed time series of squared displacements from initial position for each target as a two-dimensional array: each row corresponds to each snapshot of the simulation and each column corresponds to each target. More... | |
const ArrayXd & | get_mean_square_displacement () |
Get time series of the mean square displacement as a one-dimensional array. Each element of the array corresponds to each snapshot of the simulation. More... | |
![]() | |
Processor ()=default | |
Constructor of Processor class (default). | |
virtual bool | run () |
Run analysis using i th Generator object in generators, where i = i_generator. More... | |
void | startup () |
Startup this Processor object. More... | |
Protected Member Functions | |
virtual void | run_impl (const int index) override |
Implementation of analysis using an element of generators. More... | |
![]() | |
template<class GEN > | |
void | register_generator (const ShPtr< GEN > &gen) |
template<class GEN > | |
void | register_generators (const Vec< ShPtr< GEN >> &gens) |
virtual void | use_generator_at (const int i) |
Call Generator::generate_data of i th Generator object in generators. More... | |
virtual void | finish_using_generator_at (const int i) |
Call Generator::finish_using_generated_data of i* th Generator object in generators. More... | |
Private Member Functions | |
void | extract_positions (ArrayXXd &positions, const ElPtr &elem) |
Extract position vectors from an Element object. More... | |
Private Attributes | |
bool | drift_correction = true |
Vec< bool > | dimension = {true, true, true} |
ArrayXXd | initial_rs |
Vec< RowArrayXd > | displacement2_traj |
ArrayXXd | displacement2_array |
ArrayXd | mean_square_displacement |
Additional Inherited Members | |
![]() | |
int | n_generators |
Vec< ShPtr< Generator > > | generators |
ProMeanSquareDisplacement computes mean square displacement (MSD).
An object of this class makes a two-dimensional array of squared displacements from initial position for each target (can be an atom, bead, molecule...) over a simulation trajectory. Each row of the array corresponds to each snapshot of a simulation, and each column of the array corresponds to each target. By averaging over columns of the array, the object of this class also makes a one-dimensional array for the mean square displacement.
About usage in Python, please see pybind::py_pro_mean_square_displacement.
Definition at line 29 of file pro_mean_square_displacement.h.
Constructor of ProMeanSquareDisplacement class.
elems | List of Element objects for atoms, beads, molecules... If each Element object has an array data, all the array should have the same length.
|
Element objects in the elems
are put into generators by register_generators.
Definition at line 16 of file pro_mean_square_displacement.cpp.
|
private |
Extract position vectors from an Element object.
positions | Mutable reference of a two-dimensional array whose rows are position vectors. |
elem | This method extracts position vectors from this Element object. |
Definition at line 24 of file pro_mean_square_displacement.cpp.
|
overridevirtual |
Fill displacement2_array with values of displacement2_traj, and calculate mean_square_displacement by averaging over columns of displacement2_array.
Each row of displacement2_array corresponds to each element of displacement2_traj.
Reimplemented from Processor.
Definition at line 82 of file pro_mean_square_displacement.cpp.
const ArrayXXd & ProMeanSquareDisplacement::get_displacement2_array | ( | ) |
Get computed time series of squared displacements from initial position for each target as a two-dimensional array: each row corresponds to each snapshot of the simulation and each column corresponds to each target.
Definition at line 127 of file pro_mean_square_displacement.cpp.
const ArrayXd & ProMeanSquareDisplacement::get_mean_square_displacement | ( | ) |
Get time series of the mean square displacement as a one-dimensional array. Each element of the array corresponds to each snapshot of the simulation.
Definition at line 134 of file pro_mean_square_displacement.cpp.
|
overridevirtual |
Set initial positions and resize displacement2_traj.
Reimplemented from Processor.
Definition at line 71 of file pro_mean_square_displacement.cpp.
|
overrideprotectedvirtual |
Implementation of analysis using an element of generators.
index | An index in generators for a Generator object to be analyzed. |
To be compatible with multithreading computation, class members should not be modified in this method. If modification of some members is necessary, please consider defining them as Vec, and modifying only their i th element, where i = index
.
I am sorry to say that the best documentation for this method is its source code...
Implements Processor.
Definition at line 48 of file pro_mean_square_displacement.cpp.
void ProMeanSquareDisplacement::set_dimension | ( | bool | include_x, |
bool | include_y, | ||
bool | include_z | ||
) |
Specify dimensions to be considered. By default, the mean square displacement is computed in three dimensions. To compute the mean square displacement in xy place, for example, the third parameter of this method must be set to false
.
include_x | A boolean, whether component in the x direction is included in squared displacement. This parameter is stored as the first element of dimension. |
include_y | A boolean, whether component in the y direction is included in squared displacement. This parameter is stored as the second element of dimension. |
include_z | A boolean, whether component in the z direction is included in squared displacement. This parameter is stored as the third element of dimension. |
Definition at line 109 of file pro_mean_square_displacement.cpp.
void ProMeanSquareDisplacement::without_drift_correction | ( | bool | without_drift_correction_ = true | ) |
Disable to correct a drift of center of mass of the simulation system.
without_drift_correction_ | Whether disable the drift correction or not (default is true ). Negation of this parameter is assigned to drift_correction. |
Definition at line 119 of file pro_mean_square_displacement.cpp.
|
private |
Dimensions to be considered in computing squared displacements. Three elements of this member corresponds to x, y, and z direction, respectively. Only if an element of this member is true
, displacement in the corresponding direction is added to resulted displacement. Default is true
for all the direction.
Definition at line 46 of file pro_mean_square_displacement.h.
|
private |
A two-dimensional array of squared displacements from initial position for each target over a simulation trajectory. Each column corresponds to time series of the squared displacement for each target, and each row corresponds to each element of generators (snapshot of simulation).
Definition at line 65 of file pro_mean_square_displacement.h.
|
private |
List in which RowArrayXd objects of computed squared displacements of each target are stored. Indices in this list corresponds those in generators.
Definition at line 57 of file pro_mean_square_displacement.h.
|
private |
Whether to correct a drift of center of mass of the simulation system (default is true
). If the initial structure of the simulation has some biases of position or velocity, drift of the simulation system (translational displacement of center of mass of the system) can occur and, as the result, distort the mean square displacement.
Definition at line 38 of file pro_mean_square_displacement.h.
|
private |
Initial positions of targets. The first element of generators is used for the initial positions.
Definition at line 51 of file pro_mean_square_displacement.h.
|
private |
The mean square displacement. Each element corresponds to each element of generators (snapshot of simulation).
Definition at line 71 of file pro_mean_square_displacement.h.