ppap4lmp
0.7.2
|
ProValueArray makes one or more arrays consisting of values for property in a sequence of Element objects. More...
#include <pro_value_array.h>
Public Member Functions | |
ProValueArray (const ElPtr &elem) | |
Constructor of ProValueArray class for one Element object. More... | |
ProValueArray (const Vec< ElPtr > &elems) | |
Constructor of ProValueArray class for a sequence of Element objects. More... | |
virtual void | prepare () override |
Resize value_trajectories. More... | |
virtual void | finish () override |
Make results from value_trajectories. More... | |
void | select (const py::args &args) |
Specify string keys for properties. To use this object, at least one key must be specified. Note that new keys overwrite old keys. More... | |
const Map< Str, ArrayXXd > & | get_results () |
Get dictionary from keys for property to two-dimensional arrays of values for the property. Each row of the array corresponds to each snapshot of a simulation, and each column of the array corresponds to each element in array Element objects (for example, each atom in Element objects for atoms). 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 Attributes | |
Vec< Str > | selected_keys |
Map< Str, ArrayXXd > | results |
Vec< Map< Str, RowArrayXd > > | value_trajectories |
Additional Inherited Members | |
![]() | |
int | n_generators |
Vec< ShPtr< Generator > > | generators |
ProValueArray makes one or more arrays consisting of values for property in a sequence of Element objects.
An object of this class makes one or more two-dimensional arrays consisting of values for property of Element objects stored in generators. These arrays are useful for calculating statistics of property added by Adder's subclass.
About usage in Python, please see pybind::py_pro_value_array.
Definition at line 26 of file pro_value_array.h.
ProValueArray::ProValueArray | ( | const ElPtr & | elem | ) |
Constructor of ProValueArray class for one Element object.
elem | An Element object. The parameter is put into generators by register_generator. |
Definition at line 20 of file pro_value_array.cpp.
Constructor of ProValueArray class for a sequence of Element objects.
elems | List of Element objects. If each Element object has an array data, all the array should have the same length. Elements of this parameter is put into generators by register_generators. |
Definition at line 28 of file pro_value_array.cpp.
|
overridevirtual |
Make results from value_trajectories.
Each row of a value of results corresponds to a value for the corresponding key in each element of value_trajectories.
Reimplemented from Processor.
Definition at line 84 of file pro_value_array.cpp.
Get dictionary from keys for property to two-dimensional arrays of values for the property. Each row of the array corresponds to each snapshot of a simulation, and each column of the array corresponds to each element in array Element objects (for example, each atom in Element objects for atoms).
Definition at line 125 of file pro_value_array.cpp.
|
overridevirtual |
Resize value_trajectories.
Reimplemented from Processor.
Definition at line 77 of file pro_value_array.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 36 of file pro_value_array.cpp.
void ProValueArray::select | ( | const py::args & | args | ) |
Specify string keys for properties. To use this object, at least one key must be specified. Note that new keys overwrite old keys.
*args | An ordered list of string keys for properties (Python's variable number arguments). Be sure that all Element objects stored in this object has the keys. This parameter is converted to be stored as selected_keys. |
Definition at line 117 of file pro_value_array.cpp.
Dictionary from keys for property to two-dimensional arrays of values for the property. The keys are same as elements of selected_keys. Each column of the array corresponds to a sequence of the value for each element in array Element objects stored in generators (for example, each atom in Element objects for atoms), and each row of the array corresponds to each Element object of generators.
Definition at line 41 of file pro_value_array.h.
List of string keys for properties to be targeted.
Definition at line 30 of file pro_value_array.h.
|
private |
List in which dictionaries from key for property to RowArrayXd of values for the property are stored. Indices in this list corresponds those in generators.
Definition at line 47 of file pro_value_array.h.