Changeset d87482 for molecuilder/src/joiner.cpp
- Timestamp:
- Oct 18, 2008, 2:06:51 PM (17 years ago)
- Children:
- b4c71a
- Parents:
- 59f86c
- File:
-
- 1 edited
-
molecuilder/src/joiner.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/joiner.cpp
r59f86c rd87482 19 19 periodentafel *periode = NULL; // and a period table of all elements 20 20 EnergyMatrix Energy; 21 EnergyMatrix EnergyFragments; 22 21 23 EnergyMatrix Hcorrection; 24 EnergyMatrix HcorrectionFragments; 25 22 26 ForceMatrix Force; 23 EnergyMatrix EnergyFragments;24 EnergyMatrix HcorrectionFragments;25 27 ForceMatrix ForceFragments; 28 29 HessianMatrix Hessian; 30 HessianMatrix HessianFragments; 31 26 32 ForceMatrix Shielding; 27 33 ForceMatrix ShieldingPAS; … … 32 38 char *dir = NULL; 33 39 bool Hcorrected = true; 40 bool NoHessian = false; 34 41 35 42 cout << "Joiner" << endl; … … 63 70 Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0); 64 71 if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1; 72 if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) { 73 NoHessian = true; 74 cout << "No hessian matrices found, skipping those."; 75 } 65 76 if (periode != NULL) { // also look for PAS values 66 77 if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1; … … 74 85 // ---------- Parse the Force indices into an array --------------- 75 86 if (!Force.ParseIndices(argv[1])) return 1; 87 88 // ---------- Parse the Hessian (=force) indices into an array --------------- 89 if (!Hessian.ParseIndices(argv[1])) return 1; 76 90 77 91 // ---------- Parse the shielding indices into an array --------------- … … 88 102 if (Hcorrected) HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter); 89 103 if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1; 104 if (!NoHessian) 105 if (!HessianFragments.AllocateMatrix(Hessian.Header, Hessian.MatrixCounter, Hessian.RowCounter, Hessian.ColumnCounter)) return 1; 90 106 if (periode != NULL) { // also look for PAS values 91 107 if (!ShieldingFragments.AllocateMatrix(Shielding.Header, Shielding.MatrixCounter, Shielding.RowCounter, Shielding.ColumnCounter)) return 1; … … 96 112 if(!Energy.SetLastMatrix(0., 0)) return 1; 97 113 if(!Force.SetLastMatrix(0., 2)) return 1; 114 if (!NoHessian) 115 if (!Hessian.SetLastMatrix(0., 0)) return 1; 98 116 if (periode != NULL) { // also look for PAS values 99 117 if(!Shielding.SetLastMatrix(0., 2)) return 1; … … 118 136 if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1; 119 137 if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1; 138 // --------- sum up Hessian -------------------- 139 if (!NoHessian) { 140 cout << "Summing Hessian of order " << BondOrder+1 << " ..." << endl; 141 if (!HessianFragments.SumSubManyBodyTerms(Hessian, KeySet, BondOrder)) return 1; 142 if (!Hessian.SumSubHessians(HessianFragments, KeySet, BondOrder, 1.)) return 1; 143 } 120 144 if (periode != NULL) { // also look for PAS values 121 145 cout << "Summing shieldings of order " << BondOrder+1 << " ..." << endl; … … 134 158 // forces 135 159 if (!Force.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ForcesSuffix)) return 1; 160 // hessian 161 if (!Hessian.WriteLastMatrix(argv[1], (prefix.str()).c_str(), HessianSuffix)) return 1; 136 162 // shieldings 137 163 if (periode != NULL) { // also look for PAS values … … 153 179 if (!ForceFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 154 180 if (!CreateDataFragment(EnergyFragments, KeySet, argv[1], FRAGMENTPREFIX ENERGYPERFRAGMENT, "fragment energy versus the Fragment No", "today", CreateEnergy)) return 1; 181 if (!NoHessian) { 182 prefix.str(" "); 183 prefix << dir << HessianFragmentSuffix; 184 if (!HessianFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 185 } 155 186 if (periode != NULL) { // also look for PAS values 156 187 prefix.str(" "); … … 166 197 if (Hcorrected) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix); 167 198 if (!Force.WriteLastMatrix(argv[1], dir, ForceFragmentSuffix)) return 1; 199 if (!NoHessian) 200 if (!Hessian.WriteLastMatrix(argv[1], dir, HessianFragmentSuffix)) return 1; 168 201 if (periode != NULL) { // also look for PAS values 169 202 if (!Shielding.WriteLastMatrix(argv[1], dir, ShieldingFragmentSuffix)) return 1;
Note:
See TracChangeset
for help on using the changeset viewer.
