Changeset f39735 for molecuilder/src/analyzer.cpp
- Timestamp:
- Jul 23, 2009, 1:45:24 PM (16 years ago)
- Children:
- 47548d
- Parents:
- 560995 (diff), 1b2aa1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Frederik Heber <heber@…> (07/23/09 12:34:47)
- git-committer:
- Frederik Heber <heber@…> (07/23/09 13:45:24)
- File:
-
- 1 edited
-
molecuilder/src/analyzer.cpp (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/analyzer.cpp
r560995 rf39735 3 3 * Takes evaluated fragments (energy and forces) and does evaluation of how sensible the BOSSANOVA 4 4 * approach was, e.g. in the decay of the many-body-contributions. 5 * 5 * 6 6 */ 7 7 … … 9 9 10 10 #include "datacreator.hpp" 11 #include "helpers.hpp" 11 #include "helpers.hpp" 12 12 #include "parser.hpp" 13 #include "periodentafel.hpp" 13 #include "periodentafel.hpp" 14 14 15 15 // include config.h … … 55 55 stringstream yrange; 56 56 char *dir = NULL; 57 bool NoHCorrection = false;58 57 bool NoHessian = false; 59 58 bool NoTime = false; 59 bool NoHCorrection = true; 60 60 int counter; 61 61 62 62 cout << "ANOVA Analyzer" << endl; 63 63 cout << "==============" << endl; 64 64 65 65 // Get the command line options 66 66 if (argc < 4) { … … 76 76 strcat(dir, argv[2]); 77 77 } 78 78 79 79 if (argc > 4) { 80 80 cout << "Loading periodentafel." << endl; … … 82 82 periode->LoadPeriodentafel(argv[4]); 83 83 } 84 84 85 85 // Test the given directory 86 86 if (!TestParams(argc, argv)) … … 88 88 89 89 // +++++++++++++++++ PARSING +++++++++++++++++++++++++++++++ 90 90 91 91 // ------------- Parse through all Fragment subdirs -------- 92 92 if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix,0,0)) return 1; … … 113 113 114 114 // ---------- Parse the TE Factors into an array ----------------- 115 if (!Energy.InitialiseIndices()) return 1; 116 if (!NoHCorrection) 117 Hcorrection.InitialiseIndices(); 118 115 if (!Energy.ParseIndices()) return 1; 116 if (!NoHCorrection) Hcorrection.ParseIndices(); 117 119 118 // ---------- Parse the Force indices into an array --------------- 120 119 if (!Force.ParseIndices(argv[1])) return 1; … … 148 147 if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1; 149 148 if (!KeySet.ParseManyBodyTerms()) return 1; 150 149 151 150 // ---------- Parse fragment files created by 'joiner' into an array ------------- 152 151 if (!EnergyFragments.ParseFragmentMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1; … … 164 163 165 164 // +++++++++++++++ TESTING ++++++++++++++++++++++++++++++ 166 165 167 166 // print energy and forces to file 168 167 filename.str(""); … … 245 244 246 245 // +++++++++++++++ ANALYZING ++++++++++++++++++++++++++++++ 247 246 248 247 cout << "Analyzing ..." << endl; 249 248 … … 330 329 } 331 330 332 331 333 332 // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM 334 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; 335 334 336 335 // +++++++++++++++++++++++++++++++++++Plotting Energies vs. Order 337 336 if (!CreateDataEnergyOrder(EnergyFragments, KeySet, argv[3], "Energies-Order", "Plot of approximated energies versus the Bond Order", datum)) return 1; 338 337 339 338 // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in forces to full QM 340 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; … … 399 398 400 399 // ======================================= Creating the plot files ============================================================== 401 400 402 401 Orderxrange << "[1:" << KeySet.Order << "]"; 403 402 Fragmentxrange << "[0:" << KeySet.FragmentCounter+1 << "]"; … … 411 410 // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM 412 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; 413 412 414 413 // +++++++++++++++++++++++++++++++++++Plotting Energies vs. Order 415 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; … … 429 428 if(!OpenOutputFile(output, argv[3], "DeltaMinMeanMaxTotalForce-Order.pyx")) return 1; 430 429 CreatePlotHeader(output, "DeltaMinMeanMaxTotalForce-Order", 1, "bottom left", "y", NULL, 1, 1, "bond order k", "absolute error in total forces [Ht/a.u.]"); 431 output << "plot " << Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; 430 output << "plot " << Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; 432 431 output << "'DeltaMinForces-Order.dat' title 'minimum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints, \\" << endl; 433 432 output << "'DeltaMeanForces-Order.dat' title 'mean' using 1:(abs($" << 8 << ")) with linespoints, \\" << endl; 434 433 output << "'DeltaMaxForces-Order.dat' title 'maximum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints" << endl; 435 output.close(); 434 output.close(); 436 435 437 436 // ++++++++++++++++++++++++++++++++++++++Plotting Forces vs. Order … … 448 447 if(!OpenOutputFile(output, argv[3],"MinMeanMaxTotalForce-Order.pyx")) return 1; 449 448 CreatePlotHeader(output, "MinMeanMaxTotalForce-Order", 1, "bottom left", "y", NULL, 1, 1, "bond order k", "absolute total force [Ht/a.u.]"); 450 output << "plot "<< Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; 449 output << "plot "<< Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; 451 450 output << "'MinForces-Order.dat' title 'minimum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints, \\" << endl; 452 451 output << "'MeanForces-Order.dat' title 'mean' using 1:(abs($" << 8 << ")) with linespoints, \\" << endl; 453 452 output << "'MaxForces-Order.dat' title 'maximum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints" << endl; 454 output.close(); 453 output.close(); 455 454 456 455 // ++++++++++++++++++++++++++++++++++++++Plotting vector sum vs. Order … … 471 470 // min 472 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; 473 472 474 473 // mean 475 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; 476 475 477 476 // max 478 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; … … 481 480 // min 482 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; 483 482 484 483 // mean 485 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; 486 485 487 486 // max 488 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; 489 488 490 489 // +++++++++++++++++++++++++++++++=Ploting approximated and true shielding for each atom 491 490 if (periode != NULL) { // also look for PAS values … … 553 552 output << "\trm -rf $(EPS)" << endl; 554 553 output.close(); 555 554 556 555 // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++ 557 556 delete(periode);
Note:
See TracChangeset
for help on using the changeset viewer.
