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