Changeset 735468 for molecuilder/src/molecules.cpp
- Timestamp:
- Dec 8, 2008, 2:16:34 PM (17 years ago)
- Children:
- 5a447f
- Parents:
- db177a
- File:
-
- 1 edited
-
molecuilder/src/molecules.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.cpp
rdb177a r735468 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.
