git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3481 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -33,8 +33,6 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
|
||||
{
|
||||
if (narg < 5) error->all("Illegal fix gravity command");
|
||||
|
||||
time_depend = 1;
|
||||
|
||||
magnitude = atof(arg[3]);
|
||||
|
||||
if (strcmp(arg[4],"chute") == 0) {
|
||||
@ -88,8 +86,6 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
|
||||
zgrav = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
time_initial = update->ntimestep;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -138,15 +134,15 @@ void FixGravity::post_force(int vflag)
|
||||
if (style == GRADIENT) {
|
||||
if (domain->dimension == 3) {
|
||||
double phi_current = degree2rad *
|
||||
(phi + (update->ntimestep-time_initial)*dt*phigrad*360.0);
|
||||
(phi + (update->ntimestep-update->beginstep)*dt*phigrad*360.0);
|
||||
double theta_current = degree2rad *
|
||||
(theta + (update->ntimestep-time_initial)*dt*thetagrad*360.0);
|
||||
(theta + (update->ntimestep-update->beginstep)*dt*thetagrad*360.0);
|
||||
xgrav = sin(theta_current) * cos(phi_current);
|
||||
ygrav = sin(theta_current) * sin(phi_current);
|
||||
zgrav = cos(theta_current);
|
||||
} else {
|
||||
double theta_current = degree2rad *
|
||||
(theta + (update->ntimestep-time_initial)*dt*thetagrad*360.0);
|
||||
(theta + (update->ntimestep-update->beginstep)*dt*thetagrad*360.0);
|
||||
xgrav = sin(theta_current);
|
||||
ygrav = cos(theta_current);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user