Ignore:
Timestamp:
Jun 27, 2008, 9:14:58 PM (17 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

introduced shieldings to analyzer and joiner

both now handle pcp.sigma_all...csv files just as pcp.forces.all. Therefore the data format in pcp/perturbed.c was adapted a bit, as we need a header.
periodentafel.hpp got periodentafel and element class from molecules.hpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/analyzer.cpp

    rd7b1bf r375dcf  
    88//============================ INCLUDES ===========================
    99
     10#include "datacreator.hpp"
    1011#include "helpers.hpp"
    1112#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
    1319
    1420
     
    1723int main(int argc, char **argv)
    1824{
     25  periodentafel *periode = NULL; // and a period table of all elements
    1926  EnergyMatrix Energy;
    2027  ForceMatrix Force;
     28  ForceMatrix Shielding;
     29  ForceMatrix ShieldingPAS;
    2130  MatrixContainer Time;
    2231  EnergyMatrix EnergyFragments;
    2332  ForceMatrix ForceFragments;
    24   KeySetsContainer KeySet; 
     33  ForceMatrix ShieldingFragments;
     34  ForceMatrix ShieldingPASFragments;
     35  KeySetsContainer KeySet;
    2536  ofstream output;
    2637  ofstream output2;
    2738  ofstream output3;
    2839  ofstream output4;
     40  ifstream input;
    2941  stringstream filename;
    3042  time_t t = time(NULL);
     
    3951  // Get the command line options
    4052  if (argc < 4) {
    41     cout << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir>" << endl;
     53    cout << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl;
    4254    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;
    4355    cout << "<prefix>\tprefix of energy and forces file." << endl;
    4456    cout << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl;
     57    cout << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;
    4558    return 1;
     59  }
     60  if (argc > 4) {
     61    cout << "Loading periodentafel." << endl;
     62    periode = new periodentafel;
     63    periode->LoadPeriodentafel(argv[4]);
    4664  }
    4765 
     
    5674  if (!Force.ParseMatrix(argv[1], argv[2], ForcesSuffix,0,0)) return 1;
    5775  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  }
    5880
    5981  // ---------- Parse the TE Factors into an array -----------------
     
    6284  // ---------- Parse the Force indices into an array ---------------
    6385  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  }
    6492
    6593  // ---------- Parse the KeySets into an array ---------------
    6694  if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1;
    6795  if (!KeySet.ParseManyBodyTerms()) return 1;
     96 
     97  // ---------- Parse fragment files created by 'joiner' into an array -------------
    6898  if (!EnergyFragments.ParseMatrix(argv[1], argv[2], EnergyFragmentSuffix,0,0)) return 1;
    6999  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  }
    70104
    71105  // +++++++++++++++ TESTING ++++++++++++++++++++++++++++++
     
    91125  output << endl;
    92126
     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 
    93145  output << endl << "Total Times" << endl << "===============" << endl << Time.Header << endl;
    94146  Time.SetLastMatrix(0., 0);
     
    380432  output.close();
    381433 
    382   // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++ 
     434  // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++
     435  delete(periode);
    383436  cout << "done." << endl;
    384437  return 0;
Note: See TracChangeset for help on using the changeset viewer.