Changeset 3c349b
- Timestamp:
- Nov 3, 2009, 4:34:31 PM (15 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, 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:
- f4e1f5
- Parents:
- ae38fb
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/bondgraph.cpp ¶
rae38fb r3c349b 84 84 return false; 85 85 86 if (BondLengthMatrix == NULL) // no bond length matrix parsed? 86 if (BondLengthMatrix == NULL) { // no bond length matrix parsed? 87 SetMaxDistanceToMaxOfCovalentRadii(out, mol); 87 88 mol->CreateAdjacencyList(out, max_distance, IsAngstroem, &BondGraph::CovalentMinMaxDistance, this); 88 else89 } else 89 90 mol->CreateAdjacencyList(out, max_distance, IsAngstroem, &BondGraph::BondLengthMatrixMinMaxDistance, this); 90 91 … … 105 106 }; 106 107 107 /** Determines the maximum of all element::CovalentRadius .108 /** Determines the maximum of all element::CovalentRadius for elements present in \a *mol. 108 109 * \param *out output stream for debugging 109 * \param * periode periodentafel with allelements.110 * \param *mol molecule with all atoms and their respective elements. 110 111 */ 111 double BondGraph::SetMaxDistanceToMaxOfCovalentRadii(ofstream * const out, const periodentafel * const periode)112 double BondGraph::SetMaxDistanceToMaxOfCovalentRadii(ofstream * const out, const molecule * const mol) 112 113 { 113 114 max_distance = 0.; 114 115 115 element * Runner = periode->start;116 while (Runner->next != periode->end) {116 atom *Runner = mol->start; 117 while (Runner->next != mol->end) { 117 118 Runner = Runner->next; 118 if (Runner-> CovalentRadius > max_distance)119 max_distance = Runner-> CovalentRadius;119 if (Runner->type->CovalentRadius > max_distance) 120 max_distance = Runner->type->CovalentRadius; 120 121 } 121 122 max_distance *= 2.; -
TabularUnified src/bondgraph.hpp ¶
rae38fb r3c349b 38 38 bool ConstructBondGraph(ofstream * const out, molecule * const mol); 39 39 double GetBondLength(int firstelement, int secondelement); 40 double SetMaxDistanceToMaxOfCovalentRadii(ofstream * const out, const periodentafel * const periode);40 double SetMaxDistanceToMaxOfCovalentRadii(ofstream * const out, const molecule * const mol); 41 41 42 42 void BondLengthMatrixMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem); -
TabularUnified src/boundary.cpp ¶
rae38fb r3c349b 655 655 volume += PyramidVolume; 656 656 } 657 *out << Verbose(0) << "RESULT: The summed volume is " << setprecision( 8)657 *out << Verbose(0) << "RESULT: The summed volume is " << setprecision(6) 658 658 << volume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." 659 659 << endl; -
TabularUnified src/config.cpp ¶
rae38fb r3c349b 1051 1051 } else { 1052 1052 cout << Verbose(0) << "Bond length table loading failed." << endl; 1053 BG->SetMaxDistanceToMaxOfCovalentRadii((ofstream *)&cout, periode);1054 1053 } 1055 1054 … … 1068 1067 delete(BackEdgeStack); 1069 1068 1070 // 6. dissect 1071 atom ***ListOfLocalAtoms = NULL; 1069 // 6. dissect (the following construct is needed to have the atoms not in the order of the DFS, but in 1070 // the original one as parsed in) 1071 // TODO: Optimize this, when molecules just contain pointer list of global atoms! 1072 1073 // 6a. create array of molecules to fill 1074 const int MolCount = Subgraphs->Count(); 1075 molecule **molecules = Malloc<molecule *>(MolCount, "config::Load() - **molecules"); 1076 for (int i=0;i<MolCount;i++) { 1077 molecules[i] = (molecule*) new molecule(periode); 1078 molecules[i]->ActiveFlag = true; 1079 MolList->insert(molecules[i]); 1080 } 1081 1082 // 6b. create and fill map of which atom is associated to which connected molecule (note, counting starts at 1) 1072 1083 int FragmentCounter = 0; 1084 int *MolMap = Calloc<int>(mol->AtomCount, "config::Load() - *MolMap"); 1073 1085 MoleculeLeafClass *MolecularWalker = Subgraphs; 1074 1086 atom *Walker = NULL; 1075 1087 while (MolecularWalker->next != NULL) { 1076 1088 MolecularWalker = MolecularWalker->next; 1077 // fill the bond structure of the individually stored subgraphs (goes through whole chained list by itself)1078 MolecularWalker->FillBondStructureFromReference((ofstream *)&cout, mol, FragmentCounter, ListOfLocalAtoms, false); // we don't want to keep the created ListOfLocalAtoms1079 FragmentCounter++;1080 MolecularWalker->Leaf->ActiveFlag = true;1081 1089 Walker = MolecularWalker->Leaf->start; 1082 1090 while (Walker->next != MolecularWalker->Leaf->end) { 1083 1091 Walker = Walker->next; 1084 Walker->father = Walker;1092 MolMap[Walker->GetTrueFather()->nr] = FragmentCounter+1; 1085 1093 } 1086 MolList->insert(MolecularWalker->Leaf); 1087 MolecularWalker->Leaf = NULL; // don't remove molecule when deleting MolecularWalker 1094 FragmentCounter++; 1095 } 1096 1097 // 6c. relocate atoms to new molecules and remove from Leafs 1098 Walker = mol->start; 1099 while (mol->start->next != mol->end) { 1100 Walker = mol->start->next; 1101 if ((Walker->nr <0) || (Walker->nr >= mol->AtomCount)) { 1102 cerr << "Index of atom " << *Walker << " is invalid!" << endl; 1103 performCriticalExit(); 1104 } 1105 FragmentCounter = MolMap[Walker->nr]; 1106 if (FragmentCounter != 0) { 1107 cout << Verbose(3) << "Re-linking " << *Walker << "..." << endl; 1108 unlink(Walker); 1109 molecules[FragmentCounter-1]->AddAtom(Walker); // counting starts at 1 1110 } else { 1111 cerr << "Atom " << *Walker << " not associated to molecule!" << endl; 1112 performCriticalExit(); 1113 } 1114 } 1115 // 6d. we don't need to redo bonds, as they are connected subgraphs and still maintained their ListOfBonds 1116 // 6e. free Leafs 1117 MolecularWalker = Subgraphs; 1118 while (MolecularWalker->next != NULL) { 1119 MolecularWalker = MolecularWalker->next; 1088 1120 delete(MolecularWalker->previous); 1089 1121 } 1090 1122 delete(MolecularWalker); 1091 for (int i=0;i<FragmentCounter;i++)1092 Free(&ListOfLocalAtoms[i]);1093 Free(& ListOfLocalAtoms);1123 delete(mol); 1124 Free(&MolMap); 1125 Free(&molecules); 1094 1126 cout << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl; 1095 1096 // 6. free parsed in molecule1097 delete(mol);1098 1127 1099 1128 delete(FileBuffer); -
TabularUnified src/helpers.hpp ¶
rae38fb r3c349b 71 71 * \paran *end end of chain list 72 72 * \param **Lookuptable pointer to return allocated lookup table (should be NULL on start) 73 * \param count optional predetermined countfor table (otherwise we set the count to highest true father id)73 * \param count optional predetermined size for table (otherwise we set the count to highest true father id) 74 74 * \return true - success, false - failure 75 75 */ … … 104 104 status = false; 105 105 } else { 106 for (int i=0;i<count;i++)107 LookupTable[i] = NULL;108 106 Walker = start; 109 107 while (Walker->next != end) { // create a lookup table (Atom::nr -> atom) used as a marker table lateron -
TabularUnified src/molecule_fragmentation.cpp ¶
rae38fb r3c349b 641 641 } 642 642 } 643 *out << Verbose(2) << "CheckOrder is " << CheckOrder << "." << endl; 643 644 delete[](RootStack); 644 645 delete[](AtomMask); -
TabularUnified src/molecule_graph.cpp ¶
rae38fb r3c349b 121 121 removewithoutcheck(Binder); 122 122 } 123 BondCount = 0; 123 124 124 125 // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering)
Note:
See TracChangeset
for help on using the changeset viewer.