Changeset b38b64 for src/joiner.cpp
- Timestamp:
- Jul 23, 2009, 9:14:18 AM (16 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 631dcb
- Parents:
- b77416 (diff), 72744a (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. - File:
-
- 1 edited
-
src/joiner.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/joiner.cpp
rb77416 rb38b64 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; … … 35 41 stringstream prefix; 36 42 char *dir = NULL; 37 bool Hcorrected = true; 43 bool NoHCorrection = false; 44 bool NoHessian = false; 38 45 39 46 cout << "Joiner" << endl; … … 65 72 // ------------- Parse through all Fragment subdirs -------- 66 73 if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix, 0,0)) return 1; 67 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 } 68 78 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 } 69 83 if (periode != NULL) { // also look for PAS values 70 84 if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1; … … 75 89 76 90 // ---------- Parse the TE Factors into an array ----------------- 77 if (!Energy.ParseIndices()) return 1; 78 if (Hcorrected) Hcorrection.ParseIndices(); 91 if (!Energy.InitialiseIndices()) return 1; 92 if (!NoHCorrection) 93 Hcorrection.InitialiseIndices(); 79 94 80 95 // ---------- Parse the Force indices into an array --------------- 81 96 if (!Force.ParseIndices(argv[1])) return 1; 97 98 // ---------- Parse the Hessian (=force) indices into an array --------------- 99 if (!NoHessian) 100 if (!Hessian.InitialiseIndices((class MatrixContainer *)&Force)) return 1; 82 101 83 102 // ---------- Parse the shielding indices into an array --------------- … … 94 113 95 114 if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return 1; 96 if (Hcorrected) HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter); 115 if (!NoHCorrection) 116 HcorrectionFragments.AllocateMatrix(Hcorrection.Header, Hcorrection.MatrixCounter, Hcorrection.RowCounter, Hcorrection.ColumnCounter); 97 117 if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1; 118 if (!NoHessian) 119 if (!HessianFragments.AllocateMatrix(Hessian.Header, Hessian.MatrixCounter, Hessian.RowCounter, Hessian.ColumnCounter)) return 1; 98 120 if (periode != NULL) { // also look for PAS values 99 121 if (!ShieldingFragments.AllocateMatrix(Shielding.Header, Shielding.MatrixCounter, Shielding.RowCounter, Shielding.ColumnCounter)) return 1; … … 106 128 if(!Energy.SetLastMatrix(0., 0)) return 1; 107 129 if(!Force.SetLastMatrix(0., 2)) return 1; 130 if (!NoHessian) 131 if (!Hessian.SetLastMatrix(0., 0)) return 1; 108 132 if (periode != NULL) { // also look for PAS values 109 133 if(!Shielding.SetLastMatrix(0., 2)) return 1; … … 120 144 cout << "Summing energy of order " << BondOrder+1 << " ..." << endl; 121 145 if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1; 122 if ( Hcorrected) {146 if (!NoHCorrection) { 123 147 HcorrectionFragments.SumSubManyBodyTerms(Hcorrection, KeySet, BondOrder); 124 148 if (!Energy.SumSubEnergy(EnergyFragments, &HcorrectionFragments, KeySet, BondOrder, 1.)) return 1; 125 if (Hcorrected)Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.);149 Hcorrection.SumSubEnergy(HcorrectionFragments, NULL, KeySet, BondOrder, 1.); 126 150 } else 127 151 if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1; … … 130 154 if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1; 131 155 if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1; 156 // --------- sum up Hessian -------------------- 157 if (!NoHessian) { 158 cout << "Summing Hessian of order " << BondOrder+1 << " ..." << endl; 159 if (!HessianFragments.SumSubManyBodyTerms(Hessian, KeySet, BondOrder)) return 1; 160 if (!Hessian.SumSubHessians(HessianFragments, KeySet, BondOrder, 1.)) return 1; 161 } 132 162 if (periode != NULL) { // also look for PAS values 133 163 cout << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl; … … 150 180 // forces 151 181 if (!Force.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ForcesSuffix)) return 1; 182 // hessian 183 if (!NoHessian) 184 if (!Hessian.WriteLastMatrix(argv[1], (prefix.str()).c_str(), HessianSuffix)) return 1; 152 185 // shieldings 153 186 if (periode != NULL) { // also look for PAS values … … 162 195 prefix << dir << EnergyFragmentSuffix; 163 196 if (!EnergyFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 164 if ( Hcorrected) {197 if (!NoHCorrection) { 165 198 prefix.str(" "); 166 199 prefix << dir << HcorrectionFragmentSuffix; … … 171 204 if (!ForceFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 172 205 if (!CreateDataFragment(EnergyFragments, KeySet, argv[1], FRAGMENTPREFIX ENERGYPERFRAGMENT, "fragment energy versus the Fragment No", "today", CreateEnergy)) return 1; 206 if (!NoHessian) { 207 prefix.str(" "); 208 prefix << dir << HessianFragmentSuffix; 209 if (!HessianFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1; 210 } 173 211 if (periode != NULL) { // also look for PAS values 174 212 prefix.str(" "); … … 188 226 // write last matrices as fragments into central dir (not subdir as above), for analyzer to know index bounds 189 227 if (!Energy.WriteLastMatrix(argv[1], dir, EnergyFragmentSuffix)) return 1; 190 if ( Hcorrected) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix);228 if (!NoHCorrection) Hcorrection.WriteLastMatrix(argv[1], dir, HcorrectionFragmentSuffix); 191 229 if (!Force.WriteLastMatrix(argv[1], dir, ForceFragmentSuffix)) return 1; 230 if (!NoHessian) 231 if (!Hessian.WriteLastMatrix(argv[1], dir, HessianFragmentSuffix)) return 1; 192 232 if (periode != NULL) { // also look for PAS values 193 233 if (!Shielding.WriteLastMatrix(argv[1], dir, ShieldingFragmentSuffix)) return 1;
Note:
See TracChangeset
for help on using the changeset viewer.
