ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
The main correlator class. More...
#include <Correlator.hpp>
Public Member Functions | |
Correlator (::System::System const *system, int delta_N, int tau_lin, double tau_max, std::string compress1_, std::string compress2_, std::string corr_operation, obs_ptr obs1, obs_ptr obs2, Utils::Vector3d correlation_args_={}) | |
The initialization procedure for the correlation object. | |
void | update (boost::mpi::communicator const &comm) override |
The function to process a new datapoint of A and B. | |
int | finalize (boost::mpi::communicator const &comm) |
At the end of data collection, go through the whole hierarchy and correlate data left there. | |
std::vector< double > | get_correlation () |
Return correlation result. | |
std::size_t | n_values () const |
std::vector< std::size_t > | shape () const override |
std::vector< int > | get_samples_sizes () const |
std::vector< double > | get_lag_times () const |
int | tau_lin () const |
double | tau_max () const |
double | dt () const |
Utils::Vector3d const & | correlation_args () const |
void | set_correlation_args (Utils::Vector3d const &args) |
std::string const & | compress1 () const |
std::string const & | compress2 () const |
std::string const & | correlation_operation () const |
std::string | get_internal_state () const final |
void | set_internal_state (std::string const &) final |
Public Member Functions inherited from Accumulators::AccumulatorBase | |
AccumulatorBase (::System::System const *system, int delta_N) | |
virtual | ~AccumulatorBase ()=default |
int & | delta_N () |
bool | has_same_system_handle (::System::System const *system) const |
void | override_system_handle (::System::System const *system) |
Additional Inherited Members | |
Protected Attributes inherited from Accumulators::AccumulatorBase | |
void const * | m_system |
for bookkeeping purposes | |
The main correlator class.
Data organization: We use a ring-like way to manage the data: at the beginning we have a linear array, which we fill from index 0 to tau_lin
. The index newest[i]
always indicates the latest entry of the hierarchic "past" For every new entry in is incremented and if tau_lin
is reached, it starts again from the beginning.
Definition at line 130 of file core/accumulators/Correlator.hpp.
|
inline |
The initialization procedure for the correlation object.
All important parameters have to be specified at the same time. They cannot be changed later, so every instance of the correlation class has to be fed with correct data from the very beginning.
system | The system attached to this correlator |
delta_N | The number of time steps between subsequent updates |
tau_lin | The linear part of the correlation function. |
tau_max | maximal time delay tau to sample |
obs1 | First observable to correlate |
obs2 | Second observable to correlate |
corr_operation | how to correlate the two observables A and B (this has no default) |
compress1_ | how the A values should be compressed (usually the linear compression method) |
compress2_ | how the B values should be compressed (usually the linear compression method) |
correlation_args_ | optional arguments for the correlation function (currently only used when corr_operation is "fcs_acf") |
Definition at line 161 of file core/accumulators/Correlator.hpp.
|
inline |
Definition at line 218 of file core/accumulators/Correlator.hpp.
|
inline |
Definition at line 219 of file core/accumulators/Correlator.hpp.
|
inline |
Definition at line 213 of file core/accumulators/Correlator.hpp.
|
inline |
Definition at line 220 of file core/accumulators/Correlator.hpp.
|
inline |
Definition at line 211 of file core/accumulators/Correlator.hpp.
Referenced by get_lag_times().
int Accumulators::Correlator::finalize | ( | boost::mpi::communicator const & | comm | ) |
At the end of data collection, go through the whole hierarchy and correlate data left there.
Definition at line 426 of file Correlator.cpp.
std::vector< double > Accumulators::Correlator::get_correlation | ( | ) |
|
finalvirtual |
Implements Accumulators::AccumulatorBase.
Definition at line 535 of file Correlator.cpp.
std::vector< double > Accumulators::Correlator::get_lag_times | ( | ) | const |
Definition at line 528 of file Correlator.cpp.
References dt(), and n_values().
|
inline |
Definition at line 204 of file core/accumulators/Correlator.hpp.
|
inline |
Definition at line 196 of file core/accumulators/Correlator.hpp.
Referenced by get_correlation(), get_lag_times(), and shape().
|
inline |
Definition at line 214 of file core/accumulators/Correlator.hpp.
|
finalvirtual |
Implements Accumulators::AccumulatorBase.
Definition at line 556 of file Correlator.cpp.
References Accumulators::AccumulatorBase::m_system.
|
inlineoverridevirtual |
Implements Accumulators::AccumulatorBase.
Definition at line 199 of file core/accumulators/Correlator.hpp.
References n_values(), and shape().
Referenced by shape().
|
inline |
Definition at line 209 of file core/accumulators/Correlator.hpp.
|
inline |
Definition at line 210 of file core/accumulators/Correlator.hpp.
|
overridevirtual |
The function to process a new datapoint of A and B.
First the function finds out if it is necessary to make some space for the new entries of A and B. Then, if necessary, it compresses old values of A and B to make room for the new value. Finally, the new values of A and B are stored in A[newest[0]]
and B[newest[0]]
, where the newest
indices have been increased before. Finally, the correlation estimate is updated. TODO: Not all correlation estimates have to be updated.
Implements Accumulators::AccumulatorBase.
Definition at line 314 of file Correlator.cpp.