Ignore:
Timestamp:
Jul 24, 2009, 10:38:32 AM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
53d153
Parents:
a048fa (diff), 47548d (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 14:23:32)
git-committer:
Frederik Heber <heber@…> (07/24/09 10:38:32)
Message:

Merge branch 'master' into ConcaveHull

Conflicts:

molecuilder/src/analyzer.cpp
molecuilder/src/bond.cpp
molecuilder/src/boundary.cpp
molecuilder/src/boundary.hpp
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/datacreator.cpp
molecuilder/src/datacreator.hpp
molecuilder/src/defs.hpp
molecuilder/src/ellipsoid.cpp
molecuilder/src/joiner.cpp
molecuilder/src/molecules.cpp
molecuilder/src/molecules.hpp
molecuilder/src/parser.cpp
molecuilder/src/parser.hpp

merges:

compilation fixes:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/joiner.cpp

    ra048fa rc3a303  
    1919  periodentafel *periode = NULL; // and a period table of all elements
    2020  EnergyMatrix Energy;
     21  EnergyMatrix EnergyFragments;
     22 
    2123  EnergyMatrix Hcorrection;
     24  EnergyMatrix HcorrectionFragments;
     25 
    2226  ForceMatrix Force;
    23   EnergyMatrix EnergyFragments;
    24   EnergyMatrix HcorrectionFragments;
    2527  ForceMatrix ForceFragments;
     28
     29  HessianMatrix Hessian;
     30  HessianMatrix HessianFragments;
     31 
    2632  ForceMatrix Shielding;
    2733  ForceMatrix ShieldingPAS;
    2834  ForceMatrix ShieldingFragments;
    2935  ForceMatrix ShieldingPASFragments;
    30   KeySetsContainer KeySet;
     36  ForceMatrix Chi;
     37  ForceMatrix ChiPAS;
     38  ForceMatrix ChiFragments;
     39  ForceMatrix ChiPASFragments;
     40  KeySetsContainer KeySet; 
    3141  stringstream prefix;
    3242  char *dir = NULL;
    33   bool Hcorrected = true;
     43  bool NoHCorrection = false;
     44  bool NoHessian = false;
    3445
    3546  cout << "Joiner" << endl;
     
    6172  // ------------- Parse through all Fragment subdirs --------
    6273  if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix, 0,0)) return 1;
    63   Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0);
     74  if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0)) {
     75    NoHCorrection = true;
     76    cout << "No HCorrection matrices found, skipping these." << endl;
     77  }
    6478  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1;
     79  if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) {
     80    NoHessian = true;
     81    cout << "No hessian matrices found, skipping these." << endl;
     82  }
    6583  if (periode != NULL) { // also look for PAS values
    6684    if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
    6785    if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
     86    if (!Chi.ParseFragmentMatrix(argv[1], dir, ChiSuffix, 1, 0)) return 1;
     87    if (!ChiPAS.ParseFragmentMatrix(argv[1], dir, ChiPASSuffix, 1, 0)) return 1;
    6888  }
    6989
    7090  // ---------- Parse the TE Factors into an array -----------------
    71   if (!Energy.ParseIndices()) return 1;
    72   if (Hcorrected) Hcorrection.ParseIndices();
    73 
     91  if (!Energy.InitialiseIndices()) return 1;
     92  if (!NoHCorrection)
     93    Hcorrection.InitialiseIndices();
     94 
    7495  // ---------- Parse the Force indices into an array ---------------
    7596  if (!Force.ParseIndices(argv[1])) return 1;
    7697
     98  // ---------- Parse the Hessian (=force) indices into an array ---------------
     99  if (!NoHessian)
     100    if (!Hessian.InitialiseIndices((class MatrixContainer *)&Force)) return 1;
     101
    77102  // ---------- Parse the shielding indices into an array ---------------
    78103  if (periode != NULL) { // also look for PAS values
    79104    if(!Shielding.ParseIndices(argv[1])) return 1;
    80105    if(!ShieldingPAS.ParseIndices(argv[1])) return 1;
     106    if(!Chi.ParseIndices(argv[1])) return 1;
     107    if(!ChiPAS.ParseIndices(argv[1])) return 1;
    81108  }
    82109
     
    85112
    86113  if (!KeySet.ParseManyBodyTerms()) return 1;
     114
    87115  if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return 1;
    88   if (Hcorrected)  HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter);
     116  if (!NoHCorrection) 
     117    HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter);
    89118  if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1;
     119  if (!NoHessian)
     120    if (!HessianFragments.AllocateMatrix(Hessian.Header, Hessian.MatrixCounter, Hessian.RowCounter, Hessian.ColumnCounter)) return 1;
    90121  if (periode != NULL) { // also look for PAS values
    91122    if (!ShieldingFragments.AllocateMatrix(Shielding.Header, Shielding.MatrixCounter, Shielding.RowCounter, Shielding.ColumnCounter)) return 1;
    92123    if (!ShieldingPASFragments.AllocateMatrix(ShieldingPAS.Header, ShieldingPAS.MatrixCounter, ShieldingPAS.RowCounter, ShieldingPAS.ColumnCounter)) return 1;
     124    if (!ChiFragments.AllocateMatrix(Chi.Header, Chi.MatrixCounter, Chi.RowCounter, Chi.ColumnCounter)) return 1;
     125    if (!ChiPASFragments.AllocateMatrix(ChiPAS.Header, ChiPAS.MatrixCounter, ChiPAS.RowCounter, ChiPAS.ColumnCounter)) return 1;
    93126  }
    94127
     
    96129  if(!Energy.SetLastMatrix(0., 0)) return 1;
    97130  if(!Force.SetLastMatrix(0., 2)) return 1;
     131  if (!NoHessian)
     132    if (!Hessian.SetLastMatrix(0., 0)) return 1;
    98133  if (periode != NULL) { // also look for PAS values
    99134    if(!Shielding.SetLastMatrix(0., 2)) return 1;
    100135    if(!ShieldingPAS.SetLastMatrix(0., 2)) return 1;
     136    if(!Chi.SetLastMatrix(0., 2)) return 1;
     137    if(!ChiPAS.SetLastMatrix(0., 2)) return 1;
    101138  }
    102139
     
    108145    cout << "Summing energy of order " << BondOrder+1 << " ..." << endl;
    109146    if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1;
    110     if (Hcorrected) {
     147    if (!NoHCorrection) {
    111148      HcorrectionFragments.SumSubManyBodyTerms(Hcorrection, KeySet, BondOrder);
    112149      if (!Energy.SumSubEnergy(EnergyFragments, &HcorrectionFragments, KeySet, BondOrder, 1.)) return 1;
    113       if (Hcorrected) Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.);
    114     } else
     150      Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.);
     151    } else 
    115152      if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1;
    116153    // --------- sum up Forces --------------------
     
    118155    if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1;
    119156    if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1;
     157    // --------- sum up Hessian --------------------
     158    if (!NoHessian) {
     159      cout << "Summing Hessian of order " << BondOrder+1 << " ..." << endl;
     160      if (!HessianFragments.SumSubManyBodyTerms(Hessian, KeySet, BondOrder)) return 1;
     161      if (!Hessian.SumSubHessians(HessianFragments, KeySet, BondOrder, 1.)) return 1;
     162    }
    120163    if (periode != NULL) { // also look for PAS values
    121       cout << "Summing shieldings of order " << BondOrder+1 << " ..." << endl;
     164      cout << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl;
    122165      if (!ShieldingFragments.SumSubManyBodyTerms(Shielding, KeySet, BondOrder)) return 1;
    123166      if (!Shielding.SumSubForces(ShieldingFragments, KeySet, BondOrder, 1.)) return 1;
    124167      if (!ShieldingPASFragments.SumSubManyBodyTerms(ShieldingPAS, KeySet, BondOrder)) return 1;
    125168      if (!ShieldingPAS.SumSubForces(ShieldingPASFragments, KeySet, BondOrder, 1.)) return 1;
     169      if (!ChiFragments.SumSubManyBodyTerms(Chi, KeySet, BondOrder)) return 1;
     170      if (!Chi.SumSubForces(ChiFragments, KeySet, BondOrder, 1.)) return 1;
     171      if (!ChiPASFragments.SumSubManyBodyTerms(ChiPAS, KeySet, BondOrder)) return 1;
     172      if (!ChiPAS.SumSubForces(ChiPASFragments, KeySet, BondOrder, 1.)) return 1;
    126173    }
    127174
     
    134181    // forces
    135182    if (!Force.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ForcesSuffix)) return 1;
     183    // hessian
     184    if (!NoHessian)
     185      if (!Hessian.WriteLastMatrix(argv[1], (prefix.str()).c_str(), HessianSuffix)) return 1;
    136186    // shieldings
    137187    if (periode != NULL) { // also look for PAS values
    138188      if (!Shielding.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingSuffix)) return 1;
    139189      if (!ShieldingPAS.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingPASSuffix)) return 1;
     190      if (!Chi.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ChiSuffix)) return 1;
     191      if (!ChiPAS.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ChiPASSuffix)) return 1;
    140192    }
    141193  }
     
    144196  prefix << dir << EnergyFragmentSuffix;
    145197  if (!EnergyFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
    146   if (Hcorrected) {
     198  if (!NoHCorrection) {
    147199    prefix.str(" ");
    148200    prefix << dir << HcorrectionFragmentSuffix;
     
    153205  if (!ForceFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
    154206  if (!CreateDataFragment(EnergyFragments, KeySet, argv[1], FRAGMENTPREFIX ENERGYPERFRAGMENT, "fragment energy versus the Fragment No", "today", CreateEnergy)) return 1;
     207  if (!NoHessian) {
     208    prefix.str(" ");
     209    prefix << dir << HessianFragmentSuffix;
     210    if (!HessianFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
     211  }
    155212  if (periode != NULL) { // also look for PAS values
    156213    prefix.str(" ");
     
    160217    prefix << dir << ShieldingPASFragmentSuffix;
    161218    if (!ShieldingPASFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
     219    prefix.str(" ");
     220    prefix << dir << ChiFragmentSuffix;
     221    if (!ChiFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
     222    prefix.str(" ");
     223    prefix << dir << ChiPASFragmentSuffix;
     224    if (!ChiPASFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
    162225  }
    163226
    164227  // write last matrices as fragments into central dir (not subdir as above), for analyzer to know index bounds
    165228  if (!Energy.WriteLastMatrix(argv[1], dir, EnergyFragmentSuffix)) return 1;
    166   if (Hcorrected) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix);
     229  if (!NoHCorrection) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix);
    167230  if (!Force.WriteLastMatrix(argv[1], dir, ForceFragmentSuffix)) return 1;
     231  if (!NoHessian)
     232    if (!Hessian.WriteLastMatrix(argv[1], dir, HessianFragmentSuffix)) return 1;
    168233  if (periode != NULL) { // also look for PAS values
    169234    if (!Shielding.WriteLastMatrix(argv[1], dir, ShieldingFragmentSuffix)) return 1;
    170235    if (!ShieldingPAS.WriteLastMatrix(argv[1], dir, ShieldingPASFragmentSuffix)) return 1;
     236    if (!Chi.WriteLastMatrix(argv[1], dir, ChiFragmentSuffix)) return 1;
     237    if (!ChiPAS.WriteLastMatrix(argv[1], dir, ChiPASFragmentSuffix)) return 1;
    171238  }
    172239
Note: See TracChangeset for help on using the changeset viewer.