Changeset aa2e37 for molecuilder/src/joiner.cpp
- Timestamp:
- Oct 19, 2008, 1:57:23 PM (17 years ago)
- Children:
- 5fd79e
- Parents:
- d635bda
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/joiner.cpp
rd635bda raa2e37 37 37 stringstream prefix; 38 38 char *dir = NULL; 39 bool Hcorrected = true;39 bool NoHCorrection = false; 40 40 bool NoHessian = false; 41 41 … … 68 68 // ------------- Parse through all Fragment subdirs -------- 69 69 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 } 71 74 if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1; 72 75 if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) { 73 76 NoHessian = true; 74 cout << "No hessian matrices found, skipping th ose.";77 cout << "No hessian matrices found, skipping these." << endl; 75 78 } 76 79 if (periode != NULL) { // also look for PAS values … … 81 84 // ---------- Parse the TE Factors into an array ----------------- 82 85 if (!Energy.InitialiseIndices()) return 1; 83 if (Hcorrected) Hcorrection.InitialiseIndices(); 86 if (!NoHCorrection) 87 Hcorrection.InitialiseIndices(); 84 88 85 89 // ---------- Parse the Force indices into an array --------------- … … 87 91 88 92 // ---------- 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; 90 95 91 96 // ---------- Parse the shielding indices into an array --------------- … … 100 105 if (!KeySet.ParseManyBodyTerms()) return 1; 101 106 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); 103 109 if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1; 104 110 if (!NoHessian) … … 126 132 cout << "Summing energy of order " << BondOrder+1 << " ..." << endl; 127 133 if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1; 128 if ( Hcorrected) {134 if (!NoHCorrection) { 129 135 HcorrectionFragments.SumSubManyBodyTerms(Hcorrection, KeySet, BondOrder); 130 136 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.); 132 138 } else 133 139 if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1; … … 159 165 if (!Force.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ForcesSuffix)) return 1; 160 166 // 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; 162 169 // shieldings 163 170 if (periode != NULL) { // also look for PAS values … … 170 177 prefix << dir << EnergyFragmentSuffix; 171 178 if (!EnergyFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 172 if ( Hcorrected) {179 if (!NoHCorrection) { 173 180 prefix.str(" "); 174 181 prefix << dir << HcorrectionFragmentSuffix; … … 195 202 // write last matrices as fragments into central dir (not subdir as above), for analyzer to know index bounds 196 203 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); 198 205 if (!Force.WriteLastMatrix(argv[1], dir, ForceFragmentSuffix)) return 1; 199 206 if (!NoHessian)
Note:
See TracChangeset
for help on using the changeset viewer.