forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14148 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
3830813864
commit
50733f2482
|
@ -354,7 +354,6 @@ void FixShake::init()
|
||||||
|
|
||||||
// set equilibrium angle distances
|
// set equilibrium angle distances
|
||||||
|
|
||||||
const double b1,b2;
|
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
for (i = 1; i <= atom->nangletypes; i++) {
|
for (i = 1; i <= atom->nangletypes; i++) {
|
||||||
|
@ -408,8 +407,8 @@ void FixShake::init()
|
||||||
// formula is now correct for bonds of same or different lengths (Oct15)
|
// formula is now correct for bonds of same or different lengths (Oct15)
|
||||||
|
|
||||||
angle = force->angle->equilibrium_angle(i);
|
angle = force->angle->equilibrium_angle(i);
|
||||||
b1 = bond_distance[bond1_type];
|
const double b1 = bond_distance[bond1_type];
|
||||||
b2 = bond_distance[bond2_type];
|
const double b2 = bond_distance[bond2_type];
|
||||||
rsq = b1*b1 + b2*b2 - 2.0*b1*b2*cos(angle);
|
rsq = b1*b1 + b2*b2 - 2.0*b1*b2*cos(angle);
|
||||||
angle_distance[i] = sqrt(rsq);
|
angle_distance[i] = sqrt(rsq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -456,6 +456,14 @@ void Output::reset_timestep(bigint ntimestep)
|
||||||
next_dump[idump] = (ntimestep/every_dump[idump])*every_dump[idump];
|
next_dump[idump] = (ntimestep/every_dump[idump])*every_dump[idump];
|
||||||
if (next_dump[idump] < ntimestep) next_dump[idump] += every_dump[idump];
|
if (next_dump[idump] < ntimestep) next_dump[idump] += every_dump[idump];
|
||||||
} else {
|
} else {
|
||||||
|
// ivar_dump may not be initialized
|
||||||
|
if (ivar_dump[idump] < 0) {
|
||||||
|
ivar_dump[idump] = input->variable->find(var_dump[idump]);
|
||||||
|
if (ivar_dump[idump] < 0)
|
||||||
|
error->all(FLERR,"Variable name for dump every does not exist");
|
||||||
|
if (!input->variable->equalstyle(ivar_dump[idump]))
|
||||||
|
error->all(FLERR,"Variable for dump every is invalid style");
|
||||||
|
}
|
||||||
modify->clearstep_compute();
|
modify->clearstep_compute();
|
||||||
update->ntimestep--;
|
update->ntimestep--;
|
||||||
bigint nextdump = static_cast<bigint>
|
bigint nextdump = static_cast<bigint>
|
||||||
|
@ -561,6 +569,13 @@ void Output::add_dump(int narg, char **arg)
|
||||||
memory->grow(ivar_dump,max_dump,"output:ivar_dump");
|
memory->grow(ivar_dump,max_dump,"output:ivar_dump");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initialize per-dump data to suitable default values
|
||||||
|
|
||||||
|
every_dump[ndump] = 0;
|
||||||
|
last_dump[ndump] = -1;
|
||||||
|
var_dump[ndump] = NULL;
|
||||||
|
ivar_dump[ndump] = -1;
|
||||||
|
|
||||||
// create the Dump
|
// create the Dump
|
||||||
|
|
||||||
if (0) return; // dummy line to enable else-if macro expansion
|
if (0) return; // dummy line to enable else-if macro expansion
|
||||||
|
|
Loading…
Reference in New Issue