Changeset f714979 for src/molecules.cpp
- Timestamp:
- Dec 8, 2008, 2:16:34 PM (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, 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:
- caf5d6
- Parents:
- a8bcea6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecules.cpp
ra8bcea6 rf714979 1677 1677 1678 1678 /** Creates an adjacency list of the molecule. 1679 * We obtain an outside file with the indices of atoms which are bondmembers. 1680 */ 1681 void molecule::CreateAdjacencyList2(ofstream *out, ifstream *input) 1682 { 1683 1684 // 1 We will parse bonds out of the dbond file created by tremolo. 1685 int atom1, atom2, temp; 1686 atom *Walker, *OtherWalker; 1687 1688 if (!input) 1689 { 1690 cout << Verbose(1) << "Opening silica failed \n"; 1691 }; 1692 1693 *input >> ws >> atom1; 1694 *input >> ws >> atom2; 1695 cout << Verbose(1) << "Scanning file\n"; 1696 while (!input->eof()) // Check whether we read everything already 1697 { 1698 *input >> ws >> atom1; 1699 *input >> ws >> atom2; 1700 if(atom2<atom1) //Sort indices of atoms in order 1701 { 1702 temp=atom1; 1703 atom1=atom2; 1704 atom2=temp; 1705 }; 1706 1707 Walker=start; 1708 while(Walker-> nr != atom1) // Find atom corresponding to first index 1709 { 1710 Walker = Walker->next; 1711 }; 1712 OtherWalker = Walker->next; 1713 while(OtherWalker->nr != atom2) // Find atom corresponding to second index 1714 { 1715 OtherWalker= OtherWalker->next; 1716 }; 1717 AddBond(Walker, OtherWalker); //Add the bond between the two atoms with respective indices. 1718 BondCount++; //Increase bond count of molecule 1719 } 1720 1721 CreateListOfBondsPerAtom(out); 1722 1723 }; 1724 1725 1726 /** Creates an adjacency list of the molecule. 1679 1727 * Generally, we use the CSD approach to bond recognition, that is the the distance 1680 1728 * between two atoms A and B must be within [Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t] with … … 1694 1742 * \param IsAngstroem whether coordinate system is gauged to Angstroem or Bohr radii 1695 1743 */ 1696 void molecule::CreateAdjacencyList2(ofstream *out, ifstream *input)// ofstream* out, double bonddistance, bool IsAngstroem)1697 {1698 1699 // 1 We will parse bonds out of the dbond file created by tremolo.1700 int atom1, atom2, temp;1701 atom *Walker, *OtherWalker;1702 1703 if (!input)1704 {1705 cout << Verbose(1) << "Opening silica failed \n";1706 };1707 1708 *input >> ws >> atom1;1709 *input >> ws >> atom2;1710 cout << Verbose(1) << "Scanning file\n";1711 while (!input->eof()) // Check whether we read 2 items1712 {1713 *input >> ws >> atom1;1714 *input >> ws >> atom2;1715 if(atom2<atom1) //Sort indizes of atoms in order1716 {1717 temp=atom1;1718 atom1=atom2;1719 atom2=temp;1720 };1721 1722 Walker=start;1723 while(Walker-> nr != atom1) // Find atom corresponding to first index1724 {1725 Walker = Walker->next;1726 };1727 OtherWalker = Walker->next;1728 while(OtherWalker->nr != atom2) // Find atom corresponding to second index1729 {1730 OtherWalker= OtherWalker->next;1731 };1732 AddBond(Walker, OtherWalker); //Add the bond between the two atoms with respective indices.1733 BondCount++; //Increase bond count of molecule1734 }1735 1736 CreateListOfBondsPerAtom(out);1737 1738 };1739 1744 void molecule::CreateAdjacencyList(ofstream *out, double bonddistance, bool IsAngstroem) 1740 1745 {
Note:
See TracChangeset
for help on using the changeset viewer.