34 lib[
"autocor"] =
this;
38 std::vector<std::string> &args) {
45 if (cmd ==
"autocor") {
51 std::cout <<
"Available bonded interactions:" << std::endl;
52 for (
auto &array : *sel) {
53 std::cout << array->getName() <<
" " << std::endl;
62 <<
"vals <file> <selection>\n"
63 <<
"write values to file. The first row is the frame number, then one "
64 <<
"row for each interaction specified. The output can be used to "
66 <<
"2D correlation plots.\n\n"
67 <<
"example: vals angle *angle*\n";
71 <<
"cor <file> <selection>\n"
72 <<
"Calculate linear correlation coefficient of the first item in "
73 "selection with all the other items\n"
74 <<
"WARNING: for evaluating correlations in the system, it is not "
75 "sufficient to calculate the "
76 <<
"linear correlation coefficient, 2D histograms with data from the "
77 "vals command should be used instead!\n";
79 if (cmd ==
"autocor") {
81 <<
"autocor <file> <interaction>\n"
82 <<
"calculate autocorrelation function of first item in selection. "
83 "The output is periodic since FFTW3 is used to "
84 "calcualte correlations.\n";
87 std::cout <<
"list\nlists all available interactions\n";
92 std::vector<std::string> &args) {
97 for (
size_t i = 1; i < args.size(); i++) {
102 out << *sel << std::endl;
104 std::cout <<
"written " << sel->
size() <<
" data rows to " << args[0]
110 std::vector<std::string> &args) {
114 for (
size_t i = 1; i < args.size(); i++) {
121 out << c << std::endl;
123 std::cout <<
"calculated autocorrelation for " << sel->
size()
124 <<
" data rows, written to " << args[0] << std::endl;
129 std::vector<std::string> &args) {
133 for (
size_t i = 1; i < args.size(); i++) {
140 out << c << std::endl;
142 std::cout <<
"calculated correlations for " << sel->
size()
143 <<
" rows, written to " << args[0] << std::endl;
Class calculates data associated with bond interactions.
tools::DataCollection< double > & BondedValues()
void Help(const std::string &cmd, std::vector< std::string > &args) override
void Register(std::map< std::string, AnalysisTool * > &lib) override
void WriteCorrelations(BondedStatistics &bs, std::vector< std::string > &args)
void WriteValues(BondedStatistics &bs, std::vector< std::string > &args)
void Command(BondedStatistics &bs, const std::string &cmd, std::vector< std::string > &args) override
void WriteAutocorrelation(BondedStatistics &bs, std::vector< std::string > &args)
base class for all analysis tools