forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2997 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
08577f42a7
commit
10de982002
|
@ -270,8 +270,6 @@ void FixNPH::init()
|
||||||
pressure = modify->compute[icompute];
|
pressure = modify->compute[icompute];
|
||||||
|
|
||||||
// set timesteps and frequencies
|
// set timesteps and frequencies
|
||||||
// Nkt = initial value for piston mass and energy conservation
|
|
||||||
// guesstimate a unit-dependent t_initial if actual T = 0.0
|
|
||||||
|
|
||||||
dtv = update->dt;
|
dtv = update->dt;
|
||||||
dtf = 0.5 * update->dt * force->ftm2v;
|
dtf = 0.5 * update->dt * force->ftm2v;
|
||||||
|
@ -287,14 +285,6 @@ void FixNPH::init()
|
||||||
if (dimension == 3) vol0 = domain->xprd * domain->yprd * domain->zprd;
|
if (dimension == 3) vol0 = domain->xprd * domain->yprd * domain->zprd;
|
||||||
else vol0 = domain->xprd * domain->yprd;
|
else vol0 = domain->xprd * domain->yprd;
|
||||||
|
|
||||||
temperature->init(); // not yet called by Modify::init()
|
|
||||||
double t_initial = temperature->compute_scalar();
|
|
||||||
if (t_initial == 0.0) {
|
|
||||||
if (strcmp(update->unit_style,"lj") == 0) t_initial = 1.0;
|
|
||||||
else t_initial = 300.0;
|
|
||||||
}
|
|
||||||
nkt = atom->natoms * boltz * t_initial;
|
|
||||||
|
|
||||||
if (force->kspace) kspace_flag = 1;
|
if (force->kspace) kspace_flag = 1;
|
||||||
else kspace_flag = 0;
|
else kspace_flag = 0;
|
||||||
|
|
||||||
|
@ -326,6 +316,18 @@ void FixNPH::init()
|
||||||
|
|
||||||
void FixNPH::setup(int vflag)
|
void FixNPH::setup(int vflag)
|
||||||
{
|
{
|
||||||
|
// Nkt = initial value for piston mass and energy conservation
|
||||||
|
// cannot be done in init() b/c temperature cannot be called there
|
||||||
|
// is b/c Modify::init() inits computes after fixes due to dof dependence
|
||||||
|
// guesstimate a unit-dependent t_initial if actual T = 0.0
|
||||||
|
|
||||||
|
double t_initial = temperature->compute_scalar();
|
||||||
|
if (t_initial == 0.0) {
|
||||||
|
if (strcmp(update->unit_style,"lj") == 0) t_initial = 1.0;
|
||||||
|
else t_initial = 300.0;
|
||||||
|
}
|
||||||
|
nkt = atom->natoms * boltz * t_initial;
|
||||||
|
|
||||||
p_target[0] = p_start[0]; // used by compute_scalar()
|
p_target[0] = p_start[0]; // used by compute_scalar()
|
||||||
p_target[1] = p_start[1];
|
p_target[1] = p_start[1];
|
||||||
p_target[2] = p_start[2];
|
p_target[2] = p_start[2];
|
||||||
|
|
|
@ -99,9 +99,6 @@ void FixTempRescale::init()
|
||||||
|
|
||||||
if (temperature->tempbias) which = BIAS;
|
if (temperature->tempbias) which = BIAS;
|
||||||
else which = NOBIAS;
|
else which = NOBIAS;
|
||||||
|
|
||||||
temperature->init(); // not yet called by Modify::init()
|
|
||||||
efactor = (0.5 * force->boltz * temperature->dof);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
@ -121,6 +118,7 @@ void FixTempRescale::end_of_step()
|
||||||
if (fabs(t_current-t_target) > t_window) {
|
if (fabs(t_current-t_target) > t_window) {
|
||||||
t_target = t_current - fraction*(t_current-t_target);
|
t_target = t_current - fraction*(t_current-t_target);
|
||||||
double factor = sqrt(t_target/t_current);
|
double factor = sqrt(t_target/t_current);
|
||||||
|
double efactor = 0.5 * force->boltz * temperature->dof;
|
||||||
|
|
||||||
double **v = atom->v;
|
double **v = atom->v;
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
|
|
|
@ -187,7 +187,7 @@ void Modify::init()
|
||||||
restart_pbc_any = 0;
|
restart_pbc_any = 0;
|
||||||
for (i = 0; i < nfix; i++)
|
for (i = 0; i < nfix; i++)
|
||||||
if (fix[i]->restart_pbc) restart_pbc_any = 1;
|
if (fix[i]->restart_pbc) restart_pbc_any = 1;
|
||||||
|
|
||||||
// create list of computes that store invocation times
|
// create list of computes that store invocation times
|
||||||
|
|
||||||
list_init_compute();
|
list_init_compute();
|
||||||
|
|
Loading…
Reference in New Issue