|
ppap4lmp
0.7.2
|
ProDistanceInMolecule computes atom-to-atom distance in each molecule (also computes square of the distance). More...
#include <pro_distance_in_molecule.h>
Public Member Functions | |
| ProDistanceInMolecule (const ElPtr &mols, const ElPtr &atoms) | |
| Constructor of ProDistanceInMolecule class for a snapshot of simulation. More... | |
| ProDistanceInMolecule (const Vec< std::pair< ElPtr, ElPtr >> &pairs) | |
| Constructor of ProDistanceInMolecule class for multiple snapshots of simulation. More... | |
| virtual void | prepare () override |
| Resize distance2_traj. More... | |
| virtual void | finish () override |
| Fill distance2_array with values of distance2_traj. More... | |
| void | set_indices (int index1_in_mol_, int index2_in_mol_) |
| Specify two atoms in a molecule by zero-based index. Distance 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... | |
| ArrayXXd | get_distance_array () |
| Get computed distances between two atoms in each molecule as a two-dimensional array: each row corresponds to each snapshot of a simulation and each column corresponds to each molecule. More... | |
| const ArrayXXd & | get_distance2_array () |
| Get computed squared distances between two atoms in each molecule as a two-dimensional array: each row corresponds to each snapshot of a simulation and each column corresponds to each 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 Attributes | |
| int | index1_in_mol = 0 |
| int | index2_in_mol = 0 |
| int | target_moltype = 1 |
| Vec< RowArrayXd > | distance2_traj |
| ArrayXXd | distance2_array |
Additional Inherited Members | |
Protected Attributes inherited from Processor | |
| int | n_generators |
| Vec< ShPtr< Generator > > | generators |
ProDistanceInMolecule computes atom-to-atom distance in each molecule (also computes square of the distance).
An object of this class makes a two-dimensional array of distances 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.
About usage in Python, please see pybind::py_pro_distance_in_molecule.
Definition at line 26 of file pro_distance_in_molecule.h.
Constructor of ProDistanceInMolecule class for a snapshot of simulation.
| mols | An Element object for molecules.
|
| atoms | An Element object for atoms.
|
A GenDict object is constructed taking the mols and atoms, and then put into generators by register_generator.
Definition at line 17 of file pro_distance_in_molecule.cpp.
Constructor of ProDistanceInMolecule class for multiple snapshots of simulation.
| 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 27 of file pro_distance_in_molecule.cpp.
|
overridevirtual |
Fill distance2_array with values of distance2_traj.
Each row of distance2_array corresponds to each element of distance2_traj.
Reimplemented from Processor.
Definition at line 92 of file pro_distance_in_molecule.cpp.
| const ArrayXXd & ProDistanceInMolecule::get_distance2_array | ( | ) |
Get computed squared distances between two atoms in each molecule as a two-dimensional array: each row corresponds to each snapshot of a simulation and each column corresponds to each molecule.
Definition at line 142 of file pro_distance_in_molecule.cpp.
| ArrayXXd ProDistanceInMolecule::get_distance_array | ( | ) |
Get computed distances between two atoms in each molecule as a two-dimensional array: each row corresponds to each snapshot of a simulation and each column corresponds to each molecule.
Definition at line 135 of file pro_distance_in_molecule.cpp.
|
overridevirtual |
Resize distance2_traj.
Reimplemented from Processor.
Definition at line 85 of file pro_distance_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 43 of file pro_distance_in_molecule.cpp.
| void ProDistanceInMolecule::set_indices | ( | int | index1_in_mol_, |
| int | index2_in_mol_ | ||
| ) |
Specify two atoms in a molecule by zero-based index. Distance 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 117 of file pro_distance_in_molecule.cpp.
| void ProDistanceInMolecule::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 127 of file pro_distance_in_molecule.cpp.
|
private |
A two-dimensional array of computed distances. Each column corresponds to a sequence of the distance for each molecule, and each row corresponds to each element of generators.
Definition at line 57 of file pro_distance_in_molecule.h.
|
private |
List in which RowArrayXd objects of computed distances of each molecule are stored. Indices in this list corresponds those in generators.
Definition at line 51 of file pro_distance_in_molecule.h.
|
private |
Zero-based index for an atom in a molecule. Distance between two atoms specified by index1_in_mol and index2_in_mol is calculated for each molecule.
Definition at line 32 of file pro_distance_in_molecule.h.
|
private |
Zero-based index for an atom in a molecule. Distance between two atoms specified by index1_in_mol and index2_in_mol is calculated for each molecule.
Definition at line 38 of file pro_distance_in_molecule.h.
|
private |
Specify a type of molecules to be analyzed (default is 1). Only molecules whose type is target_moltype are analyzed. Note that if molecules do not have type property, 1 is used as their types.
Definition at line 45 of file pro_distance_in_molecule.h.