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