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

This commit is contained in:
sjplimp 2009-09-14 14:54:09 +00:00
parent fbdc2639af
commit 27f0ad5ce3
1 changed files with 10 additions and 6 deletions

View File

@ -133,11 +133,12 @@ void Output::setup(int flag)
// will not write on last step of run unless multiple of every
// set next_dump_any to smallest next_dump
// if no dumps, set next_dump_any to last+1 so will not influence next
// dump custom may invoke computes so wrap with clear/add
// dump custom/cfg may invoke computes so wrap with clear/add
if (ndump && update->restrict_output == 0) {
for (int idump = 0; idump < ndump; idump++) {
if (strcmp(dump[idump]->style,"custom") == 0)
if (strcmp(dump[idump]->style,"custom") == 0 ||
strcmp(dump[idump]->style,"cfg") == 0)
modify->clearstep_compute();
if ((ntimestep % dump_every[idump] == 0 &&
last_dump[idump] != ntimestep) || last_dump[idump] < 0) {
@ -146,7 +147,8 @@ void Output::setup(int flag)
}
next_dump[idump] =
(ntimestep/dump_every[idump])*dump_every[idump] + dump_every[idump];
if (strcmp(dump[idump]->style,"custom") == 0)
if (strcmp(dump[idump]->style,"custom") == 0 ||
strcmp(dump[idump]->style,"cfg") == 0)
modify->addstep_compute(next_dump[idump]);
if (idump) next_dump_any = MYMIN(next_dump_any,next_dump[idump]);
else next_dump_any = next_dump[0];
@ -199,17 +201,19 @@ void Output::setup(int flag)
void Output::write(int ntimestep)
{
// next_dump does not force output on last step of run
// dump custom may invoke computes so wrap with clear/add
// dump custom/cfg may invoke computes so wrap with clear/add
if (next_dump_any == ntimestep) {
for (int idump = 0; idump < ndump; idump++) {
if (next_dump[idump] == ntimestep && last_dump[idump] != ntimestep) {
if (strcmp(dump[idump]->style,"custom") == 0)
if (strcmp(dump[idump]->style,"custom") == 0 ||
strcmp(dump[idump]->style,"cfg") == 0)
modify->clearstep_compute();
dump[idump]->write();
last_dump[idump] = ntimestep;
next_dump[idump] += dump_every[idump];
if (strcmp(dump[idump]->style,"custom") == 0)
if (strcmp(dump[idump]->style,"custom") == 0 ||
strcmp(dump[idump]->style,"cfg") == 0)
modify->addstep_compute(next_dump[idump]);
}
if (idump) next_dump_any = MYMIN(next_dump_any,next_dump[idump]);