Changeset 0fc0b5 for molecuilder/src/molecules.cpp
- Timestamp:
- Aug 7, 2009, 9:13:21 AM (16 years ago)
- Children:
- ef5521
- Parents:
- 8f9a8e
- File:
-
- 1 edited
-
molecuilder/src/molecules.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.cpp
r8f9a8e r0fc0b5 741 741 delete(Minv); 742 742 delete(Center); 743 return status; 744 }; 745 746 747 /** Bounds the molecule in the box whose lengths are defined by vector \a *BoxLengths. 748 * \param *out output stream for debugging 749 */ 750 bool molecule::BoundInBox(ofstream *out) 751 { 752 bool status = true; 753 Vector x; 754 double *M = ReturnFullMatrixforSymmetric(cell_size); 755 double *Minv = x.InverseMatrix(M); 756 757 // go through all atoms 758 atom *ptr = start; // start at first in list 759 while (ptr->next != end) { // continue with second if present 760 ptr = ptr->next; 761 //ptr->Output(1,1,out); 762 // multiply its vector with matrix inverse 763 x.CopyVector(&ptr->x); 764 x.MatrixMultiplication(Minv); 765 // truncate to [0,1] for each axis 766 for (int i=0;i<NDIM;i++) { 767 while (x.x[i] >= 1.) 768 x.x[i] -= 1.; 769 while (x.x[i] < 0.) 770 x.x[i] += 1.; 771 } 772 x.MatrixMultiplication(M); 773 ptr->x.CopyVector(&x); 774 } 775 delete(M); 776 delete(Minv); 743 777 return status; 744 778 };
Note:
See TracChangeset
for help on using the changeset viewer.
