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