Ignore:
Timestamp:
Oct 6, 2009, 5:57:01 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
567b7f
Parents:
a4644b
Message:

More functions of molecule now use templated iterators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/atom.cpp

    ra4644b r8ffe32  
    102102};
    103103
     104/** Checks whether atom is within the given box.
     105 * \param offset offset to box origin
     106 * \param *parallelepiped box matrix
     107 * \return true - is inside, false - is not
     108 */
     109bool atom::IsInParallelepiped(Vector offset, double *parallelepiped)
     110{
     111  return (node->IsInParallelepiped(offset, parallelepiped));
     112};
     113
    104114/** Output of a single atom.
    105115 * \param ElementNo cardinal number of the element
     
    112122  if (out != NULL) {
    113123    *out << "Ion_Type" << ElementNo << "_" << AtomNo << "\t"  << fixed << setprecision(9) << showpoint;
     124    *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2];
     125    *out << "\t" << FixedIon;
     126    if (v.Norm() > MYEPSILON)
     127      *out << "\t" << scientific << setprecision(6) << v.x[0] << "\t" << v.x[1] << "\t" << v.x[2] << "\t";
     128    if (comment != NULL)
     129      *out << " # " << comment << endl;
     130    else
     131      *out << " # molecule nr " << nr << endl;
     132    return true;
     133  } else
     134    return false;
     135};
     136bool atom::Output(int *ElementNo, int *AtomNo, ofstream *out, const char *comment)
     137{
     138  AtomNo[type->Z]++;  // increment number
     139  if (out != NULL) {
     140    *out << "Ion_Type" << ElementNo[type->Z] << "_" << AtomNo[type->Z] << "\t"  << fixed << setprecision(9) << showpoint;
    114141    *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2];
    115142    *out << "\t" << FixedIon;
Note: See TracChangeset for help on using the changeset viewer.