Changeset bd6bfa
- Timestamp:
- Jun 1, 2010, 7:28:15 AM (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:
- acf800
- Parents:
- 1b9321
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/bondgraph.cpp
r1b9321 rbd6bfa 88 88 { 89 89 Info FunctionInfo(__func__); 90 bool status = true;90 bool status = true; 91 91 92 92 if (mol->empty()) // only construct if molecule is not empty -
src/molecule.hpp
r1b9321 rbd6bfa 380 380 bool StoreForcesFile(char *path, int *SortIndex); 381 381 void insert(molecule *mol); 382 void erase(molecule *mol); 382 383 molecule * ReturnIndex(int index); 383 384 bool OutputConfigForListOfFragments(config *configuration, int *SortIndex); -
src/molecule_graph.cpp
r1b9321 rbd6bfa 67 67 performCriticalExit(); 68 68 }; 69 doCountAtoms(); 69 70 70 71 // skip header … … 632 633 DoLog(1) && (Log() << Verbose(1) << "Final graph info for each bond is:" << endl); 633 634 for(molecule::const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) 634 for(BondList::const_iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())635 for(BondList::const_iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); BondRunner != (*AtomRunner)->ListOfBonds.end(); ++BondRunner) 635 636 if ((*BondRunner)->leftatom == *AtomRunner) { 636 637 Binder = *BondRunner; -
src/moleculelist.cpp
r1b9321 rbd6bfa 40 40 MoleculeListClass::~MoleculeListClass() 41 41 { 42 DoLog(3) && (Log() << Verbose(3) << this << ": Freeing ListOfMolcules." << endl); 43 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 44 DoLog(4) && (Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl); 45 world->destroyMolecule(*ListRunner); 46 } 47 DoLog(4) && (Log() << Verbose(4) << "Freeing ListOfMolecules." << endl); 42 DoLog(4) && (Log() << Verbose(4) << "Clearing ListOfMolecules." << endl); 43 for(MoleculeList::iterator MolRunner = ListOfMolecules.begin(); MolRunner != ListOfMolecules.end(); ++MolRunner) 44 (*MolRunner)->signOff(this); 48 45 ListOfMolecules.clear(); // empty list 49 46 }; … … 51 48 /** Insert a new molecule into the list and set its number. 52 49 * \param *mol molecule to add to list. 53 * \return true - add successful54 50 */ 55 51 void MoleculeListClass::insert(molecule *mol) … … 59 55 ListOfMolecules.push_back(mol); 60 56 mol->signOn(this); 57 }; 58 59 /** Erases a molecule from the list. 60 * \param *mol molecule to add to list. 61 */ 62 void MoleculeListClass::erase(molecule *mol) 63 { 64 OBSERVE; 65 mol->signOff(this); 66 ListOfMolecules.remove(mol); 61 67 }; 62 68 … … 742 748 void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration) 743 749 { 750 // 0a. remove all present molecules 751 vector<molecule *> allmolecules = World::getInstance().getAllMolecules(); 752 for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) { 753 erase(*MolRunner); 754 World::getInstance().destroyMolecule(*MolRunner); 755 } 756 // 0b. remove all bonds 744 757 molecule *mol = World::getInstance().createMolecule(); 745 bond *Binder = NULL; 746 // 0. gather all atoms into single molecule 747 for (MoleculeList::iterator MolRunner = ListOfMolecules.begin(); !ListOfMolecules.empty(); MolRunner = ListOfMolecules.begin()) { 748 // shift all atoms to new molecule 749 for (molecule::iterator iter = (*MolRunner)->begin(); (*MolRunner)->empty(); iter = (*MolRunner)->begin()) { 750 DoLog(3) && (Log() << Verbose(3) << "Re-linking " << (*iter) << "..." << endl); 751 (*iter)->father = (*iter); 752 mol->AddAtom((*iter)); // counting starts at 1 753 (*MolRunner)->erase(iter); 754 } 755 // remove all bonds 756 for(molecule::iterator AtomRunner = (*MolRunner)->begin(); AtomRunner != (*MolRunner)->end(); ++AtomRunner) 757 for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin()) 758 delete(*BondRunner); 759 // remove the molecule 760 World::getInstance().destroyMolecule(*MolRunner); 761 ListOfMolecules.erase(MolRunner); 758 vector <atom *> allatoms = World::getInstance().getAllAtoms(); 759 for(vector<atom *>::iterator AtomRunner = allatoms.begin(); AtomRunner != allatoms.end(); ++AtomRunner) { 760 for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin()) 761 delete(*BondRunner); 762 mol->AddAtom(*AtomRunner); 762 763 } 763 764 … … 816 817 // 4c. relocate atoms to new molecules and remove from Leafs 817 818 for (molecule::iterator iter = mol->begin(); !mol->empty(); iter = mol->begin()) { 818 if (((*iter)->nr <0) || ((*iter)->nr >= mol->getAtomCount())) { 819 DoeLog(0) && (eLog()<< Verbose(0) << "Index of atom " << **iter << " is invalid!" << endl); 819 const int count = mol->getAtomCount(); 820 if (((*iter)->nr <0) || ((*iter)->nr >= count)) { 821 DoeLog(0) && (eLog()<< Verbose(0) << "Index " << (*iter)->nr << " of atom " << **iter << " in molecule of " << count << " atoms is invalid!" << endl); 820 822 performCriticalExit(); 821 823 } 822 FragmentCounter= MolMap[(*iter)->nr];823 if ( FragmentCounter!= 0) {824 const int Index = MolMap[(*iter)->nr]; 825 if (Index != 0) { 824 826 DoLog(3) && (Log() << Verbose(3) << "Re-linking " << **iter << "..." << endl); 825 molecules[ FragmentCounter-1]->AddAtom((*iter)); // counting starts at 1827 molecules[Index-1]->AddAtom((*iter)); // counting starts at 1 826 828 mol->erase(iter); 827 829 } else { -
tests/regression/Molecules/6/post/test.conf
r1b9321 rbd6bfa 71 71 Ion_Type2 3 6 1.0 3 3 12.01100000000 Carbon C 72 72 #Ion_TypeNr._Nr.R[0] R[1] R[2] MoveType (0 MoveIon, 1 FixedIon) 73 Ion_Type 2_1 10.782085945 4.275186040 4.5358860370 # molecule nr 074 Ion_Type 2_2 9.532785963 5.158586027 4.5358860370 # molecule nr 175 Ion_Type 2_3 8.283585982 4.2751860404.535886037 0 # molecule nr 276 Ion_Type1_ 1 10.782085945 3.6458860503.645886050 0 # molecule nr 377 Ion_Type1_ 2 10.782085945 3.6458860505.425886024 0 # molecule nr 478 Ion_Type1_ 3 11.672039608 4.9045368784.535886037 0 # molecule nr 579 Ion_Type1_ 4 9.532785963 5.7878860183.645886050 0 # molecule nr 680 Ion_Type1_ 5 9.532785963 5.7878860185.425886024 0 # molecule nr 781 Ion_Type 1_6 7.393632318 4.9045368774.535886037 0 # molecule nr 882 Ion_Type 1_7 8.283585982 3.645886050 3.6458860500 # molecule nr 983 Ion_Type 1_8 8.283585982 3.645886050 5.4258860240 # molecule nr 1073 Ion_Type1_1 10.782085945 3.645886050 3.645886050 0 # molecule nr 0 74 Ion_Type1_2 10.782085945 3.645886050 5.425886024 0 # molecule nr 1 75 Ion_Type1_3 11.672039608 4.904536878 4.535886037 0 # molecule nr 2 76 Ion_Type1_4 9.532785963 5.787886018 3.645886050 0 # molecule nr 3 77 Ion_Type1_5 9.532785963 5.787886018 5.425886024 0 # molecule nr 4 78 Ion_Type1_6 7.393632318 4.904536877 4.535886037 0 # molecule nr 5 79 Ion_Type1_7 8.283585982 3.645886050 3.645886050 0 # molecule nr 6 80 Ion_Type1_8 8.283585982 3.645886050 5.425886024 0 # molecule nr 7 81 Ion_Type2_1 10.782085945 4.275186040 4.535886037 0 # molecule nr 8 82 Ion_Type2_2 9.532785963 5.158586027 4.535886037 0 # molecule nr 9 83 Ion_Type2_3 8.283585982 4.275186040 4.535886037 0 # molecule nr 10 -
tests/regression/Molecules/7/post/test.conf
r1b9321 rbd6bfa 71 71 Ion_Type2 3 6 1.0 3 3 12.01100000000 Carbon C 72 72 #Ion_TypeNr._Nr.R[0] R[1] R[2] MoveType (0 MoveIon, 1 FixedIon) 73 Ion_Type 2_1 1.782085945 15.275186040 15.5358860370 # molecule nr 074 Ion_Type 2_2 0.532785963 16.158586027 15.5358860370 # molecule nr 175 Ion_Type 2_3 19.283585982 15.27518604015.535886037 0 # molecule nr 276 Ion_Type1_ 1 1.782085945 14.64588605014.645886050 0 # molecule nr 377 Ion_Type1_ 2 1.782085945 14.64588605016.425886024 0 # molecule nr 478 Ion_Type1_ 3 2.672039608 15.90453687815.535886037 0 # molecule nr 579 Ion_Type1_ 4 0.532785963 16.78788601814.645886050 0 # molecule nr 680 Ion_Type1_ 5 0.532785963 16.78788601816.425886024 0 # molecule nr 781 Ion_Type 1_6 18.393632318 15.90453687715.535886037 0 # molecule nr 882 Ion_Type 1_7 19.283585982 14.645886050 14.6458860500 # molecule nr 983 Ion_Type 1_8 19.283585982 14.645886050 16.4258860240 # molecule nr 1073 Ion_Type1_1 1.782085945 14.645886050 14.645886050 0 # molecule nr 0 74 Ion_Type1_2 1.782085945 14.645886050 16.425886024 0 # molecule nr 1 75 Ion_Type1_3 2.672039608 15.904536878 15.535886037 0 # molecule nr 2 76 Ion_Type1_4 0.532785963 16.787886018 14.645886050 0 # molecule nr 3 77 Ion_Type1_5 0.532785963 16.787886018 16.425886024 0 # molecule nr 4 78 Ion_Type1_6 18.393632318 15.904536877 15.535886037 0 # molecule nr 5 79 Ion_Type1_7 19.283585982 14.645886050 14.645886050 0 # molecule nr 6 80 Ion_Type1_8 19.283585982 14.645886050 16.425886024 0 # molecule nr 7 81 Ion_Type2_1 1.782085945 15.275186040 15.535886037 0 # molecule nr 8 82 Ion_Type2_2 0.532785963 16.158586027 15.535886037 0 # molecule nr 9 83 Ion_Type2_3 19.283585982 15.275186040 15.535886037 0 # molecule nr 10
Note:
See TracChangeset
for help on using the changeset viewer.