git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@147 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -102,8 +102,7 @@ void Output::setup(int flag)
|
|||||||
{
|
{
|
||||||
int ntimestep = update->ntimestep;
|
int ntimestep = update->ntimestep;
|
||||||
|
|
||||||
// perform dump at start of run if multiple of every
|
// perform dump at start of run if last dump was not on this timestep
|
||||||
// and last dump was not on this timestep
|
|
||||||
// set next_dump to multiple of every
|
// set next_dump to multiple of every
|
||||||
// will not write on last step of run unless multiple of every
|
// will not write on last step of run unless multiple of every
|
||||||
// set next_dump_any to smallest next_dump
|
// set next_dump_any to smallest next_dump
|
||||||
@ -111,8 +110,7 @@ void Output::setup(int flag)
|
|||||||
|
|
||||||
if (ndump) {
|
if (ndump) {
|
||||||
for (int idump = 0; idump < ndump; idump++) {
|
for (int idump = 0; idump < ndump; idump++) {
|
||||||
if (ntimestep % dump_every[idump] == 0 &&
|
if (last_dump[idump] != ntimestep) {
|
||||||
last_dump[idump] != ntimestep) {
|
|
||||||
dump[idump]->write();
|
dump[idump]->write();
|
||||||
last_dump[idump] = ntimestep;
|
last_dump[idump] = ntimestep;
|
||||||
}
|
}
|
||||||
@ -158,25 +156,26 @@ void Output::setup(int flag)
|
|||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
perform all output for this timestep
|
perform all output for this timestep
|
||||||
only perform output if next matches current step and last doesn't
|
only perform output if next matches current step and last doesn't
|
||||||
insure next values force output on last step of run
|
|
||||||
do dump/restart before thermo so thermo CPU time will include them
|
do dump/restart before thermo so thermo CPU time will include them
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Output::write(int ntimestep)
|
void Output::write(int ntimestep)
|
||||||
{
|
{
|
||||||
|
// next_dump does not force output on last step of run
|
||||||
|
|
||||||
if (next_dump_any == ntimestep) {
|
if (next_dump_any == ntimestep) {
|
||||||
for (int idump = 0; idump < ndump; idump++) {
|
for (int idump = 0; idump < ndump; idump++) {
|
||||||
if (next_dump[idump] == ntimestep && last_dump[idump] != ntimestep) {
|
if (next_dump[idump] == ntimestep && last_dump[idump] != ntimestep) {
|
||||||
dump[idump]->write();
|
dump[idump]->write();
|
||||||
last_dump[idump] = ntimestep;
|
last_dump[idump] = ntimestep;
|
||||||
next_dump[idump] += dump_every[idump];
|
next_dump[idump] += dump_every[idump];
|
||||||
next_dump[idump] = MYMIN(next_dump[idump],update->laststep);
|
|
||||||
}
|
}
|
||||||
if (idump) next_dump_any = MYMIN(next_dump_any,next_dump[idump]);
|
if (idump) next_dump_any = MYMIN(next_dump_any,next_dump[idump]);
|
||||||
else next_dump_any = next_dump[0];
|
else next_dump_any = next_dump[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// next_restart does not force output on last step of run
|
||||||
// for toggle = 0, replace "*" with current timestep in restart filename
|
// for toggle = 0, replace "*" with current timestep in restart filename
|
||||||
|
|
||||||
if (next_restart == ntimestep && last_restart != ntimestep) {
|
if (next_restart == ntimestep && last_restart != ntimestep) {
|
||||||
@ -197,9 +196,10 @@ void Output::write(int ntimestep)
|
|||||||
}
|
}
|
||||||
last_restart = ntimestep;
|
last_restart = ntimestep;
|
||||||
next_restart += restart_every;
|
next_restart += restart_every;
|
||||||
next_restart = MYMIN(next_restart,update->laststep);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// insure next_thermo forces output on last step of run
|
||||||
|
|
||||||
if (next_thermo == ntimestep && last_thermo != ntimestep) {
|
if (next_thermo == ntimestep && last_thermo != ntimestep) {
|
||||||
thermo->compute(1);
|
thermo->compute(1);
|
||||||
last_thermo = ntimestep;
|
last_thermo = ntimestep;
|
||||||
|
|||||||
Reference in New Issue
Block a user