Changeset 073a9e4
- Timestamp:
- Feb 24, 2011, 7:26:14 PM (14 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:
- 1e6249
- Parents:
- d557374
- git-author:
- Frederik Heber <heber@…> (02/24/11 14:32:36)
- git-committer:
- Frederik Heber <heber@…> (02/24/11 19:26:14)
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/ConstructBondGraphAction.cpp
rd557374 r073a9e4 140 140 // Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl; 141 141 bond * const Binder = new bond(Walker->father, OtherWalker->father, 1, BondCount++); 142 Walker->father->RegisterBond( Binder);143 OtherWalker->father->RegisterBond( Binder);142 Walker->father->RegisterBond(WorldTime::getTime(),Binder); 143 OtherWalker->father->RegisterBond(WorldTime::getTime(),Binder); 144 144 } else { 145 145 // Log() << Verbose(1) << "Not Adding: distance too great." << endl; -
src/Parser/PdbParser.cpp
rd557374 r073a9e4 24 24 #include "CodePatterns/toString.hpp" 25 25 #include "CodePatterns/Verbose.hpp" 26 #include "World.hpp"27 26 #include "atom.hpp" 28 27 #include "bond.hpp" … … 32 31 #include "Descriptors/AtomIdDescriptor.hpp" 33 32 #include "Parser/PdbParser.hpp" 33 #include "World.hpp" 34 #include "WorldTime.hpp" 34 35 35 36 #include <map> … … 522 523 // DoLog(1) && (Log() << Verbose(1) << "Adding Bond (" << getAtomId(id) << "," << getAtomId(*iter) << ")" << std::endl); 523 524 atom * const _Otheratom = World::getInstance().getAtom(AtomById(getSerial(*iter))); 524 _atom->addBond( _Otheratom);525 _atom->addBond(WorldTime::getTime(), _Otheratom); 525 526 } 526 527 } -
src/Parser/TremoloParser.cpp
rd557374 r073a9e4 458 458 // << atomIdMap[*neighbor] << "|" << *neighbor << ")" << std::endl); 459 459 World::getInstance().getAtom(AtomById(currentInfo->first)) 460 ->addBond(World ::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));460 ->addBond(WorldTime::getTime(), World::getInstance().getAtom(AtomById(atomIdMap[*neighbor]))); 461 461 } 462 462 currentInfo->second.neighbors_processed = true; -
src/Parser/unittests/ParserTremoloUnitTest.cpp
rd557374 r073a9e4 24 24 #include <cppunit/ui/text/TestRunner.h> 25 25 26 #include "atom.hpp" 27 #include "Descriptors/AtomTypeDescriptor.hpp" 28 #include "element.hpp" 26 29 #include "Parser/MpqcParser.hpp" 27 30 #include "Parser/PdbParser.hpp" … … 29 32 #include "Parser/TremoloParser.hpp" 30 33 #include "Parser/XyzParser.hpp" 34 #include "periodentafel.hpp" 31 35 #include "World.hpp" 32 #include "atom.hpp" 33 #include "element.hpp" 34 #include "periodentafel.hpp" 35 #include "Descriptors/AtomTypeDescriptor.hpp" 36 #include "WorldTime.hpp" 36 37 37 38 #ifdef HAVE_TESTRUNNER … … 165 166 CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms()); 166 167 CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(8))-> 167 IsBondedTo(World ::getInstance().getAtom(AtomByType(1))));168 IsBondedTo(WorldTime::getTime(), World::getInstance().getAtom(AtomByType(1)))); 168 169 input.clear(); 169 170 } -
src/atom_bondedparticle.cpp
rd557374 r073a9e4 103 103 * bond already exists. 104 104 * 105 * @param _step time step to access 105 106 * \param bonding partner 106 107 */ 107 void BondedParticle::addBond( BondedParticle* Partner) {108 if (IsBondedTo( Partner)) {108 void BondedParticle::addBond(const unsigned int _step, BondedParticle* Partner) { 109 if (IsBondedTo(_step, Partner)) { 109 110 return; 110 111 } 111 112 112 113 bond* newBond = new bond((atom*) this, (atom*) Partner, 1, 0); 113 RegisterBond( newBond);114 Partner->RegisterBond( newBond);114 RegisterBond(_step, newBond); 115 Partner->RegisterBond(_step, newBond); 115 116 } 116 117 117 118 /** Puts a given bond into atom::ListOfBonds. 119 * @param _step time step to access 118 120 * \param *Binder bond to insert 119 121 */ 120 bool BondedParticle::RegisterBond( bond *Binder)122 bool BondedParticle::RegisterBond(const unsigned int _step, bond *Binder) 121 123 { 122 124 bool status = false; … … 124 126 if (Binder->Contains(this)) { 125 127 //LOG(3,"INFO: Registering bond "<< *Binder << " with atom " << *this << " at step " << _step); 126 BondList& ListOfBonds = getListOfBonds ();128 BondList& ListOfBonds = getListOfBondsAtStep(_step); 127 129 ListOfBonds.push_back(Binder); 128 130 status = true; … … 245 247 246 248 /** Checks whether there is a bond between \a this atom and the given \a *BondPartner. 249 * @param _step time step to access 247 250 * \param *BondPartner atom to check for 248 251 * \return true - bond exists, false - bond does not exist 249 252 */ 250 bool BondedParticle::IsBondedTo( BondedParticle * const BondPartner)253 bool BondedParticle::IsBondedTo(const unsigned int _step, BondedParticle * const BondPartner) const 251 254 { 252 255 bool status = false; 253 256 254 const BondList& ListOfBonds = getListOfBonds(); 255 for (BondList::const_iterator runner = ListOfBonds.begin(); runner != ListOfBonds.end(); runner++) { 257 const BondList& ListOfBonds = getListOfBondsAtStep(_step); 258 for (BondList::const_iterator runner = ListOfBonds.begin(); 259 runner != ListOfBonds.end(); 260 runner++) { 256 261 status = status || ((*runner)->Contains(BondPartner)); 257 262 } -
src/atom_bondedparticle.hpp
rd557374 r073a9e4 37 37 virtual ~BondedParticle(); 38 38 39 void addBond( BondedParticle* Partner);40 bool RegisterBond( bond *Binder);39 void addBond(const unsigned int _step, BondedParticle* Partner); 40 bool RegisterBond(const unsigned int _step, bond *Binder); 41 41 bool UnregisterBond(bond *Binder); 42 bool IsBondedTo( BondedParticle * const BondPartner);42 bool IsBondedTo(const unsigned int _step, BondedParticle * const BondPartner) const; 43 43 void UnregisterAllBond(const unsigned int _step); 44 44 int CountBonds() const; -
src/molecule.cpp
rd557374 r073a9e4 728 728 729 729 Binder = new bond(atom1, atom2, degree, BondCount++); 730 atom1->RegisterBond( Binder);731 atom2->RegisterBond( Binder);730 atom1->RegisterBond(WorldTime::getTime(), Binder); 731 atom2->RegisterBond(WorldTime::getTime(), Binder); 732 732 if ((atom1->getType() != NULL) && (atom1->getType()->getAtomicNumber() != 1) && (atom2->getType() != NULL) && (atom2->getType()->getAtomicNumber() != 1)) 733 733 NoNonBonds++; … … 737 737 738 738 /** Remove bond from bond chain list and from the both atom::ListOfBonds. 739 * \todo Function not implemented yet739 * Bond::~Bond takes care of bond removal 740 740 * \param *pointer bond pointer 741 741 * \return true - bound found and removed, false - bond not found/removed -
src/unittests/BondGraphUnitTest.cpp
rd557374 r073a9e4 30 30 #include "CodePatterns/Assert.hpp" 31 31 32 #include "World.hpp"33 32 #include "atom.hpp" 34 33 #include "bond.hpp" … … 39 38 #include "periodentafel.hpp" 40 39 #include "World.hpp" 40 #include "WorldTime.hpp" 41 41 42 42 #include "BondGraphUnitTest.hpp" … … 148 148 CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(test) ); 149 149 CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) ); 150 CPPUNIT_ASSERT_EQUAL( true , (*Walker)->IsBondedTo( (*Runner)) );150 CPPUNIT_ASSERT_EQUAL( true , (*Walker)->IsBondedTo(WorldTime::getTime(), (*Runner)) ); 151 151 }; 152 152
Note:
See TracChangeset
for help on using the changeset viewer.