Changeset b70721
- Timestamp:
- Oct 30, 2009, 9:05:30 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:
- b21a64
- Parents:
- 46ea3b
- git-author:
- Frederik Heber <heber@…> (10/30/09 08:30:57)
- git-committer:
- Frederik Heber <heber@…> (10/30/09 09:05:30)
- Location:
- src
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
r46ea3b rb70721 2 2 ATOMHEADER = atom.hpp atom_atominfo.hpp atom_bondedparticle.hpp atom_bondedparticleinfo.hpp atom_graphnode.hpp atom_graphnodeinfo.hpp atom_particleinfo.hpp atom_trajectoryparticle.hpp atom_trajectoryparticleinfo.hpp 3 3 4 SOURCE = analysis_correlation.cpp ${ATOMSOURCE} bond.cpp bo undary.cpp config.cpp element.cpp ellipsoid.cpp graph.cpp helpers.cpp leastsquaremin.cpp linkedcell.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp5 HEADER = analysis_correlation.hpp ${ATOMHEADER} bond.hpp bo undary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp graph.hpp helpers.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp4 SOURCE = analysis_correlation.cpp ${ATOMSOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp graph.cpp helpers.cpp leastsquaremin.cpp linkedcell.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp 5 HEADER = analysis_correlation.hpp ${ATOMHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp graph.hpp helpers.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp 6 6 7 7 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) -
src/atom_bondedparticle.cpp
r46ea3b rb70721 151 151 }; 152 152 153 /** Checks whether there is a bond between \a this atom and the given \a *BondPartner. 154 * \param *BondPartner atom to check for 155 * \return true - bond exists, false - bond does not exist 156 */ 157 bool BondedParticle::IsBondedTo(BondedParticle * const BondPartner) 158 { 159 bool status = false; 160 161 for (BondList::iterator runner = ListOfBonds.begin(); runner != ListOfBonds.end(); runner++) { 162 status = status || ((*runner)->Contains(BondPartner)); 163 } 164 return status; 165 }; 166 -
src/atom_bondedparticle.hpp
r46ea3b rb70721 39 39 bool RegisterBond(bond *Binder); 40 40 bool UnregisterBond(bond *Binder); 41 bool IsBondedTo(BondedParticle * const BondPartner); 41 42 void UnregisterAllBond(); 42 43 int CountBonds() const; -
src/builder.cpp
r46ea3b rb70721 53 53 #include "atom.hpp" 54 54 #include "bond.hpp" 55 #include "bondgraph.hpp" 55 56 #include "boundary.hpp" 56 57 #include "config.hpp" … … 840 841 } 841 842 if (mol->first->next != mol->last) // if connect matrix is present already, redo it 842 mol->CreateAdjacencyList((ofstream *)&cout, mol->BondDistance, configuration->GetIsAngstroem() );843 mol->CreateAdjacencyList((ofstream *)&cout, mol->BondDistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 843 844 // free memory 844 845 delete[](Elements); … … 896 897 cin >> bonddistance; 897 898 start = clock(); 898 mol->CreateAdjacencyList((ofstream *)&cout, bonddistance, configuration->GetIsAngstroem() );899 mol->CreateAdjacencyList((ofstream *)&cout, bonddistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 899 900 end = clock(); 900 901 cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl; … … 1555 1556 class StackClass<bond *> *BackEdgeStack = NULL; 1556 1557 class StackClass<bond *> *LocalBackEdgeStack = NULL; 1557 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr]), configuration.GetIsAngstroem() );1558 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 1558 1559 Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack); 1559 1560 if (Subgraphs != NULL) { … … 1912 1913 cout << Verbose(0) << "Creating connection matrix..." << endl; 1913 1914 start = clock(); 1914 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr++]), configuration.GetIsAngstroem() );1915 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr++]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 1915 1916 cout << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl; 1916 1917 if (mol->first->next != mol->last) { -
src/molecule.hpp
r46ea3b rb70721 35 35 class atom; 36 36 class bond; 37 class BondedParticle; 38 class BondGraph; 37 39 class element; 38 40 class ForceMatrix; … … 238 240 /// Initialising routines in fragmentation 239 241 void CreateAdjacencyListFromDbondFile(ofstream *out, ifstream *output); 240 void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem );242 void CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem, void (BondGraph::*f)(BondedParticle * const , BondedParticle * const , double &, double &, bool), BondGraph *BG = NULL); 241 243 int CorrectBondDegree(ofstream *out); 242 244 void OutputBondsList(ofstream *out); -
src/molecule_graph.cpp
r46ea3b rb70721 8 8 #include "atom.hpp" 9 9 #include "bond.hpp" 10 #include "bondgraph.hpp" 10 11 #include "config.hpp" 11 12 #include "element.hpp" … … 92 93 * \param bonddistance length of linked cells (i.e. maximum minimal length checked) 93 94 * \param IsAngstroem whether coordinate system is gauged to Angstroem or Bohr radii 94 */ 95 void molecule::CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem) 96 { 97 95 * \param *minmaxdistance function to give upper and lower bound on whether particle is bonded to some other 96 * \param *BG BondGraph with the member function above or NULL, if just standard covalent should be used. 97 */ 98 void molecule::CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem, void (BondGraph::*minmaxdistance)(BondedParticle * const , BondedParticle * const , double &, double &, bool), BondGraph *BG) 99 { 98 100 atom *Walker = NULL; 99 101 atom *OtherWalker = NULL; 100 102 atom **AtomMap = NULL; 101 103 int n[NDIM]; 102 double distance,MinDistance, MaxDistance;104 double MinDistance, MaxDistance; 103 105 LinkedCell *LC = NULL; 106 bool free_BG = false; 107 108 if (BG == NULL) { 109 BG = new BondGraph(IsAngstroem); 110 free_BG = true; 111 } 104 112 105 113 BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem); … … 146 154 OtherWalker = AtomMap[(*OtherRunner)->nr]; 147 155 //*out << Verbose(1) << "Checking distance " << OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size) << " against typical bond length of " << bonddistance*bonddistance << "." << endl; 148 MinDistance = OtherWalker->type->CovalentRadius + Walker->type->CovalentRadius; 149 MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem; 150 MaxDistance = MinDistance + BONDTHRESHOLD; 151 MinDistance -= BONDTHRESHOLD; 152 distance = OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size); 153 if ((OtherWalker->father->nr > Walker->father->nr) && (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance)) { // create bond if distance is smaller 156 (BG->*minmaxdistance)(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem); 157 const double distance = OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size); 158 const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance); 159 if ((OtherWalker->father->nr > Walker->father->nr) && (status)) { // create bond if distance is smaller 154 160 //*out << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl; 155 161 AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount … … 176 182 *out << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl; 177 183 *out << Verbose(0) << "End of CreateAdjacencyList." << endl; 184 if (free_BG) 185 delete(BG); 178 186 } 179 187 ; -
src/unittests/Makefile.am
r46ea3b rb70721 20 20 AnalysisPairCorrelationUnitTest_LDADD = ../libmolecuilder.a 21 21 22 BondGraphUnitTest_SOURCES = ../bondgraph.cpp ../bondgraph.hppbondgraphunittest.cpp bondgraphunittest.hpp22 BondGraphUnitTest_SOURCES = bondgraphunittest.cpp bondgraphunittest.hpp 23 23 BondGraphUnitTest_LDADD = ../libmolecuilder.a 24 24
Note:
See TracChangeset
for help on using the changeset viewer.