Ignore:
Timestamp:
Oct 19, 2008, 1:57:23 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
5fd79e
Parents:
d635bda
Message:

HessianMatrix implemented fully, but not yet working, probably due to wrong matrix generation in script file (convertHessian.py)

HessianMatrix::IsSymmetric was though to be needed, but is NOT. As we regard full matrices, we don't need to add onto mirrored indices as well
Joiner and Analyzer have seen some small changes and bugfixes: NoHessian was not also always looked at when needed and so on

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/joiner.cpp

    rd635bda raa2e37  
    3737  stringstream prefix;
    3838  char *dir = NULL;
    39   bool Hcorrected = true;
     39  bool NoHCorrection = false;
    4040  bool NoHessian = false;
    4141
     
    6868  // ------------- Parse through all Fragment subdirs --------
    6969  if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix, 0,0)) return 1;
    70   Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0);
     70  if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0)) {
     71    NoHCorrection = true;
     72    cout << "No HCorrection matrices found, skipping these." << endl;
     73  }
    7174  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1;
    7275  if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) {
    7376    NoHessian = true;
    74     cout << "No hessian matrices found, skipping those.";
     77    cout << "No hessian matrices found, skipping these." << endl;
    7578  }
    7679  if (periode != NULL) { // also look for PAS values
     
    8184  // ---------- Parse the TE Factors into an array -----------------
    8285  if (!Energy.InitialiseIndices()) return 1;
    83   if (Hcorrected) Hcorrection.InitialiseIndices();
     86  if (!NoHCorrection)
     87    Hcorrection.InitialiseIndices();
    8488 
    8589  // ---------- Parse the Force indices into an array ---------------
     
    8791
    8892  // ---------- Parse the Hessian (=force) indices into an array ---------------
    89   if (!Hessian.InitialiseIndices((class MatrixContainer *)&Force)) return 1;
     93  if (!NoHessian)
     94    if (!Hessian.InitialiseIndices((class MatrixContainer *)&Force)) return 1;
    9095
    9196  // ---------- Parse the shielding indices into an array ---------------
     
    100105  if (!KeySet.ParseManyBodyTerms()) return 1;
    101106  if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return 1;
    102   if (Hcorrected)  HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter);
     107  if (!NoHCorrection) 
     108    HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter);
    103109  if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1;
    104110  if (!NoHessian)
     
    126132    cout << "Summing energy of order " << BondOrder+1 << " ..." << endl;
    127133    if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1;
    128     if (Hcorrected) {
     134    if (!NoHCorrection) {
    129135      HcorrectionFragments.SumSubManyBodyTerms(Hcorrection, KeySet, BondOrder);
    130136      if (!Energy.SumSubEnergy(EnergyFragments, &HcorrectionFragments, KeySet, BondOrder, 1.)) return 1;
    131       if (Hcorrected) Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.);
     137      Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.);
    132138    } else
    133139      if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1;
     
    159165    if (!Force.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ForcesSuffix)) return 1;
    160166    // hessian
    161     if (!Hessian.WriteLastMatrix(argv[1], (prefix.str()).c_str(), HessianSuffix)) return 1;
     167    if (!NoHessian)
     168      if (!Hessian.WriteLastMatrix(argv[1], (prefix.str()).c_str(), HessianSuffix)) return 1;
    162169    // shieldings
    163170    if (periode != NULL) { // also look for PAS values
     
    170177  prefix << dir << EnergyFragmentSuffix;
    171178  if (!EnergyFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
    172   if (Hcorrected) {
     179  if (!NoHCorrection) {
    173180    prefix.str(" ");
    174181    prefix << dir << HcorrectionFragmentSuffix;
     
    195202  // write last matrices as fragments into central dir (not subdir as above), for analyzer to know index bounds
    196203  if (!Energy.WriteLastMatrix(argv[1], dir, EnergyFragmentSuffix)) return 1;
    197   if (Hcorrected) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix);
     204  if (!NoHCorrection) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix);
    198205  if (!Force.WriteLastMatrix(argv[1], dir, ForceFragmentSuffix)) return 1;
    199206  if (!NoHessian)
Note: See TracChangeset for help on using the changeset viewer.