Changeset 70b7aa for molecuilder
- Timestamp:
- Oct 7, 2009, 2:29:57 PM (16 years ago)
- Children:
- 17b3a5c
- Parents:
- 972706
- git-author:
- Frederik Heber <heber@…> (10/07/09 14:26:53)
- git-committer:
- Frederik Heber <heber@…> (10/07/09 14:29:57)
- Location:
- molecuilder/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/atom.cpp
r972706 r70b7aa 6 6 7 7 #include "atom.hpp" 8 #include "bond.hpp" 8 9 #include "memoryallocator.hpp" 9 10 … … 120 121 * \param *out stream to output to 121 122 * \param *comment commentary after '#' sign 123 * \return true - \a *out present, false - \a *out is NULL 122 124 */ 123 125 bool atom::Output(ofstream *out, int ElementNo, int AtomNo, const char *comment) const … … 157 159 /** Output of a single atom as one lin in xyz file. 158 160 * \param *out stream to output to 161 * \return true - \a *out present, false - \a *out is NULL 159 162 */ 160 163 bool atom::OutputXYZLine(ofstream *out) const … … 169 172 /** Output of a single atom as one lin in xyz file. 170 173 * \param *out stream to output to 174 * \param *ElementNo array with ion type number in the config file this atom's element shall have 175 * \param *AtomNo array with atom number in the config file this atom shall have, is increase by one automatically 176 * \param step Trajectory time step to output 177 * \return true - \a *out present, false - \a *out is NULL 171 178 */ 172 179 bool atom::OutputTrajectory(ofstream *out, int *ElementNo, int *AtomNo, int step) const … … 189 196 /** Output of a single atom as one lin in xyz file. 190 197 * \param *out stream to output to 198 * \param step Trajectory time step to output 199 * \return true - \a *out present, false - \a *out is NULL 191 200 */ 192 201 bool atom::OutputTrajectoryXYZ(ofstream *out, int step) const … … 202 211 }; 203 212 213 /** Prints all bonds of this atom from given global lists. 214 * \param *out stream to output to 215 * \param *NumberOfBondsPerAtom array with number of bonds per atomic index 216 * \param ***ListOfBondsPerAtom array per atomic index of array with pointer to bond 217 * \return true - \a *out present, false - \a *out is NULL 218 */ 219 bool atom::OutputBondOfAtom(ofstream *out, int *NumberOfBondsPerAtom, bond ***ListOfBondsPerAtom) const 220 { 221 if (out != NULL) { 222 *out << Verbose(4) << "Atom " << Name << "/" << nr << " with " << NumberOfBondsPerAtom[nr] << " bonds: "; 223 int TotalDegree = 0; 224 for (int j=0;j<NumberOfBondsPerAtom[nr];j++) { 225 *out << *ListOfBondsPerAtom[nr][j] << "\t"; 226 TotalDegree += ListOfBondsPerAtom[nr][j]->BondDegree; 227 } 228 *out << " -- TotalDegree: " << TotalDegree << endl; 229 return true; 230 } else 231 return false; 232 }; 233 204 234 ostream & operator << (ostream &ost, const atom &a) 205 235 { -
molecuilder/src/atom.hpp
r972706 r70b7aa 23 23 #include "tesselation.hpp" 24 24 #include "vector.hpp" 25 26 class bond; 25 27 26 28 /** Single atom. … … 65 67 bool OutputTrajectory(ofstream *out, int *ElementNo, int *AtomNo, int step) const; 66 68 bool OutputTrajectoryXYZ(ofstream *out, int step) const; 69 bool OutputBondOfAtom(ofstream *out, int *NumberOfBondsPerAtom, bond ***ListOfBondsPerAtom) const; 67 70 68 71 void EqualsFather ( atom *ptr, atom **res ); -
molecuilder/src/bond.cpp
r972706 r70b7aa 5 5 */ 6 6 7 #include "atom.hpp" 7 8 #include "bond.hpp" 8 9 -
molecuilder/src/bond.hpp
r972706 r70b7aa 16 16 #endif 17 17 18 #include "atom.hpp" 18 class atom; 19 19 20 20 /** Bonds between atoms. -
molecuilder/src/molecule.cpp
r972706 r70b7aa 734 734 bool molecule::OutputTrajectories(ofstream *out) 735 735 { 736 atom *walker = NULL;737 736 int ElementNo[MAX_ELEMENTS], AtomNo[MAX_ELEMENTS]; 738 737 CountElements(); … … 799 798 bool molecule::OutputTrajectoriesXYZ(ofstream *out) 800 799 { 801 int No = 0;802 800 time_t now; 803 801 … … 818 816 bool molecule::OutputXYZ(ofstream *out) const 819 817 { 820 atom *walker = NULL;821 int AtomNo = 0;822 818 time_t now; 823 819 … … 918 914 { 919 915 bond *Binder = NULL; 920 atom *Walker = NULL;921 int TotalDegree;922 916 *out << Verbose(1) << "Begin of Creating ListOfBondsPerAtom: AtomCount = " << AtomCount << "\tBondCount = " << BondCount << "\tNoNonBonds = " << NoNonBonds << "." << endl; 923 917 … … 960 954 // output list for debugging 961 955 *out << Verbose(3) << "ListOfBondsPerAtom for each atom:" << endl; 962 Walker = start; 963 while (Walker->next != end) { 964 Walker = Walker->next; 965 *out << Verbose(4) << "Atom " << Walker->Name << "/" << Walker->nr << " with " << NumberOfBondsPerAtom[Walker->nr] << " bonds: "; 966 TotalDegree = 0; 967 for (int j=0;j<NumberOfBondsPerAtom[Walker->nr];j++) { 968 *out << *ListOfBondsPerAtom[Walker->nr][j] << "\t"; 969 TotalDegree += ListOfBondsPerAtom[Walker->nr][j]->BondDegree; 970 } 971 *out << " -- TotalDegree: " << TotalDegree << endl; 972 } 956 ActOnAllAtoms( &atom::OutputBondOfAtom, out, NumberOfBondsPerAtom, ListOfBondsPerAtom ); 957 973 958 *out << Verbose(1) << "End of Creating ListOfBondsPerAtom." << endl << endl; 974 959 }; 975 976 960 977 961 /** Blows the 6-dimensional \a cell_size array up to a full NDIM by NDIM matrix.
Note:
See TracChangeset
for help on using the changeset viewer.
