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