Changeset 375dcf for molecuilder/src/analyzer.cpp
- Timestamp:
- Jun 27, 2008, 9:14:58 PM (17 years ago)
- Children:
- 74baec
- Parents:
- d7b1bf
- git-author:
- Frederik Heber <heber@…> (06/27/08 21:12:52)
- git-committer:
- Frederik Heber <heber@…> (06/27/08 21:14:58)
- File:
-
- 1 edited
-
molecuilder/src/analyzer.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/analyzer.cpp
rd7b1bf r375dcf 8 8 //============================ INCLUDES =========================== 9 9 10 #include "datacreator.hpp" 10 11 #include "helpers.hpp" 11 12 #include "parser.hpp" 12 #include "datacreator.hpp" 13 #include "periodentafel.hpp" 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 13 19 14 20 … … 17 23 int main(int argc, char **argv) 18 24 { 25 periodentafel *periode = NULL; // and a period table of all elements 19 26 EnergyMatrix Energy; 20 27 ForceMatrix Force; 28 ForceMatrix Shielding; 29 ForceMatrix ShieldingPAS; 21 30 MatrixContainer Time; 22 31 EnergyMatrix EnergyFragments; 23 32 ForceMatrix ForceFragments; 24 KeySetsContainer KeySet; 33 ForceMatrix ShieldingFragments; 34 ForceMatrix ShieldingPASFragments; 35 KeySetsContainer KeySet; 25 36 ofstream output; 26 37 ofstream output2; 27 38 ofstream output3; 28 39 ofstream output4; 40 ifstream input; 29 41 stringstream filename; 30 42 time_t t = time(NULL); … … 39 51 // Get the command line options 40 52 if (argc < 4) { 41 cout << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> " << endl;53 cout << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl; 42 54 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; 43 55 cout << "<prefix>\tprefix of energy and forces file." << endl; 44 56 cout << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl; 57 cout << "[elementsdb]\tpath to elements database, needed for shieldings." << endl; 45 58 return 1; 59 } 60 if (argc > 4) { 61 cout << "Loading periodentafel." << endl; 62 periode = new periodentafel; 63 periode->LoadPeriodentafel(argv[4]); 46 64 } 47 65 … … 56 74 if (!Force.ParseMatrix(argv[1], argv[2], ForcesSuffix,0,0)) return 1; 57 75 if (!Time.ParseMatrix(argv[1], argv[2], TimeSuffix, 10,1)) return 1; 76 if (periode != NULL) { // also look for PAS values 77 if (!Shielding.ParseMatrix(argv[1], argv[2], ShieldingSuffix, 1, 0)) return 1; 78 if (!ShieldingPAS.ParseMatrix(argv[1], argv[2], ShieldingPASSuffix, 1, 0)) return 1; 79 } 58 80 59 81 // ---------- Parse the TE Factors into an array ----------------- … … 62 84 // ---------- Parse the Force indices into an array --------------- 63 85 if (!Force.ParseIndices(argv[1])) return 1; 86 87 // ---------- Parse the shielding indices into an array --------------- 88 if (periode != NULL) { // also look for PAS values 89 if(!Shielding.ParseIndices(argv[1])) return 1; 90 if(!ShieldingPAS.ParseIndices(argv[1])) return 1; 91 } 64 92 65 93 // ---------- Parse the KeySets into an array --------------- 66 94 if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1; 67 95 if (!KeySet.ParseManyBodyTerms()) return 1; 96 97 // ---------- Parse fragment files created by 'joiner' into an array ------------- 68 98 if (!EnergyFragments.ParseMatrix(argv[1], argv[2], EnergyFragmentSuffix,0,0)) return 1; 69 99 if (!ForceFragments.ParseMatrix(argv[1], argv[2], ForceFragmentSuffix,0,0)) return 1; 100 if (periode != NULL) { // also look for PAS values 101 if (!ShieldingFragments.ParseMatrix(argv[1], argv[2], ShieldingSuffix, 1, 0)) return 1; 102 if (!ShieldingPASFragments.ParseMatrix(argv[1], argv[2], ShieldingPASSuffix, 1, 0)) return 1; 103 } 70 104 71 105 // +++++++++++++++ TESTING ++++++++++++++++++++++++++++++ … … 91 125 output << endl; 92 126 127 if (periode != NULL) { // also look for PAS values 128 output << endl << "Total Shieldings" << endl << "===============" << endl << Shielding.Header << endl; 129 for(int j=0;j<Shielding.RowCounter[Shielding.MatrixCounter];j++) { 130 for(int k=0;k<Shielding.ColumnCounter;k++) 131 output << scientific << Shielding.Matrix[ Shielding.MatrixCounter ][j][k] << "\t"; 132 output << endl; 133 } 134 output << endl; 135 136 output << endl << "Total Shieldings PAS" << endl << "===============" << endl << ShieldingPAS.Header << endl; 137 for(int j=0;j<ShieldingPAS.RowCounter[ShieldingPAS.MatrixCounter];j++) { 138 for(int k=0;k<ShieldingPAS.ColumnCounter;k++) 139 output << scientific << ShieldingPAS.Matrix[ ShieldingPAS.MatrixCounter ][j][k] << "\t"; 140 output << endl; 141 } 142 output << endl; 143 } 144 93 145 output << endl << "Total Times" << endl << "===============" << endl << Time.Header << endl; 94 146 Time.SetLastMatrix(0., 0); … … 380 432 output.close(); 381 433 382 // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++ 434 // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++ 435 delete(periode); 383 436 cout << "done." << endl; 384 437 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.
