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