ppap4lmp  0.7.2
ProTimeCorrelationInMolecule Class Reference

ProTimeCorrelationInMolecule computes time correlation function of atom-to-atom vector in each molecule. More...

#include <pro_time_correlation_in_molecule.h>

Inheritance diagram for ProTimeCorrelationInMolecule:
Collaboration diagram for ProTimeCorrelationInMolecule:

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 ArrayXXdget_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 ArrayXdget_time_correlation ()
 Get an averaged time correlation function of atom-to-atom vector; each pair of atoms is in the same molecule. More...
 
- Public Member Functions inherited from Processor
 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...
 
- Protected Member Functions inherited from Processor
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< RowVector3dinitial_vectors
 
Vec< double > initial_reciprocal_norm2
 
Vec< RowArrayXdcoefficients_traj
 
ArrayXXd coefficients_array
 
ArrayXd time_correlation_function
 

Additional Inherited Members

- Protected Attributes inherited from Processor
int n_generators
 
Vec< ShPtr< Generator > > generators
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ProTimeCorrelationInMolecule()

ProTimeCorrelationInMolecule::ProTimeCorrelationInMolecule ( const Vec< std::pair< ElPtr, ElPtr >> &  pairs)

Constructor of ProTimeCorrelationInMolecule class.

Parameters
pairsList 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.
Required property (first)
  • id : integer
  • atom-ids : array of integers
Required property (second)
  • id : integer
  • xu : float
  • yu : float
  • zu : float

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.

Here is the call graph for this function:

Member Function Documentation

◆ compute_temporary_vectors()

void ProTimeCorrelationInMolecule::compute_temporary_vectors ( std::function< void(const RowVector3d &)>  callback,
const ElPtr el_mols,
const ElPtr el_atoms 
)
private

Compute intramolecular vectors and conduct customized manipulation using them.

Parameters
callbackDefine a customized manipulation using intramolecular vectors.
el_molsAn Element object containing molecule data.
el_atomsAn Element object containing atom data.
Returns
None.

Definition at line 33 of file pro_time_correlation_in_molecule.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finish()

void ProTimeCorrelationInMolecule::finish ( )
overridevirtual

Fill coefficients_array with values of coefficients_traj, and calculate time_correlation_function by averaging over columns of coefficients_array.

Returns
None.

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.

◆ get_coefficients_array()

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.

Returns
coefficients_array.

Definition at line 153 of file pro_time_correlation_in_molecule.cpp.

Here is the caller graph for this function:

◆ get_time_correlation()

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.

Returns
time_correlation_function.

Definition at line 160 of file pro_time_correlation_in_molecule.cpp.

Here is the caller graph for this function:

◆ prepare()

void ProTimeCorrelationInMolecule::prepare ( )
overridevirtual

Set initial vectors and resize coefficients_traj.

Returns
None.

Reimplemented from Processor.

Definition at line 97 of file pro_time_correlation_in_molecule.cpp.

Here is the call graph for this function:

◆ run_impl()

void ProTimeCorrelationInMolecule::run_impl ( const int  index)
overrideprotectedvirtual

Implementation of analysis using an element of generators.

Parameters
indexAn index in generators for a Generator object to be analyzed.
Returns
None.

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.

Here is the call graph for this function:

◆ set_indices()

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.

Parameters
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.
Returns
None.

Definition at line 136 of file pro_time_correlation_in_molecule.cpp.

Here is the caller graph for this function:

◆ set_moltype()

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.

Parameters
target_moltype_An integer for molecular type. This parameter is assigned to target_moltype.
Returns
None.

Definition at line 146 of file pro_time_correlation_in_molecule.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ coefficients_array

ArrayXXd ProTimeCorrelationInMolecule::coefficients_array
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.

◆ coefficients_traj

Vec<RowArrayXd> ProTimeCorrelationInMolecule::coefficients_traj
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.

◆ index1_in_mol

int ProTimeCorrelationInMolecule::index1_in_mol = 0
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.

◆ index2_in_mol

int ProTimeCorrelationInMolecule::index2_in_mol = 0
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.

◆ initial_reciprocal_norm2

Vec<double> ProTimeCorrelationInMolecule::initial_reciprocal_norm2
private

Reciprocals of squared norms of initial_vectors.

Definition at line 58 of file pro_time_correlation_in_molecule.h.

◆ initial_vectors

Vec<RowVector3d> ProTimeCorrelationInMolecule::initial_vectors
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.

◆ target_moltype

int ProTimeCorrelationInMolecule::target_moltype = 1
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.

◆ time_correlation_function

ArrayXd ProTimeCorrelationInMolecule::time_correlation_function
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.


The documentation for this class was generated from the following files: