Changes in molecuilder/src/joiner.cpp [f98e5a:97c751]
- File:
-
- 1 edited
-
molecuilder/src/joiner.cpp (modified) (9 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/joiner.cpp
-
Property mode
changed from
100644to100755
rf98e5a r97c751 19 19 periodentafel *periode = NULL; // and a period table of all elements 20 20 EnergyMatrix Energy; 21 EnergyMatrix Hcorrection; 22 ForceMatrix Force; 21 23 EnergyMatrix EnergyFragments; 22 23 EnergyMatrix Hcorrection;24 24 EnergyMatrix HcorrectionFragments; 25 26 ForceMatrix Force;27 25 ForceMatrix ForceFragments; 28 29 HessianMatrix Hessian;30 HessianMatrix HessianFragments;31 32 26 ForceMatrix Shielding; 33 27 ForceMatrix ShieldingPAS; 34 28 ForceMatrix ShieldingFragments; 35 29 ForceMatrix ShieldingPASFragments; 30 EnergyMatrix Chi; 31 EnergyMatrix ChiPAS; 32 EnergyMatrix ChiFragments; 33 EnergyMatrix ChiPASFragments; 36 34 KeySetsContainer KeySet; 37 35 stringstream prefix; 38 36 char *dir = NULL; 39 bool NoHCorrection = false; 40 bool NoHessian = false; 37 bool Hcorrected = true; 41 38 42 39 cout << "Joiner" << endl; … … 68 65 // ------------- Parse through all Fragment subdirs -------- 69 66 if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix, 0,0)) return 1; 70 if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0)) { 71 NoHCorrection = true; 72 cout << "No HCorrection matrices found, skipping these." << endl; 73 } 67 Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0); 74 68 if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1; 75 if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) {76 NoHessian = true;77 cout << "No hessian matrices found, skipping these." << endl;78 }79 69 if (periode != NULL) { // also look for PAS values 80 70 if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1; 81 71 if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1; 72 if (!Chi.ParseFragmentMatrix(argv[1], dir, ChiSuffix, 1, 0)) return 1; 73 if (!ChiPAS.ParseFragmentMatrix(argv[1], dir, ChiPASSuffix, 1, 0)) return 1; 82 74 } 83 75 84 76 // ---------- Parse the TE Factors into an array ----------------- 85 if (!Energy.InitialiseIndices()) return 1; 86 if (!NoHCorrection) 87 Hcorrection.InitialiseIndices(); 77 if (!Energy.ParseIndices()) return 1; 78 if (Hcorrected) Hcorrection.ParseIndices(); 88 79 89 80 // ---------- Parse the Force indices into an array --------------- 90 81 if (!Force.ParseIndices(argv[1])) return 1; 91 82 92 // ---------- Parse the Hessian (=force) indices into an array ---------------93 if (!NoHessian)94 if (!Hessian.InitialiseIndices((class MatrixContainer *)&Force)) return 1;95 96 83 // ---------- Parse the shielding indices into an array --------------- 97 84 if (periode != NULL) { // also look for PAS values 98 85 if(!Shielding.ParseIndices(argv[1])) return 1; 99 86 if(!ShieldingPAS.ParseIndices(argv[1])) return 1; 87 if(!Chi.ParseIndices()) return 1; 88 if(!ChiPAS.ParseIndices()) return 1; 100 89 } 101 90 102 91 // ---------- Parse the KeySets into an array --------------- 103 92 if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1; 104 105 93 if (!KeySet.ParseManyBodyTerms()) return 1; 94 106 95 if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return 1; 107 if (!NoHCorrection) 108 HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter); 96 if (Hcorrected) HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter); 109 97 if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1; 110 if (!NoHessian)111 if (!HessianFragments.AllocateMatrix(Hessian.Header, Hessian.MatrixCounter, Hessian.RowCounter, Hessian.ColumnCounter)) return 1;112 98 if (periode != NULL) { // also look for PAS values 113 99 if (!ShieldingFragments.AllocateMatrix(Shielding.Header, Shielding.MatrixCounter, Shielding.RowCounter, Shielding.ColumnCounter)) return 1; 114 100 if (!ShieldingPASFragments.AllocateMatrix(ShieldingPAS.Header, ShieldingPAS.MatrixCounter, ShieldingPAS.RowCounter, ShieldingPAS.ColumnCounter)) return 1; 101 if (!ChiFragments.AllocateMatrix(Chi.Header, Chi.MatrixCounter, Chi.RowCounter, Chi.ColumnCounter)) return 1; 102 if (!ChiPASFragments.AllocateMatrix(ChiPAS.Header, ChiPAS.MatrixCounter, ChiPAS.RowCounter, ChiPAS.ColumnCounter)) return 1; 115 103 } 116 104 … … 118 106 if(!Energy.SetLastMatrix(0., 0)) return 1; 119 107 if(!Force.SetLastMatrix(0., 2)) return 1; 120 if (!NoHessian)121 if (!Hessian.SetLastMatrix(0., 0)) return 1;122 108 if (periode != NULL) { // also look for PAS values 123 109 if(!Shielding.SetLastMatrix(0., 2)) return 1; 124 110 if(!ShieldingPAS.SetLastMatrix(0., 2)) return 1; 111 if(!Chi.SetLastMatrix(0., 2)) return 1; 112 if(!ChiPAS.SetLastMatrix(0., 2)) return 1; 125 113 } 126 114 … … 132 120 cout << "Summing energy of order " << BondOrder+1 << " ..." << endl; 133 121 if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1; 134 if ( !NoHCorrection) {122 if (Hcorrected) { 135 123 HcorrectionFragments.SumSubManyBodyTerms(Hcorrection, KeySet, BondOrder); 136 124 if (!Energy.SumSubEnergy(EnergyFragments, &HcorrectionFragments, KeySet, BondOrder, 1.)) return 1; 137 Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.);125 if (Hcorrected) Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.); 138 126 } else 139 127 if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1; … … 142 130 if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1; 143 131 if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1; 144 // --------- sum up Hessian --------------------145 if (!NoHessian) {146 cout << "Summing Hessian of order " << BondOrder+1 << " ..." << endl;147 if (!HessianFragments.SumSubManyBodyTerms(Hessian, KeySet, BondOrder)) return 1;148 if (!Hessian.SumSubHessians(HessianFragments, KeySet, BondOrder, 1.)) return 1;149 }150 132 if (periode != NULL) { // also look for PAS values 151 cout << "Summing shieldings of order " << BondOrder+1 << " ..." << endl;133 cout << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl; 152 134 if (!ShieldingFragments.SumSubManyBodyTerms(Shielding, KeySet, BondOrder)) return 1; 153 135 if (!Shielding.SumSubForces(ShieldingFragments, KeySet, BondOrder, 1.)) return 1; 154 136 if (!ShieldingPASFragments.SumSubManyBodyTerms(ShieldingPAS, KeySet, BondOrder)) return 1; 155 137 if (!ShieldingPAS.SumSubForces(ShieldingPASFragments, KeySet, BondOrder, 1.)) return 1; 138 if (!ChiFragments.SumSubManyBodyTerms(Chi, KeySet, BondOrder)) return 1; 139 if (!Chi.SumSubEnergy(ChiFragments, NULL, KeySet, BondOrder, 1.)) return 1; 140 if (!ChiPASFragments.SumSubManyBodyTerms(ChiPAS, KeySet, BondOrder)) return 1; 141 if (!ChiPAS.SumSubEnergy(ChiPASFragments, NULL,KeySet, BondOrder, 1.)) return 1; 156 142 } 157 143 … … 164 150 // forces 165 151 if (!Force.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ForcesSuffix)) return 1; 166 // hessian167 if (!NoHessian)168 if (!Hessian.WriteLastMatrix(argv[1], (prefix.str()).c_str(), HessianSuffix)) return 1;169 152 // shieldings 170 153 if (periode != NULL) { // also look for PAS values 171 154 if (!Shielding.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingSuffix)) return 1; 172 155 if (!ShieldingPAS.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingPASSuffix)) return 1; 156 if (!Chi.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ChiSuffix)) return 1; 157 if (!ChiPAS.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ChiPASSuffix)) return 1; 173 158 } 174 159 } … … 177 162 prefix << dir << EnergyFragmentSuffix; 178 163 if (!EnergyFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 179 if ( !NoHCorrection) {164 if (Hcorrected) { 180 165 prefix.str(" "); 181 166 prefix << dir << HcorrectionFragmentSuffix; … … 186 171 if (!ForceFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 187 172 if (!CreateDataFragment(EnergyFragments, KeySet, argv[1], FRAGMENTPREFIX ENERGYPERFRAGMENT, "fragment energy versus the Fragment No", "today", CreateEnergy)) return 1; 188 if (!NoHessian) {189 prefix.str(" ");190 prefix << dir << HessianFragmentSuffix;191 if (!HessianFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;192 }193 173 if (periode != NULL) { // also look for PAS values 194 174 prefix.str(" "); … … 198 178 prefix << dir << ShieldingPASFragmentSuffix; 199 179 if (!ShieldingPASFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 180 prefix.str(" "); 181 prefix << dir << ChiFragmentSuffix; 182 if (!ChiFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 183 prefix.str(" "); 184 prefix << dir << ChiPASFragmentSuffix; 185 if (!ChiPASFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 200 186 } 201 187 202 188 // write last matrices as fragments into central dir (not subdir as above), for analyzer to know index bounds 203 189 if (!Energy.WriteLastMatrix(argv[1], dir, EnergyFragmentSuffix)) return 1; 204 if ( !NoHCorrection) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix);190 if (Hcorrected) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix); 205 191 if (!Force.WriteLastMatrix(argv[1], dir, ForceFragmentSuffix)) return 1; 206 if (!NoHessian)207 if (!Hessian.WriteLastMatrix(argv[1], dir, HessianFragmentSuffix)) return 1;208 192 if (periode != NULL) { // also look for PAS values 209 193 if (!Shielding.WriteLastMatrix(argv[1], dir, ShieldingFragmentSuffix)) return 1; 210 194 if (!ShieldingPAS.WriteLastMatrix(argv[1], dir, ShieldingPASFragmentSuffix)) return 1; 195 if (!Chi.WriteLastMatrix(argv[1], dir, ChiFragmentSuffix)) return 1; 196 if (!ChiPAS.WriteLastMatrix(argv[1], dir, ChiPASFragmentSuffix)) return 1; 211 197 } 212 198 -
Property mode
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
