Changeset c95b69 for molecuilder
- Timestamp:
- Jul 10, 2009, 9:19:23 PM (16 years ago)
- Children:
- a048fa
- Parents:
- 88b936
- File:
-
- 1 edited
-
molecuilder/src/molecules.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecules.cpp
r88b936 rc95b69 853 853 // go through all atoms 854 854 ptr = start->next; // start at first in list 855 if (ptr != end) { //list not empty? 856 while (ptr->next != end) { // continue with second if present 857 ptr = ptr->next; 858 //ptr->Output(1,1,out); 859 // multiply its vector with matrix inverse 860 x.CopyVector(&ptr->x); 855 while (ptr != end) { // continue with second if present 856 //ptr->Output(1,1,out); 857 // multiply its vector with matrix inverse 858 x.CopyVector(&ptr->x); 859 x.Translate(trans); 860 x.MatrixMultiplication(Minv); 861 // truncate to [0,1] for each axis 862 for (int i=0;i<NDIM;i++) { 863 value = floor(fabs(x.x[i])); // next lower integer 864 if (x.x[i] >=0) { 865 x.x[i] -= value; 866 } else { 867 x.x[i] += value+1; 868 } 869 } 870 // matrix multiply 871 x.MatrixMultiplication(M); 872 ptr->x.CopyVector(&x); 873 for (int j=0;j<MDSteps;j++) { 874 x.CopyVector(&Trajectories[ptr].R.at(j)); 861 875 x.Translate(trans); 862 876 x.MatrixMultiplication(Minv); 863 877 // truncate to [0,1] for each axis 864 878 for (int i=0;i<NDIM;i++) { 865 value = floor( fabs(x.x[i])); // next lower integer879 value = floor(x.x[i]); // next lower integer 866 880 if (x.x[i] >=0) { 867 881 x.x[i] -= value; … … 872 886 // matrix multiply 873 887 x.MatrixMultiplication(M); 874 ptr->x.CopyVector(&x); 875 for (int j=0;j<MDSteps;j++) { 876 x.CopyVector(&Trajectories[ptr].R.at(j)); 877 x.Translate(trans); 878 x.MatrixMultiplication(Minv); 879 // truncate to [0,1] for each axis 880 for (int i=0;i<NDIM;i++) { 881 value = floor(x.x[i]); // next lower integer 882 if (x.x[i] >=0) { 883 x.x[i] -= value; 884 } else { 885 x.x[i] += value+1; 886 } 887 } 888 // matrix multiply 889 x.MatrixMultiplication(M); 890 Trajectories[ptr].R.at(j).CopyVector(&x); 891 } 888 Trajectories[ptr].R.at(j).CopyVector(&x); 892 889 } 890 ptr = ptr->next; 893 891 } 894 892 delete(M);
Note:
See TracChangeset
for help on using the changeset viewer.
