git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12938 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2015-01-14 16:22:39 +00:00
parent 415997f215
commit db7aa98b6e
2 changed files with 13 additions and 14 deletions

View File

@ -162,8 +162,8 @@ void FixSRP::setup_pre_force(int zz)
xold[i][2] = x[i][2]; xold[i][2] = x[i][2];
} }
int *tag = atom->tag; tagint *tag = atom->tag;
int tagold[nall]; tagint tagold[nall];
for(int i = 0; i < nall; i++){ for(int i = 0; i < nall; i++){
tagold[i]=tag[i]; tagold[i]=tag[i];

View File

@ -241,17 +241,16 @@ void Region::inverse_transform(double &x, double &y, double &z)
rotate x,y,z by angle via right-hand rule around point and runit normal rotate x,y,z by angle via right-hand rule around point and runit normal
sign of angle determines whether rotating forward/backward in time sign of angle determines whether rotating forward/backward in time
return updated x,y,z return updated x,y,z
P = point = vector = point of rotation R = vector axis of rotation
R = vector = axis of rotation P = point = point to rotate around
w = omega of rotation (from period)
X0 = x,y,z = initial coord of atom
R0 = runit = unit vector for R R0 = runit = unit vector for R
C = (X0 dot R0) R0 = projection of atom coord onto R X0 = x,y,z = initial coord of atom
D = X0 - P = vector from P to X0 D = X0 - P = vector from P to X0
A = D - C = vector from R line to X0 C = (D dot R0) R0 = projection of D onto R, i.e. Dparallel
B = R0 cross A = vector perp to A in plane of rotation A = D - C = vector from R line to X0, i.e. Dperp
B = R0 cross A = vector perp to A in plane of rotation, same len as A
A,B define plane of circular rotation around R line A,B define plane of circular rotation around R line
x,y,z = P + C + A cos(w*dt) + B sin(w*dt) new x,y,z = P + C + A cos(angle) + B sin(angle)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void Region::rotate(double &x, double &y, double &z, double angle) void Region::rotate(double &x, double &y, double &z, double angle)
@ -260,13 +259,13 @@ void Region::rotate(double &x, double &y, double &z, double angle)
double sine = sin(angle); double sine = sin(angle);
double cosine = cos(angle); double cosine = cos(angle);
double x0dotr = x*runit[0] + y*runit[1] + z*runit[2];
c[0] = x0dotr * runit[0];
c[1] = x0dotr * runit[1];
c[2] = x0dotr * runit[2];
d[0] = x - point[0]; d[0] = x - point[0];
d[1] = y - point[1]; d[1] = y - point[1];
d[2] = z - point[2]; d[2] = z - point[2];
double x0dotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2];
c[0] = x0dotr * runit[0];
c[1] = x0dotr * runit[1];
c[2] = x0dotr * runit[2];
a[0] = d[0] - c[0]; a[0] = d[0] - c[0];
a[1] = d[1] - c[1]; a[1] = d[1] - c[1];
a[2] = d[2] - c[2]; a[2] = d[2] - c[2];