/** \file analyzer.cpp * * Takes evaluated fragments (energy and forces) and does evaluation of how sensible the BOSSANOVA * approach was, e.g. in the decay of the many-body-contributions. * */ //============================ INCLUDES =========================== #include "helpers.hpp" #include "parser.hpp" #include "datacreator.hpp" //============================== MAIN ============================= int main(int argc, char **argv) { EnergyMatrix Energy; ForceMatrix Force; MatrixContainer Time; EnergyMatrix EnergyFragments; ForceMatrix ForceFragments; KeySetsContainer KeySet; ofstream output; ofstream output2; ofstream output3; ofstream output4; stringstream filename; time_t t = time(NULL); struct tm *ts = localtime(&t); char *datum = asctime(ts); stringstream Orderxrange; stringstream Fragmentxrange; cout << "ANOVA Analyzer" << endl; cout << "==============" << endl; // Get the command line options if (argc < 4) { cout << "Usage: " << argv[0] << " " << endl; cout << "\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl; cout << "\tprefix of energy and forces file." << endl; cout << "\tcreated plotfiles and datafiles are placed into this directory " << endl; return 1; } // Test the given directory if (!TestParams(argc, argv)) return 1; // +++++++++++++++++ PARSING +++++++++++++++++++++++++++++++ // ------------- Parse through all Fragment subdirs -------- if (!Energy.ParseMatrix(argv[1], argv[2], EnergySuffix,0,0)) return 1; if (!Force.ParseMatrix(argv[1], argv[2], ForcesSuffix,0,0)) return 1; if (!Time.ParseMatrix(argv[1], argv[2], TimeSuffix, 10,1)) return 1; // ---------- Parse the TE Factors into an array ----------------- if (!Energy.ParseIndices()) return 1; // ---------- Parse the Force indices into an array --------------- if (!Force.ParseIndices(argv[1])) return 1; // ---------- Parse the KeySets into an array --------------- if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1; if (!KeySet.ParseManyBodyTerms()) return 1; if (!EnergyFragments.ParseMatrix(argv[1], argv[2], EnergyFragmentSuffix,0,0)) return 1; if (!ForceFragments.ParseMatrix(argv[1], argv[2], ForceFragmentSuffix,0,0)) return 1; // +++++++++++++++ TESTING ++++++++++++++++++++++++++++++ // print energy and forces to file filename.str(""); filename << argv[3] << "/" << "energy-forces.all"; output.open(filename.str().c_str(), ios::out); output << endl << "Total Energy" << endl << "==============" << endl << Energy.Header << endl; for(int j=0;j Force.RowCounter[Force.MatrixCounter]) { cerr << "Current force index " << j << " is greater than " << Force.RowCounter[Force.MatrixCounter] << "!" << endl; return 1; } if (j != -1) for(int k=0;k Force.RowCounter[Force.MatrixCounter]) { cerr << "Current force index " << j << " is greater than " << Force.RowCounter[Force.MatrixCounter] << "!" << endl; return 1; } if (j != -1) for(int k=0;k