| [bcf653] | 1 | /* | 
|---|
|  | 2 | * Project: MoleCuilder | 
|---|
|  | 3 | * Description: creates and alters molecular systems | 
|---|
|  | 4 | * Copyright (C)  2010 University of Bonn. All rights reserved. | 
|---|
|  | 5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
| [14de469] | 8 | /** \file analyzer.cpp | 
|---|
|  | 9 | * | 
|---|
|  | 10 | * Takes evaluated fragments (energy and forces) and does evaluation of how sensible the BOSSANOVA | 
|---|
|  | 11 | * approach was, e.g. in the decay of the many-body-contributions. | 
|---|
| [6ac7ee] | 12 | * | 
|---|
| [14de469] | 13 | */ | 
|---|
|  | 14 |  | 
|---|
|  | 15 | //============================ INCLUDES =========================== | 
|---|
|  | 16 |  | 
|---|
| [bf3817] | 17 | // include config.h | 
|---|
|  | 18 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 19 | #include <config.h> | 
|---|
|  | 20 | #endif | 
|---|
|  | 21 |  | 
|---|
| [ad011c] | 22 | #include "CodePatterns/MemDebug.hpp" | 
|---|
| [112b09] | 23 |  | 
|---|
| [49e1ae] | 24 | #include <cstring> | 
|---|
| [b60804] | 25 | #include <sstream> | 
|---|
|  | 26 | #include <fstream> | 
|---|
| [255829] | 27 | #include <cmath> | 
|---|
| [49e1ae] | 28 |  | 
|---|
| [68cb0f] | 29 | #include "datacreator.hpp" | 
|---|
| [14de469] | 30 | #include "parser.hpp" | 
|---|
| [6ac7ee] | 31 | #include "periodentafel.hpp" | 
|---|
| [255829] | 32 | #include "CodePatterns/Log.hpp" | 
|---|
| [ad011c] | 33 | #include "CodePatterns/Verbose.hpp" | 
|---|
| [68cb0f] | 34 |  | 
|---|
| [14de469] | 35 | //============================== MAIN ============================= | 
|---|
|  | 36 |  | 
|---|
|  | 37 | int main(int argc, char **argv) | 
|---|
|  | 38 | { | 
|---|
| [68cb0f] | 39 | periodentafel *periode = NULL; // and a period table of all elements | 
|---|
| [14de469] | 40 | EnergyMatrix Energy; | 
|---|
| [b12a35] | 41 | EnergyMatrix EnergyFragments; | 
|---|
| [14de469] | 42 | ForceMatrix Force; | 
|---|
| [b12a35] | 43 | ForceMatrix ForceFragments; | 
|---|
|  | 44 | HessianMatrix Hessian; | 
|---|
|  | 45 | HessianMatrix HessianFragments; | 
|---|
|  | 46 | EnergyMatrix Hcorrection; | 
|---|
|  | 47 | EnergyMatrix HcorrectionFragments; | 
|---|
| [68cb0f] | 48 | ForceMatrix Shielding; | 
|---|
|  | 49 | ForceMatrix ShieldingPAS; | 
|---|
| [674220] | 50 | ForceMatrix Chi; | 
|---|
|  | 51 | ForceMatrix ChiPAS; | 
|---|
| [f05407] | 52 | EnergyMatrix Time; | 
|---|
| [68cb0f] | 53 | ForceMatrix ShieldingFragments; | 
|---|
|  | 54 | ForceMatrix ShieldingPASFragments; | 
|---|
| [674220] | 55 | ForceMatrix ChiFragments; | 
|---|
|  | 56 | ForceMatrix ChiPASFragments; | 
|---|
| [68cb0f] | 57 | KeySetsContainer KeySet; | 
|---|
| [b60804] | 58 | std::ofstream output; | 
|---|
|  | 59 | std::ofstream output2; | 
|---|
|  | 60 | std::ofstream output3; | 
|---|
|  | 61 | std::ofstream output4; | 
|---|
|  | 62 | std::ifstream input; | 
|---|
|  | 63 | std::stringstream filename; | 
|---|
| [14de469] | 64 | time_t t = time(NULL); | 
|---|
|  | 65 | struct tm *ts = localtime(&t); | 
|---|
|  | 66 | char *datum = asctime(ts); | 
|---|
| [b60804] | 67 | std::stringstream Orderxrange; | 
|---|
|  | 68 | std::stringstream Fragmentxrange; | 
|---|
|  | 69 | std::stringstream yrange; | 
|---|
| [390248] | 70 | char *dir = NULL; | 
|---|
| [b12a35] | 71 | bool NoHessian = false; | 
|---|
|  | 72 | bool NoTime = false; | 
|---|
| [d067d45] | 73 | bool NoHCorrection = true; | 
|---|
| [ad37ab] | 74 | int counter = 0; | 
|---|
| [437922] | 75 |  | 
|---|
| [a67d19] | 76 | DoLog(0) && (Log() << Verbose(0) << "ANOVA Analyzer" << endl); | 
|---|
|  | 77 | DoLog(0) && (Log() << Verbose(0) << "==============" << endl); | 
|---|
| [437922] | 78 |  | 
|---|
| [14de469] | 79 | // Get the command line options | 
|---|
|  | 80 | if (argc < 4) { | 
|---|
| [a67d19] | 81 | DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl); | 
|---|
|  | 82 | DoLog(0) && (Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl); | 
|---|
|  | 83 | DoLog(0) && (Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl); | 
|---|
|  | 84 | DoLog(0) && (Log() << Verbose(0) << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl); | 
|---|
|  | 85 | DoLog(0) && (Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl); | 
|---|
| [14de469] | 86 | return 1; | 
|---|
| [390248] | 87 | } else { | 
|---|
| [920c70] | 88 | dir = new char[strlen(argv[2]) + 2]; | 
|---|
| [390248] | 89 | strcpy(dir, "/"); | 
|---|
|  | 90 | strcat(dir, argv[2]); | 
|---|
| [14de469] | 91 | } | 
|---|
| [437922] | 92 |  | 
|---|
| [68cb0f] | 93 | if (argc > 4) { | 
|---|
| [a67d19] | 94 | DoLog(0) && (Log() << Verbose(0) << "Loading periodentafel." << endl); | 
|---|
| [920c70] | 95 | periode = new periodentafel; | 
|---|
| [68cb0f] | 96 | periode->LoadPeriodentafel(argv[4]); | 
|---|
|  | 97 | } | 
|---|
| [437922] | 98 |  | 
|---|
| [14de469] | 99 | // Test the given directory | 
|---|
|  | 100 | if (!TestParams(argc, argv)) | 
|---|
|  | 101 | return 1; | 
|---|
|  | 102 |  | 
|---|
|  | 103 | // +++++++++++++++++ PARSING +++++++++++++++++++++++++++++++ | 
|---|
| [437922] | 104 |  | 
|---|
| [14de469] | 105 | // ------------- Parse through all Fragment subdirs -------- | 
|---|
| [f05407] | 106 | if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix,0,0)) return 1; | 
|---|
| [b12a35] | 107 | if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0)) { | 
|---|
|  | 108 | NoHCorrection = true; | 
|---|
| [58ed4a] | 109 | DoeLog(2) && (eLog()<< Verbose(2) << "No HCorrection file found, skipping these." << endl); | 
|---|
| [b12a35] | 110 | } | 
|---|
|  | 111 |  | 
|---|
| [f05407] | 112 | if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix,0,0)) return 1; | 
|---|
| [b12a35] | 113 | if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix,0,0)) { | 
|---|
|  | 114 | NoHessian = true; | 
|---|
| [58ed4a] | 115 | DoeLog(2) && (eLog()<< Verbose(2) << "No Hessian file found, skipping these." << endl); | 
|---|
| [b12a35] | 116 | } | 
|---|
|  | 117 | if (!Time.ParseFragmentMatrix(argv[1], dir, TimeSuffix, 10,1)) { | 
|---|
|  | 118 | NoTime = true; | 
|---|
| [58ed4a] | 119 | DoeLog(2) && (eLog()<< Verbose(2) << "No speed file found, skipping these." << endl); | 
|---|
| [b12a35] | 120 | } | 
|---|
| [68cb0f] | 121 | if (periode != NULL) { // also look for PAS values | 
|---|
| [f05407] | 122 | if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1; | 
|---|
|  | 123 | if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1; | 
|---|
| [674220] | 124 | if (!Chi.ParseFragmentMatrix(argv[1], dir, ChiSuffix, 1, 0)) return 1; | 
|---|
|  | 125 | if (!ChiPAS.ParseFragmentMatrix(argv[1], dir, ChiPASSuffix, 1, 0)) return 1; | 
|---|
| [68cb0f] | 126 | } | 
|---|
| [14de469] | 127 |  | 
|---|
|  | 128 | // ---------- Parse the TE Factors into an array ----------------- | 
|---|
| [437922] | 129 | if (!Energy.ParseIndices()) return 1; | 
|---|
| [d067d45] | 130 | if (!NoHCorrection) Hcorrection.ParseIndices(); | 
|---|
| [437922] | 131 |  | 
|---|
| [14de469] | 132 | // ---------- Parse the Force indices into an array --------------- | 
|---|
| [2459b1] | 133 | if (!Force.ParseIndices(argv[1])) return 1; | 
|---|
| [390248] | 134 | if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1; | 
|---|
| [b12a35] | 135 | if (!ForceFragments.InitialiseIndices((class MatrixContainer *)&Force)) return 1; | 
|---|
|  | 136 |  | 
|---|
|  | 137 | // ---------- Parse hessian indices into an array ----------------- | 
|---|
|  | 138 | if (!NoHessian) { | 
|---|
|  | 139 | if (!Hessian.InitialiseIndices((class MatrixContainer *)&Force)) return 1; | 
|---|
|  | 140 | if (!HessianFragments.AllocateMatrix(Hessian.Header, Hessian.MatrixCounter, Hessian.RowCounter, Hessian.ColumnCounter)) return 1; | 
|---|
|  | 141 | if (!HessianFragments.InitialiseIndices((class MatrixContainer *)&Force)) return 1; | 
|---|
|  | 142 | } | 
|---|
| [14de469] | 143 |  | 
|---|
| [68cb0f] | 144 | // ---------- Parse the shielding indices into an array --------------- | 
|---|
|  | 145 | if (periode != NULL) { // also look for PAS values | 
|---|
|  | 146 | if(!Shielding.ParseIndices(argv[1])) return 1; | 
|---|
|  | 147 | if(!ShieldingPAS.ParseIndices(argv[1])) return 1; | 
|---|
| [95634f] | 148 | if (!ShieldingFragments.AllocateMatrix(Shielding.Header, Shielding.MatrixCounter, Shielding.RowCounter, Shielding.ColumnCounter)) return 1; | 
|---|
|  | 149 | if (!ShieldingPASFragments.AllocateMatrix(ShieldingPAS.Header, ShieldingPAS.MatrixCounter, ShieldingPAS.RowCounter, ShieldingPAS.ColumnCounter)) return 1; | 
|---|
|  | 150 | if(!ShieldingFragments.ParseIndices(argv[1])) return 1; | 
|---|
|  | 151 | if(!ShieldingPASFragments.ParseIndices(argv[1])) return 1; | 
|---|
| [674220] | 152 | if(!Chi.ParseIndices(argv[1])) return 1; | 
|---|
|  | 153 | if(!ChiPAS.ParseIndices(argv[1])) return 1; | 
|---|
|  | 154 | if (!ChiFragments.AllocateMatrix(Chi.Header, Chi.MatrixCounter, Chi.RowCounter, Chi.ColumnCounter)) return 1; | 
|---|
|  | 155 | if (!ChiPASFragments.AllocateMatrix(ChiPAS.Header, ChiPAS.MatrixCounter, ChiPAS.RowCounter, ChiPAS.ColumnCounter)) return 1; | 
|---|
|  | 156 | if(!ChiFragments.ParseIndices(argv[1])) return 1; | 
|---|
|  | 157 | if(!ChiPASFragments.ParseIndices(argv[1])) return 1; | 
|---|
| [68cb0f] | 158 | } | 
|---|
|  | 159 |  | 
|---|
| [14de469] | 160 | // ---------- Parse the KeySets into an array --------------- | 
|---|
|  | 161 | if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1; | 
|---|
|  | 162 | if (!KeySet.ParseManyBodyTerms()) return 1; | 
|---|
| [437922] | 163 |  | 
|---|
| [68cb0f] | 164 | // ---------- Parse fragment files created by 'joiner' into an array ------------- | 
|---|
| [f05407] | 165 | if (!EnergyFragments.ParseFragmentMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1; | 
|---|
| [b12a35] | 166 | if (!NoHCorrection) | 
|---|
|  | 167 | HcorrectionFragments.ParseFragmentMatrix(argv[1], dir, HcorrectionFragmentSuffix,0,0); | 
|---|
| [f05407] | 168 | if (!ForceFragments.ParseFragmentMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1; | 
|---|
| [b12a35] | 169 | if (!NoHessian) | 
|---|
|  | 170 | if (!HessianFragments.ParseFragmentMatrix(argv[1], dir, HessianFragmentSuffix,0,0)) return 1; | 
|---|
| [68cb0f] | 171 | if (periode != NULL) { // also look for PAS values | 
|---|
| [95634f] | 172 | if (!ShieldingFragments.ParseFragmentMatrix(argv[1], dir, ShieldingFragmentSuffix, 1, 0)) return 1; | 
|---|
|  | 173 | if (!ShieldingPASFragments.ParseFragmentMatrix(argv[1], dir, ShieldingPASFragmentSuffix, 1, 0)) return 1; | 
|---|
| [674220] | 174 | if (!ChiFragments.ParseFragmentMatrix(argv[1], dir, ChiFragmentSuffix, 1, 0)) return 1; | 
|---|
|  | 175 | if (!ChiPASFragments.ParseFragmentMatrix(argv[1], dir, ChiPASFragmentSuffix, 1, 0)) return 1; | 
|---|
| [68cb0f] | 176 | } | 
|---|
| [14de469] | 177 |  | 
|---|
|  | 178 | // +++++++++++++++ TESTING ++++++++++++++++++++++++++++++ | 
|---|
| [437922] | 179 |  | 
|---|
| [14de469] | 180 | // print energy and forces to file | 
|---|
|  | 181 | filename.str(""); | 
|---|
|  | 182 | filename << argv[3] << "/" << "energy-forces.all"; | 
|---|
|  | 183 | output.open(filename.str().c_str(), ios::out); | 
|---|
| [b12a35] | 184 | output << endl << "Total Energy" << endl << "==============" << endl << Energy.Header[Energy.MatrixCounter] << endl; | 
|---|
| [14de469] | 185 | for(int j=0;j<Energy.RowCounter[Energy.MatrixCounter];j++) { | 
|---|
| [f731ae] | 186 | for(int k=0;k<Energy.ColumnCounter[Energy.MatrixCounter];k++) | 
|---|
| [14de469] | 187 | output << scientific << Energy.Matrix[ Energy.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 188 | output << endl; | 
|---|
|  | 189 | } | 
|---|
|  | 190 | output << endl; | 
|---|
|  | 191 |  | 
|---|
| [b12a35] | 192 | output << endl << "Total Forces" << endl << "===============" << endl << Force.Header[Force.MatrixCounter] << endl; | 
|---|
| [14de469] | 193 | for(int j=0;j<Force.RowCounter[Force.MatrixCounter];j++) { | 
|---|
| [f731ae] | 194 | for(int k=0;k<Force.ColumnCounter[Force.MatrixCounter];k++) | 
|---|
| [14de469] | 195 | output << scientific << Force.Matrix[ Force.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 196 | output << endl; | 
|---|
|  | 197 | } | 
|---|
|  | 198 | output << endl; | 
|---|
|  | 199 |  | 
|---|
| [b12a35] | 200 | if (!NoHessian) { | 
|---|
|  | 201 | output << endl << "Total Hessian" << endl << "===============" << endl << Hessian.Header[Hessian.MatrixCounter] << endl; | 
|---|
|  | 202 | for(int j=0;j<Hessian.RowCounter[Hessian.MatrixCounter];j++) { | 
|---|
|  | 203 | for(int k=0;k<Hessian.ColumnCounter[Hessian.MatrixCounter];k++) | 
|---|
|  | 204 | output << scientific << Hessian.Matrix[ Hessian.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 205 | output << endl; | 
|---|
|  | 206 | } | 
|---|
|  | 207 | output << endl; | 
|---|
|  | 208 | } | 
|---|
|  | 209 |  | 
|---|
| [68cb0f] | 210 | if (periode != NULL) { // also look for PAS values | 
|---|
| [b12a35] | 211 | output << endl << "Total Shieldings" << endl << "===============" << endl << Shielding.Header[Hessian.MatrixCounter] << endl; | 
|---|
| [68cb0f] | 212 | for(int j=0;j<Shielding.RowCounter[Shielding.MatrixCounter];j++) { | 
|---|
| [f731ae] | 213 | for(int k=0;k<Shielding.ColumnCounter[Shielding.MatrixCounter];k++) | 
|---|
| [68cb0f] | 214 | output << scientific << Shielding.Matrix[ Shielding.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 215 | output << endl; | 
|---|
|  | 216 | } | 
|---|
|  | 217 | output << endl; | 
|---|
|  | 218 |  | 
|---|
| [b12a35] | 219 | output << endl << "Total Shieldings PAS" << endl << "===============" << endl << ShieldingPAS.Header[ShieldingPAS.MatrixCounter] << endl; | 
|---|
| [68cb0f] | 220 | for(int j=0;j<ShieldingPAS.RowCounter[ShieldingPAS.MatrixCounter];j++) { | 
|---|
| [f731ae] | 221 | for(int k=0;k<ShieldingPAS.ColumnCounter[ShieldingPAS.MatrixCounter];k++) | 
|---|
| [68cb0f] | 222 | output << scientific << ShieldingPAS.Matrix[ ShieldingPAS.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 223 | output << endl; | 
|---|
|  | 224 | } | 
|---|
|  | 225 | output << endl; | 
|---|
| [674220] | 226 |  | 
|---|
| [5bc4d0] | 227 | output << endl << "Total Chis" << endl << "===============" << endl << Chi.Header[Chi.MatrixCounter] << endl; | 
|---|
| [674220] | 228 | for(int j=0;j<Chi.RowCounter[Chi.MatrixCounter];j++) { | 
|---|
| [631dcb] | 229 | for(int k=0;k<Chi.ColumnCounter[Chi.MatrixCounter];k++) | 
|---|
| [674220] | 230 | output << scientific << Chi.Matrix[ Chi.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 231 | output << endl; | 
|---|
|  | 232 | } | 
|---|
|  | 233 | output << endl; | 
|---|
|  | 234 |  | 
|---|
|  | 235 | output << endl << "Total Chis PAS" << endl << "===============" << endl << ChiPAS.Header[ChiPAS.MatrixCounter] << endl; | 
|---|
|  | 236 | for(int j=0;j<ChiPAS.RowCounter[ChiPAS.MatrixCounter];j++) { | 
|---|
| [234af2] | 237 | for(int k=0;k<ChiPAS.ColumnCounter[ChiPAS.MatrixCounter];k++) | 
|---|
| [674220] | 238 | output << scientific << ChiPAS.Matrix[ ChiPAS.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 239 | output << endl; | 
|---|
|  | 240 | } | 
|---|
|  | 241 | output << endl; | 
|---|
| [68cb0f] | 242 | } | 
|---|
|  | 243 |  | 
|---|
| [b12a35] | 244 | if (!NoTime) { | 
|---|
|  | 245 | output << endl << "Total Times" << endl << "===============" << endl << Time.Header[Time.MatrixCounter] << endl; | 
|---|
|  | 246 | for(int j=0;j<Time.RowCounter[Time.MatrixCounter];j++) { | 
|---|
|  | 247 | for(int k=0;k<Time.ColumnCounter[Time.MatrixCounter];k++) { | 
|---|
|  | 248 | output << scientific << Time.Matrix[ Time.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 249 | } | 
|---|
|  | 250 | output << endl; | 
|---|
| [f05407] | 251 | } | 
|---|
| [b4b7c3] | 252 | output << endl; | 
|---|
|  | 253 | } | 
|---|
| [14de469] | 254 | output.close(); | 
|---|
| [b12a35] | 255 | if (!NoTime) | 
|---|
|  | 256 | for(int k=0;k<Time.ColumnCounter[Time.MatrixCounter];k++) | 
|---|
|  | 257 | Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k] = Time.Matrix[ Time.MatrixCounter ][Time.RowCounter[Time.MatrixCounter]-1][k]; | 
|---|
| [14de469] | 258 |  | 
|---|
|  | 259 | // +++++++++++++++ ANALYZING ++++++++++++++++++++++++++++++ | 
|---|
| [437922] | 260 |  | 
|---|
| [a67d19] | 261 | DoLog(0) && (Log() << Verbose(0) << "Analyzing ..." << endl); | 
|---|
| [14de469] | 262 |  | 
|---|
|  | 263 | // ======================================= Creating the data files ============================================================== | 
|---|
|  | 264 |  | 
|---|
| [b4b7c3] | 265 | // +++++++++++++++++++++++++++++++++++++++ Plotting Simtime vs Bond Order | 
|---|
| [f05407] | 266 | // +++++++++++++++++++++++++++++++++++++++ Plotting Delta Simtime vs Bond Order | 
|---|
| [b12a35] | 267 | if (!NoTime) { | 
|---|
|  | 268 | if (!OpenOutputFile(output, argv[3], "SimTime-Order.dat" )) return false; | 
|---|
|  | 269 | if (!OpenOutputFile(output2, argv[3], "DeltaSimTime-Order.dat" )) return false; | 
|---|
|  | 270 | for(int j=Time.RowCounter[Time.MatrixCounter];j--;) | 
|---|
|  | 271 | for(int k=Time.ColumnCounter[Time.MatrixCounter];k--;) { | 
|---|
|  | 272 | Time.Matrix[ Time.MatrixCounter ][j][k] = 0.; | 
|---|
|  | 273 | } | 
|---|
|  | 274 | counter = 0; | 
|---|
|  | 275 | output << "#Order\tFrag.No.\t" << Time.Header[Time.MatrixCounter] << endl; | 
|---|
|  | 276 | output2 << "#Order\tFrag.No.\t" << Time.Header[Time.MatrixCounter] << endl; | 
|---|
|  | 277 | for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { | 
|---|
|  | 278 | for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;) | 
|---|
|  | 279 | for(int j=Time.RowCounter[Time.MatrixCounter];j--;) | 
|---|
|  | 280 | for(int k=Time.ColumnCounter[Time.MatrixCounter];k--;) { | 
|---|
|  | 281 | Time.Matrix[ Time.MatrixCounter ][j][k] += Time.Matrix[ KeySet.OrderSet[BondOrder][i] ][j][k]; | 
|---|
|  | 282 | } | 
|---|
|  | 283 | counter += KeySet.FragmentsPerOrder[BondOrder]; | 
|---|
|  | 284 | output << BondOrder+1 << "\t" << counter; | 
|---|
|  | 285 | output2 << BondOrder+1 << "\t" << counter; | 
|---|
|  | 286 | for(int k=0;k<Time.ColumnCounter[Time.MatrixCounter];k++) { | 
|---|
|  | 287 | output << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k]; | 
|---|
|  | 288 | if (fabs(Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k]) > MYEPSILON) | 
|---|
|  | 289 | output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k] / Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k]; | 
|---|
|  | 290 | else | 
|---|
|  | 291 | output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k]; | 
|---|
|  | 292 | } | 
|---|
|  | 293 | output << endl; | 
|---|
|  | 294 | output2 << endl; | 
|---|
| [f05407] | 295 | } | 
|---|
| [b12a35] | 296 | output.close(); | 
|---|
|  | 297 | output2.close(); | 
|---|
|  | 298 | } | 
|---|
|  | 299 |  | 
|---|
|  | 300 | if (!NoHessian) { | 
|---|
|  | 301 | // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in hessian to full QM | 
|---|
|  | 302 | if (!CreateDataDeltaHessianOrderPerAtom(Hessian, HessianFragments, KeySet, argv[3], "DeltaHessian_xx-Order", "Plot of error between approximated hessian and full hessian versus the Bond Order", datum)) return 1; | 
|---|
|  | 303 |  | 
|---|
| [72744a] | 304 | if (!CreateDataDeltaFrobeniusOrderPerAtom(Hessian, HessianFragments, KeySet, argv[3], "DeltaFrobeniusHessian_xx-Order", "Plot of error between approximated hessian and full hessian in the frobenius norm versus the Bond Order", datum)) return 1; | 
|---|
|  | 305 |  | 
|---|
| [b12a35] | 306 | // ++++++++++++++++++++++++++++++++++++++Plotting Hessian vs. Order | 
|---|
|  | 307 | if (!CreateDataHessianOrderPerAtom(HessianFragments, KeySet, argv[3], "Hessian_xx-Order", "Plot of approximated hessian versus the Bond Order", datum)) return 1; | 
|---|
|  | 308 | if (!AppendOutputFile(output, argv[3], "Hessian_xx-Order.dat" )) return false; | 
|---|
|  | 309 | output << endl << "# Full" << endl; | 
|---|
|  | 310 | for(int j=0;j<Hessian.RowCounter[Hessian.MatrixCounter];j++) { | 
|---|
|  | 311 | output << j << "\t"; | 
|---|
|  | 312 | for(int k=0;k<Hessian.ColumnCounter[Force.MatrixCounter];k++) | 
|---|
|  | 313 | output << scientific <<  Hessian.Matrix[ Hessian.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 314 | output << endl; | 
|---|
| [f05407] | 315 | } | 
|---|
| [b12a35] | 316 | output.close(); | 
|---|
| [b4b7c3] | 317 | } | 
|---|
| [f05407] | 318 |  | 
|---|
| [95634f] | 319 | // +++++++++++++++++++++++++++++++++++++++ Plotting shieldings | 
|---|
|  | 320 | if (periode != NULL) { // also look for PAS values | 
|---|
|  | 321 | if (!CreateDataDeltaForcesOrderPerAtom(ShieldingPAS, ShieldingPASFragments, KeySet, argv[3], "DeltaShieldingsPAS-Order", "Plot of error between approximated shieldings and full shieldings versus the Bond Order", datum)) return 1; | 
|---|
|  | 322 | if (!CreateDataForcesOrderPerAtom(ShieldingPASFragments, KeySet, argv[3], "ShieldingsPAS-Order", "Plot of approximated shieldings versus the Bond Order", datum)) return 1; | 
|---|
|  | 323 | if (!AppendOutputFile(output, argv[3], "ShieldingsPAS-Order.dat" )) return false; | 
|---|
|  | 324 | output << endl << "# Full" << endl; | 
|---|
|  | 325 | for(int j=0;j<ShieldingPAS.RowCounter[ShieldingPAS.MatrixCounter];j++) { | 
|---|
|  | 326 | output << j << "\t"; | 
|---|
| [f731ae] | 327 | for(int k=0;k<ShieldingPAS.ColumnCounter[ShieldingPAS.MatrixCounter];k++) | 
|---|
| [95634f] | 328 | output << scientific <<  ShieldingPAS.Matrix[ ShieldingPAS.MatrixCounter ][j][k] << "\t"; //*(((k>1) && (k<6))? 1.e6 : 1.) << "\t"; | 
|---|
|  | 329 | output << endl; | 
|---|
|  | 330 | } | 
|---|
| [674220] | 331 | output.close(); | 
|---|
|  | 332 | if (!CreateDataDeltaForcesOrderPerAtom(ChiPAS, ChiPASFragments, KeySet, argv[3], "DeltaChisPAS-Order", "Plot of error between approximated Chis and full Chis versus the Bond Order", datum)) return 1; | 
|---|
|  | 333 | if (!CreateDataForcesOrderPerAtom(ChiPASFragments, KeySet, argv[3], "ChisPAS-Order", "Plot of approximated Chis versus the Bond Order", datum)) return 1; | 
|---|
|  | 334 | if (!AppendOutputFile(output, argv[3], "ChisPAS-Order.dat" )) return false; | 
|---|
|  | 335 | output << endl << "# Full" << endl; | 
|---|
|  | 336 | for(int j=0;j<ChiPAS.RowCounter[ChiPAS.MatrixCounter];j++) { | 
|---|
|  | 337 | output << j << "\t"; | 
|---|
| [631dcb] | 338 | for(int k=0;k<ChiPAS.ColumnCounter[ChiPAS.MatrixCounter];k++) | 
|---|
| [674220] | 339 | output << scientific <<  ChiPAS.Matrix[ ChiPAS.MatrixCounter ][j][k] << "\t"; //*(((k>1) && (k<6))? 1.e6 : 1.) << "\t"; | 
|---|
|  | 340 | output << endl; | 
|---|
|  | 341 | } | 
|---|
|  | 342 | output.close(); | 
|---|
| [95634f] | 343 | } | 
|---|
|  | 344 |  | 
|---|
| [437922] | 345 |  | 
|---|
| [14de469] | 346 | // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM | 
|---|
| [390248] | 347 | if (!CreateDataDeltaEnergyOrder(Energy, EnergyFragments, KeySet, argv[3], "DeltaEnergies-Order", "Plot of error between approximated and full energies energies versus the Bond Order", datum)) return 1; | 
|---|
| [437922] | 348 |  | 
|---|
| [14de469] | 349 | // +++++++++++++++++++++++++++++++++++Plotting Energies vs. Order | 
|---|
| [390248] | 350 | if (!CreateDataEnergyOrder(EnergyFragments, KeySet, argv[3], "Energies-Order", "Plot of approximated energies versus the Bond Order", datum)) return 1; | 
|---|
| [437922] | 351 |  | 
|---|
| [14de469] | 352 | // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in forces to full QM | 
|---|
| [390248] | 353 | if (!CreateDataDeltaForcesOrderPerAtom(Force, ForceFragments, KeySet, argv[3], "DeltaForces-Order", "Plot of error between approximated forces and full forces versus the Bond Order", datum)) return 1; | 
|---|
|  | 354 |  | 
|---|
|  | 355 | // min force | 
|---|
|  | 356 | if (!CreateDataDeltaForcesOrder(Force, ForceFragments, KeySet, argv[3], "DeltaMinForces-Order", "Plot of min error between approximated forces and full forces versus the Bond Order", datum, CreateMinimumForce)) return 1; | 
|---|
|  | 357 |  | 
|---|
|  | 358 | // mean force | 
|---|
|  | 359 | if (!CreateDataDeltaForcesOrder(Force, ForceFragments, KeySet, argv[3], "DeltaMeanForces-Order", "Plot of mean error between approximated forces and full forces versus the Bond Order", datum, CreateMeanForce)) return 1; | 
|---|
|  | 360 |  | 
|---|
|  | 361 | // max force | 
|---|
|  | 362 | if (!CreateDataDeltaForcesOrder(Force, ForceFragments, KeySet, argv[3], "DeltaMaxForces-Order", "Plot of max error between approximated forces and full forces versus the Bond Order", datum, CreateMaximumForce)) return 1; | 
|---|
| [14de469] | 363 |  | 
|---|
|  | 364 | // ++++++++++++++++++++++++++++++++++++++Plotting Forces vs. Order | 
|---|
| [390248] | 365 | if (!CreateDataForcesOrderPerAtom(ForceFragments, KeySet, argv[3], "Forces-Order", "Plot of approximated forces versus the Bond Order", datum)) return 1; | 
|---|
| [95634f] | 366 | if (!AppendOutputFile(output, argv[3], "Forces-Order.dat" )) return false; | 
|---|
|  | 367 | output << endl << "# Full" << endl; | 
|---|
|  | 368 | for(int j=0;j<Force.RowCounter[Force.MatrixCounter];j++) { | 
|---|
|  | 369 | output << j << "\t"; | 
|---|
| [f731ae] | 370 | for(int k=0;k<Force.ColumnCounter[Force.MatrixCounter];k++) | 
|---|
| [95634f] | 371 | output << scientific <<  Force.Matrix[ Force.MatrixCounter ][j][k] << "\t"; | 
|---|
|  | 372 | output << endl; | 
|---|
|  | 373 | } | 
|---|
|  | 374 | output.close(); | 
|---|
| [14de469] | 375 | // min force | 
|---|
| [390248] | 376 | if (!CreateDataForcesOrder(ForceFragments, KeySet, argv[3], "MinForces-Order", "Plot of min approximated forces versus the Bond Order", datum, CreateMinimumForce)) return 1; | 
|---|
| [14de469] | 377 |  | 
|---|
|  | 378 | // mean force | 
|---|
| [390248] | 379 | if (!CreateDataForcesOrder(ForceFragments, KeySet, argv[3], "MeanForces-Order", "Plot of mean approximated forces versus the Bond Order", datum, CreateMeanForce)) return 1; | 
|---|
| [14de469] | 380 |  | 
|---|
|  | 381 | // max force | 
|---|
| [390248] | 382 | if (!CreateDataForcesOrder(ForceFragments, KeySet, argv[3], "MaxForces-Order", "Plot of max approximated forces versus the Bond Order", datum, CreateMaximumForce)) return 1; | 
|---|
| [14de469] | 383 |  | 
|---|
|  | 384 | // ++++++++++++++++++++++++++++++++++++++Plotting vector sum (should be 0) vs. bond order | 
|---|
| [390248] | 385 | if (!CreateDataForcesOrder(ForceFragments, KeySet, argv[3], "VectorSum-Order", "Plot of vector sum of the approximated forces versus the Bond Order", datum, CreateVectorSumForce)) return 1; | 
|---|
| [14de469] | 386 |  | 
|---|
|  | 387 | // +++++++++++++++++++++++++++++++Plotting energyfragments vs. order | 
|---|
|  | 388 | if (!CreateDataFragment(EnergyFragments, KeySet, argv[3], "Energies-Fragment", "Plot of fragment energy versus the Fragment No", datum, CreateEnergy)) return 1; | 
|---|
|  | 389 | if (!CreateDataFragment(EnergyFragments, KeySet, argv[3], "Energies-FragmentOrder", "Plot of fragment energy of each Fragment No vs. Bond Order", datum, CreateEnergy)) return 1; | 
|---|
|  | 390 | if (!CreateDataFragmentOrder(EnergyFragments, KeySet, argv[3], "MaxEnergies-FragmentOrder", "Plot of maximum of fragment energy vs. Bond Order", datum, CreateMaxFragmentOrder)) return 1; | 
|---|
|  | 391 | if (!CreateDataFragmentOrder(EnergyFragments, KeySet, argv[3], "MinEnergies-FragmentOrder", "Plot of minimum of fragment energy vs. Bond Order", datum, CreateMinFragmentOrder)) return 1; | 
|---|
|  | 392 |  | 
|---|
|  | 393 | // +++++++++++++++++++++++++++++++Ploting min/mean/max forces for each fragment | 
|---|
|  | 394 | // min force | 
|---|
|  | 395 | if (!CreateDataFragment(ForceFragments, KeySet, argv[3], "MinForces-Fragment", "Plot of min approximated forces versus the Fragment No", datum, CreateMinimumForce)) return 1; | 
|---|
|  | 396 |  | 
|---|
|  | 397 | // mean force | 
|---|
|  | 398 | if (!CreateDataFragment(ForceFragments, KeySet, argv[3], "MeanForces-Fragment", "Plot of mean approximated forces versus the Fragment No", datum, CreateMeanForce)) return 1; | 
|---|
|  | 399 |  | 
|---|
|  | 400 | // max force | 
|---|
|  | 401 | if (!CreateDataFragment(ForceFragments, KeySet, argv[3], "MaxForces-Fragment", "Plot of max approximated forces versus the Fragment No", datum, CreateMaximumForce)) return 1; | 
|---|
|  | 402 |  | 
|---|
|  | 403 | // +++++++++++++++++++++++++++++++Ploting min/mean/max forces for each fragment per order | 
|---|
|  | 404 | // min force | 
|---|
|  | 405 | if (!CreateDataFragment(ForceFragments, KeySet, argv[3], "MinForces-FragmentOrder", "Plot of min approximated forces of each Fragment No vs. Bond Order", datum, CreateMinimumForce)) return 1; | 
|---|
|  | 406 |  | 
|---|
|  | 407 | // mean force | 
|---|
|  | 408 | if (!CreateDataFragment(ForceFragments, KeySet, argv[3], "MeanForces-FragmentOrder", "Plot of mean approximated forces of each Fragment No vs. Bond Order", datum, CreateMeanForce)) return 1; | 
|---|
|  | 409 |  | 
|---|
|  | 410 | // max force | 
|---|
|  | 411 | if (!CreateDataFragment(ForceFragments, KeySet, argv[3], "MaxForces-FragmentOrder", "Plot of max approximated forces of each Fragment No vs. Bond Order", datum, CreateMaximumForce)) return 1; | 
|---|
|  | 412 |  | 
|---|
|  | 413 | // ======================================= Creating the plot files ============================================================== | 
|---|
| [437922] | 414 |  | 
|---|
| [14de469] | 415 | Orderxrange << "[1:" << KeySet.Order << "]"; | 
|---|
|  | 416 | Fragmentxrange << "[0:" << KeySet.FragmentCounter+1 << "]"; | 
|---|
| [390248] | 417 | yrange.str("[1e-8:1e+1]"); | 
|---|
| [14de469] | 418 |  | 
|---|
| [b12a35] | 419 | if (!NoTime) { | 
|---|
|  | 420 | // +++++++++++++++++++++++++++++++++++++++ Plotting Simtime vs Bond Order | 
|---|
|  | 421 | if (!CreatePlotOrder(Time, KeySet, argv[3], "SimTime-Order", 1, "below", "y", "",  1, 1, "bond order k", "Evaluation time [s]", Orderxrange.str().c_str(), "", "1" , "with linespoints", EnergyPlotLine)) return 1; | 
|---|
|  | 422 | } | 
|---|
| [14de469] | 423 |  | 
|---|
|  | 424 | // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM | 
|---|
| [390248] | 425 | if (!CreatePlotOrder(Energy, KeySet, argv[3], "DeltaEnergies-Order", 1, "outside", "y", "",  1, 1, "bond order k", "absolute error in energy [Ht]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with linespoints", AbsEnergyPlotLine)) return 1; | 
|---|
| [437922] | 426 |  | 
|---|
| [14de469] | 427 | // +++++++++++++++++++++++++++++++++++Plotting Energies vs. Order | 
|---|
|  | 428 | if (!CreatePlotOrder(Energy, KeySet, argv[3], "Energies-Order", 1, "outside", "", "",  1, 1, "bond order k", "approximate energy [Ht]", Orderxrange.str().c_str(), "", "1" , "with linespoints", EnergyPlotLine)) return 1; | 
|---|
|  | 429 |  | 
|---|
|  | 430 | // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in forces to full QM | 
|---|
| [390248] | 431 | yrange.str("[1e-8:1e+0]"); | 
|---|
| [14de469] | 432 | // min force | 
|---|
| [390248] | 433 | if (!CreatePlotOrder(Force, KeySet, argv[3], "DeltaMinForces-Order", 2, "top right", "y", "",  1, 1, "bond order k", "absolute error in min force [Ht/a.u.]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with linespoints", ForceMagnitudePlotLine)) return 1; | 
|---|
| [14de469] | 434 |  | 
|---|
|  | 435 | // mean force | 
|---|
| [390248] | 436 | if (!CreatePlotOrder(Force, KeySet, argv[3], "DeltaMeanForces-Order", 2, "top right", "y", "",  1, 1, "bond order k", "absolute error in mean force [Ht/a.u.]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with linespoints", AbsFirstForceValuePlotLine)) return 1; | 
|---|
| [14de469] | 437 |  | 
|---|
|  | 438 | // max force | 
|---|
| [390248] | 439 | if (!CreatePlotOrder(Force, KeySet, argv[3], "DeltaMaxForces-Order", 2, "top right", "y", "",  1, 1, "bond order k", "absolute error in max force [Ht/a.u.]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with linespoints", ForceMagnitudePlotLine)) return 1; | 
|---|
| [14de469] | 440 |  | 
|---|
|  | 441 | // min/mean/max comparison for total force | 
|---|
|  | 442 | if(!OpenOutputFile(output, argv[3], "DeltaMinMeanMaxTotalForce-Order.pyx")) return 1; | 
|---|
| [fa40b5] | 443 | CreatePlotHeader(output, "DeltaMinMeanMaxTotalForce-Order", 1, "bottom left", "y", NULL,  1, 1, "bond order k", "absolute error in total forces [Ht/a.u.]"); | 
|---|
| [437922] | 444 | output << "plot " << Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; | 
|---|
| [14de469] | 445 | output << "'DeltaMinForces-Order.dat' title 'minimum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints, \\" << endl; | 
|---|
|  | 446 | output << "'DeltaMeanForces-Order.dat' title 'mean' using 1:(abs($" << 8 << ")) with linespoints, \\" << endl; | 
|---|
|  | 447 | output << "'DeltaMaxForces-Order.dat' title 'maximum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints" << endl; | 
|---|
| [437922] | 448 | output.close(); | 
|---|
| [14de469] | 449 |  | 
|---|
|  | 450 | // ++++++++++++++++++++++++++++++++++++++Plotting Forces vs. Order | 
|---|
|  | 451 | // min force | 
|---|
|  | 452 | if (!CreatePlotOrder(Force, KeySet, argv[3], "MinForces-Order", 2, "bottom right", "y", "",  1, 1, "bond order k", "absolute approximated min force [Ht/a.u.]", Orderxrange.str().c_str(), "", "1" , "with linespoints", ForceMagnitudePlotLine)) return 1; | 
|---|
|  | 453 |  | 
|---|
|  | 454 | // mean force | 
|---|
|  | 455 | if (!CreatePlotOrder(Force, KeySet, argv[3], "MeanForces-Order", 2, "bottom right", "y", "",  1, 1, "bond order k", "absolute approximated mean force [Ht/a.u.]", Orderxrange.str().c_str(), "", "1" , "with linespoints", AbsFirstForceValuePlotLine)) return 1; | 
|---|
|  | 456 |  | 
|---|
|  | 457 | // max force | 
|---|
|  | 458 | if (!CreatePlotOrder(Force, KeySet, argv[3], "MaxForces-Order", 2, "bottom right", "y", "",  1, 1, "bond order k", "absolute approximated max force [Ht/a.u.]", Orderxrange.str().c_str(), "", "1" , "with linespoints", ForceMagnitudePlotLine)) return 1; | 
|---|
|  | 459 |  | 
|---|
|  | 460 | // min/mean/max comparison for total force | 
|---|
|  | 461 | if(!OpenOutputFile(output, argv[3],"MinMeanMaxTotalForce-Order.pyx")) return 1; | 
|---|
| [fa40b5] | 462 | CreatePlotHeader(output, "MinMeanMaxTotalForce-Order", 1, "bottom left", "y", NULL, 1, 1, "bond order k", "absolute total force [Ht/a.u.]"); | 
|---|
| [437922] | 463 | output << "plot "<< Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; | 
|---|
| [14de469] | 464 | output << "'MinForces-Order.dat' title 'minimum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints, \\" << endl; | 
|---|
|  | 465 | output << "'MeanForces-Order.dat' title 'mean' using 1:(abs($" << 8 << ")) with linespoints, \\" << endl; | 
|---|
|  | 466 | output << "'MaxForces-Order.dat' title 'maximum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints" << endl; | 
|---|
| [437922] | 467 | output.close(); | 
|---|
| [14de469] | 468 |  | 
|---|
|  | 469 | // ++++++++++++++++++++++++++++++++++++++Plotting vector sum vs. Order | 
|---|
|  | 470 |  | 
|---|
|  | 471 | if (!CreatePlotOrder(Force, KeySet, argv[3], "VectorSum-Order", 2, "bottom right", "y" ,"", 1, 1, "bond order k", "vector sum of approximated forces [Ht/a.u.]", Orderxrange.str().c_str(), "", "1" , "with linespoints", ForceMagnitudePlotLine)) return 1; | 
|---|
|  | 472 |  | 
|---|
|  | 473 | // +++++++++++++++++++++++++++++++Plotting energyfragments vs. order | 
|---|
| [390248] | 474 | yrange.str(""); | 
|---|
|  | 475 | yrange << "[" << EnergyFragments.FindMinValue() << ":" << EnergyFragments.FindMaxValue() << "]"; | 
|---|
|  | 476 | if (!CreatePlotOrder(EnergyFragments, KeySet, argv[3], "Energies-Fragment", 5, "below", "y", "", 1, 5, "fragment number", "Energies of each fragment [Ht]", Fragmentxrange.str().c_str(), yrange.str().c_str(), "2" , "with points", AbsEnergyPlotLine)) return 1; | 
|---|
|  | 477 | if (!CreatePlotOrder(EnergyFragments, KeySet, argv[3], "Energies-FragmentOrder", 5, "below", "y", "", 1, 1, "bond order", "Energies of each fragment [Ht]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with points", AbsEnergyPlotLine)) return 1; | 
|---|
|  | 478 | if (!CreatePlotOrder(EnergyFragments, KeySet, argv[3], "MaxEnergies-FragmentOrder", 5, "below", "y", "", 1, 1, "bond order", "Maximum fragment energy [Ht]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with linespoints", AbsEnergyPlotLine)) return 1; | 
|---|
|  | 479 | if (!CreatePlotOrder(EnergyFragments, KeySet, argv[3], "MinEnergies-FragmentOrder", 5, "below", "y", "", 1, 1, "bond order", "Minimum fragment energy [Ht]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with linespoints", AbsEnergyPlotLine)) return 1; | 
|---|
| [14de469] | 480 |  | 
|---|
|  | 481 | // +++++++++++++++++++++++++++++++=Ploting min/mean/max forces for each fragment | 
|---|
| [390248] | 482 | yrange.str(""); | 
|---|
|  | 483 | yrange << "[" << ForceFragments.FindMinValue() << ":" << ForceFragments.FindMaxValue()<< "]"; | 
|---|
| [14de469] | 484 | // min | 
|---|
| [390248] | 485 | if (!CreatePlotOrder(ForceFragments, KeySet, argv[3], "MinForces-Fragment", 5, "below", "y", "set boxwidth 0.2", 1, 5, "fragment number", "minimum of approximated forces [Ht/a.u.]", Fragmentxrange.str().c_str(), yrange.str().c_str(), "2" , "with boxes fillcolor", BoxesForcePlotLine)) return 1; | 
|---|
| [437922] | 486 |  | 
|---|
| [14de469] | 487 | // mean | 
|---|
| [390248] | 488 | if (!CreatePlotOrder(ForceFragments, KeySet, argv[3], "MeanForces-Fragment", 5, "below", "y", "set boxwidth 0.2", 1, 5, "fragment number", "mean of approximated forces [Ht/a.u.]", Fragmentxrange.str().c_str(), yrange.str().c_str(), "2" , "with boxes fillcolor", BoxesFirstForceValuePlotLine)) return 1; | 
|---|
| [437922] | 489 |  | 
|---|
| [14de469] | 490 | // max | 
|---|
| [390248] | 491 | if (!CreatePlotOrder(ForceFragments, KeySet, argv[3], "MaxForces-Fragment", 5, "below", "y", "set boxwidth 0.2", 1, 5, "fragment number", "maximum of approximated forces [Ht/a.u.]", Fragmentxrange.str().c_str(), yrange.str().c_str(), "2" , "with boxes fillcolor", BoxesForcePlotLine)) return 1; | 
|---|
| [14de469] | 492 |  | 
|---|
|  | 493 | // +++++++++++++++++++++++++++++++=Ploting min/mean/max forces for each fragment per bond order | 
|---|
|  | 494 | // min | 
|---|
| [390248] | 495 | if (!CreatePlotOrder(ForceFragments, KeySet, argv[3], "MinForces-FragmentOrder", 5, "below", "y", "set boxwidth 0.2", 1, 1, "bond order", "minimum of approximated forces [Ht/a.u.]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with boxes fillcolor", BoxesForcePlotLine)) return 1; | 
|---|
| [437922] | 496 |  | 
|---|
| [14de469] | 497 | // mean | 
|---|
| [390248] | 498 | if (!CreatePlotOrder(ForceFragments, KeySet, argv[3], "MeanForces-FragmentOrder", 5, "below", "y", "set boxwidth 0.2", 1, 1, "bond order", "mean of approximated forces [Ht/a.u.]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with boxes fillcolor", BoxesFirstForceValuePlotLine)) return 1; | 
|---|
| [437922] | 499 |  | 
|---|
| [14de469] | 500 | // max | 
|---|
| [390248] | 501 | if (!CreatePlotOrder(ForceFragments, KeySet, argv[3], "MaxForces-FragmentOrder", 5, "below", "y", "set boxwidth 0.2", 1, 1, "bond order", "maximum of approximated forces [Ht/a.u.]", Orderxrange.str().c_str(), yrange.str().c_str(), "1" , "with boxes fillcolor", BoxesForcePlotLine)) return 1; | 
|---|
| [437922] | 502 |  | 
|---|
| [95634f] | 503 | // +++++++++++++++++++++++++++++++=Ploting approximated and true shielding for each atom | 
|---|
|  | 504 | if (periode != NULL) { // also look for PAS values | 
|---|
|  | 505 | if(!OpenOutputFile(output, argv[3], "ShieldingsPAS-Order.pyx")) return 1; | 
|---|
| [4ee3df] | 506 | if(!OpenOutputFile(output2, argv[3], "DeltaShieldingsPAS-Order.pyx")) return 1; | 
|---|
| [95634f] | 507 | CreatePlotHeader(output, "ShieldingsPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical shielding value [ppm]"); | 
|---|
| [4ee3df] | 508 | CreatePlotHeader(output2, "DeltaShieldingsPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical shielding value [ppm]"); | 
|---|
| [95634f] | 509 | double step=0.8/KeySet.Order; | 
|---|
|  | 510 | output << "set boxwidth " << step << endl; | 
|---|
|  | 511 | output << "plot [0:" << ShieldingPAS.RowCounter[ShieldingPAS.MatrixCounter]+10 << "]\\" << endl; | 
|---|
| [4ee3df] | 512 | output2 << "plot [0:" << ShieldingPAS.RowCounter[ShieldingPAS.MatrixCounter]+10 << "]\\" << endl; | 
|---|
| [95634f] | 513 | for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { | 
|---|
|  | 514 | output << "'ShieldingsPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1+" << step*(double)BondOrder << "):7 with boxes, \\" << endl; | 
|---|
| [4ee3df] | 515 | output2 << "'DeltaShieldingsPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1):7 with linespoints"; | 
|---|
|  | 516 | if (BondOrder-1 != KeySet.Order) | 
|---|
|  | 517 | output2 << ", \\" << endl; | 
|---|
| [95634f] | 518 | } | 
|---|
|  | 519 | output << "'ShieldingsPAS-Order.dat' index " << KeySet.Order << " title 'Full' using ($1+" << step*(double)KeySet.Order << "):7 with boxes" << endl; | 
|---|
| [4ee3df] | 520 | output2.close(); | 
|---|
| [674220] | 521 |  | 
|---|
|  | 522 | if(!OpenOutputFile(output, argv[3], "ChisPAS-Order.pyx")) return 1; | 
|---|
|  | 523 | if(!OpenOutputFile(output2, argv[3], "DeltaChisPAS-Order.pyx")) return 1; | 
|---|
|  | 524 | CreatePlotHeader(output, "ChisPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical Chi value [ppm]"); | 
|---|
|  | 525 | CreatePlotHeader(output2, "DeltaChisPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical Chi value [ppm]"); | 
|---|
|  | 526 | output << "set boxwidth " << step << endl; | 
|---|
|  | 527 | output << "plot [0:" << ChiPAS.RowCounter[ChiPAS.MatrixCounter]+10 << "]\\" << endl; | 
|---|
|  | 528 | output2 << "plot [0:" << ChiPAS.RowCounter[ChiPAS.MatrixCounter]+10 << "]\\" << endl; | 
|---|
|  | 529 | for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { | 
|---|
|  | 530 | output << "'ChisPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1+" << step*(double)BondOrder << "):7 with boxes, \\" << endl; | 
|---|
|  | 531 | output2 << "'DeltaChisPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1):7 with linespoints"; | 
|---|
| [71e7c7] | 532 | if (BondOrder-1 != KeySet.Order) | 
|---|
|  | 533 | output2 << ", \\" << endl; | 
|---|
|  | 534 | } | 
|---|
|  | 535 | output << "'ChisPAS-Order.dat' index " << KeySet.Order << " title 'Full' using ($1+" << step*(double)KeySet.Order << "):7 with boxes" << endl; | 
|---|
| [95634f] | 536 | output.close(); | 
|---|
| [4ee3df] | 537 | output2.close(); | 
|---|
| [234af2] | 538 |  | 
|---|
|  | 539 | if(!OpenOutputFile(output, argv[3], "ChisPAS-Order.pyx")) return 1; | 
|---|
|  | 540 | if(!OpenOutputFile(output2, argv[3], "DeltaChisPAS-Order.pyx")) return 1; | 
|---|
|  | 541 | CreatePlotHeader(output, "ChisPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical Chi value [ppm]"); | 
|---|
|  | 542 | CreatePlotHeader(output2, "DeltaChisPAS-Order", 1, "top right", NULL, NULL,  1, 5, "nuclei index", "iso chemical Chi value [ppm]"); | 
|---|
|  | 543 | output << "set boxwidth " << step << endl; | 
|---|
|  | 544 | output << "plot [0:" << ChiPAS.RowCounter[ChiPAS.MatrixCounter]+10 << "]\\" << endl; | 
|---|
|  | 545 | output2 << "plot [0:" << ChiPAS.RowCounter[ChiPAS.MatrixCounter]+10 << "]\\" << endl; | 
|---|
|  | 546 | for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { | 
|---|
|  | 547 | output << "'ChisPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1+" << step*(double)BondOrder << "):7 with boxes, \\" << endl; | 
|---|
|  | 548 | output2 << "'DeltaChisPAS-Order.dat' index " << BondOrder << " title 'Order " << BondOrder+1 << "' using ($1):7 with linespoints"; | 
|---|
| [674220] | 549 | if (BondOrder-1 != KeySet.Order) | 
|---|
|  | 550 | output2 << ", \\" << endl; | 
|---|
|  | 551 | } | 
|---|
|  | 552 | output << "'ChisPAS-Order.dat' index " << KeySet.Order << " title 'Full' using ($1+" << step*(double)KeySet.Order << "):7 with boxes" << endl; | 
|---|
|  | 553 | output.close(); | 
|---|
|  | 554 | output2.close(); | 
|---|
| [95634f] | 555 | } | 
|---|
|  | 556 |  | 
|---|
| [14de469] | 557 | // create Makefile | 
|---|
|  | 558 | if(!OpenOutputFile(output, argv[3], "Makefile")) return 1; | 
|---|
|  | 559 | output << "PYX = $(shell ls *.pyx)" << endl << endl; | 
|---|
|  | 560 | output << "EPS = $(PYX:.pyx=.eps)" << endl << endl; | 
|---|
|  | 561 | output << "%.eps: %.pyx" << endl; | 
|---|
|  | 562 | output << "\t~/build/pyxplot/pyxplot $<" << endl << endl; | 
|---|
|  | 563 | output << "all: $(EPS)" << endl << endl; | 
|---|
|  | 564 | output << ".PHONY: clean" << endl; | 
|---|
|  | 565 | output << "clean:" << endl; | 
|---|
|  | 566 | output << "\trm -rf $(EPS)" << endl; | 
|---|
|  | 567 | output.close(); | 
|---|
| [437922] | 568 |  | 
|---|
| [68cb0f] | 569 | // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++ | 
|---|
|  | 570 | delete(periode); | 
|---|
| [920c70] | 571 | delete[](dir); | 
|---|
| [a67d19] | 572 | DoLog(0) && (Log() << Verbose(0) << "done." << endl); | 
|---|
| [14de469] | 573 | return 0; | 
|---|
|  | 574 | }; | 
|---|
|  | 575 |  | 
|---|
|  | 576 | //============================ END =========================== | 
|---|