ppap4lmp
0.7.2
|
ProTimeCorrelationInMolecule computes time correlation function of atom-to-atom vector in each molecule. More...
#include <pro_time_correlation_in_molecule.h>
Public Member Functions | |
ProTimeCorrelationInMolecule (const Vec< std::pair< ElPtr, ElPtr >> &pairs) | |
Constructor of ProTimeCorrelationInMolecule class. More... | |
virtual void | prepare () override |
Set initial vectors and resize coefficients_traj. More... | |
virtual void | finish () override |
Fill coefficients_array with values of coefficients_traj, and calculate time_correlation_function by averaging over columns of coefficients_array. More... | |
void | set_indices (int index1_in_mol_, int index2_in_mol_) |
Specify two atoms in a molecule by zero-based index. Time correlation function of a vector between the two atoms is computed for each molecule. More... | |
void | set_moltype (int target_moltype_) |
Specify a molecular type. Only molecules whose type property is the specified type are analyzed. If molecules have no type property, you do not need to use this method. More... | |
const ArrayXXd & | get_coefficients_array () |
Get a two-dimensional array containing computed time correlation coefficients of vectors connecting two atoms in the same molecule: each column is a time correlation function of atom-to-atom vector in each molecule. More... | |
const ArrayXd & | get_time_correlation () |
Get an averaged time correlation function of atom-to-atom vector; each pair of atoms is in the same molecule. 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 | compute_temporary_vectors (std::function< void(const RowVector3d &)> callback, const ElPtr &el_mols, const ElPtr &el_atoms) |
Compute intramolecular vectors and conduct customized manipulation using them. More... | |
Private Attributes | |
int | index1_in_mol = 0 |
int | index2_in_mol = 0 |
int | target_moltype = 1 |
Vec< RowVector3d > | initial_vectors |
Vec< double > | initial_reciprocal_norm2 |
Vec< RowArrayXd > | coefficients_traj |
ArrayXXd | coefficients_array |
ArrayXd | time_correlation_function |
Additional Inherited Members | |
![]() | |
int | n_generators |
Vec< ShPtr< Generator > > | generators |
ProTimeCorrelationInMolecule computes time correlation function of atom-to-atom vector in each molecule.
An object of this class makes a two-dimensional array of time correlation coefficients of vectors between two atoms belonging to the same molecule. Each row of the array corresponds to each snapshot of a simulation, and each column of the array corresponds to each molecule. In other words, each column is a time correlation function of atom-to-atom vector in each molecule.
About usage in Python, please see pybind::py_pro_time_correlation_in_molecule.
Definition at line 29 of file pro_time_correlation_in_molecule.h.
ProTimeCorrelationInMolecule::ProTimeCorrelationInMolecule | ( | const Vec< std::pair< ElPtr, ElPtr >> & | pairs | ) |
Constructor of ProTimeCorrelationInMolecule class.
pairs | List of pairs of two Element objects: the first object is for molecules and the second object is for atoms. If each Element object has an array data, all the array should have the same length.
|
GenDict objects are constructed taking each element of the pairs
, and then put into generators by register_generators.
Definition at line 17 of file pro_time_correlation_in_molecule.cpp.
|
private |
Compute intramolecular vectors and conduct customized manipulation using them.
callback | Define a customized manipulation using intramolecular vectors. |
el_mols | An Element object containing molecule data. |
el_atoms | An Element object containing atom data. |
Definition at line 33 of file pro_time_correlation_in_molecule.cpp.
|
overridevirtual |
Fill coefficients_array with values of coefficients_traj, and calculate time_correlation_function by averaging over columns of coefficients_array.
Each row of coefficients_array corresponds to each element of coefficients_traj.
Reimplemented from Processor.
Definition at line 115 of file pro_time_correlation_in_molecule.cpp.
const ArrayXXd & ProTimeCorrelationInMolecule::get_coefficients_array | ( | ) |
Get a two-dimensional array containing computed time correlation coefficients of vectors connecting two atoms in the same molecule: each column is a time correlation function of atom-to-atom vector in each molecule.
Definition at line 153 of file pro_time_correlation_in_molecule.cpp.
const ArrayXd & ProTimeCorrelationInMolecule::get_time_correlation | ( | ) |
Get an averaged time correlation function of atom-to-atom vector; each pair of atoms is in the same molecule.
Definition at line 160 of file pro_time_correlation_in_molecule.cpp.
|
overridevirtual |
Set initial vectors and resize coefficients_traj.
Reimplemented from Processor.
Definition at line 97 of file pro_time_correlation_in_molecule.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 69 of file pro_time_correlation_in_molecule.cpp.
void ProTimeCorrelationInMolecule::set_indices | ( | int | index1_in_mol_, |
int | index2_in_mol_ | ||
) |
Specify two atoms in a molecule by zero-based index. Time correlation function of a vector between the two atoms is computed for each molecule.
index1_in_mol_ | A zero-based index in a molecule specifying a target atom. This parameter is assigned to index1_in_mol. |
index2_in_mol_ | A zero-based index in a molecule specifying the other target atom. This parameter is assigned to index2_in_mol. |
Definition at line 136 of file pro_time_correlation_in_molecule.cpp.
void ProTimeCorrelationInMolecule::set_moltype | ( | int | target_moltype_ | ) |
Specify a molecular type. Only molecules whose type
property is the specified type are analyzed. If molecules have no type
property, you do not need to use this method.
target_moltype_ | An integer for molecular type. This parameter is assigned to target_moltype. |
Definition at line 146 of file pro_time_correlation_in_molecule.cpp.
|
private |
A two-dimensional array of computed time correlation coefficients. Each column corresponds to a time correlation function for each molecule, and each row corresponds to each element of generators (snapshot of simulation).
Definition at line 71 of file pro_time_correlation_in_molecule.h.
|
private |
List in which RowArrayXd objects of computed time correlation coefficients for each molecule are stored. Indices in this list corresponds those in generators.
Definition at line 64 of file pro_time_correlation_in_molecule.h.
|
private |
Zero-based index for an atom in a molecule. Time correlation function of a vector between two atoms specified by index1_in_mol and index2_in_mol is calculated for each molecule.
Definition at line 36 of file pro_time_correlation_in_molecule.h.
|
private |
Zero-based index for an atom in a molecule. Time correlation function of a vector between two atoms specified by index1_in_mol and index2_in_mol is calculated for each molecule.
Definition at line 43 of file pro_time_correlation_in_molecule.h.
|
private |
Reciprocals of squared norms of initial_vectors.
Definition at line 58 of file pro_time_correlation_in_molecule.h.
|
private |
Initial vectors connecting specified two atoms in the same molecule. The first element of generators is used for the initial positions.
Definition at line 54 of file pro_time_correlation_in_molecule.h.
|
private |
Only molecules whose type is target_moltype are analyzed (default is 1). Note that if molecules do not have type
property, 1 is used as their types.
Definition at line 49 of file pro_time_correlation_in_molecule.h.
|
private |
An averaged time correlation function. Each element corresponds to each element of generators (snapshot of simulation).
Definition at line 77 of file pro_time_correlation_in_molecule.h.