Merge branch 'master' into resetids
This commit is contained in:
25
src/dump.cpp
25
src/dump.cpp
@ -22,11 +22,12 @@
|
||||
#include "domain.h"
|
||||
#include "group.h"
|
||||
#include "output.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "modify.h"
|
||||
#include "fix.h"
|
||||
#include "compute.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -78,6 +79,9 @@ Dump::Dump(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||
format_bigint_user = NULL;
|
||||
format_column_user = NULL;
|
||||
|
||||
refreshflag = 0;
|
||||
refresh = NULL;
|
||||
|
||||
clearstep = 0;
|
||||
sort_flag = 0;
|
||||
append_flag = 0;
|
||||
@ -161,6 +165,8 @@ Dump::~Dump()
|
||||
delete [] format_int_user;
|
||||
delete [] format_bigint_user;
|
||||
|
||||
delete [] refresh;
|
||||
|
||||
// format_column_user is deallocated by child classes that use it
|
||||
|
||||
memory->destroy(buf);
|
||||
@ -278,6 +284,16 @@ void Dump::init()
|
||||
}
|
||||
}
|
||||
|
||||
// search for refresh compute specified by dump_modify refresh
|
||||
|
||||
if (refreshflag) {
|
||||
int icompute;
|
||||
for (icompute = 0; icompute < modify->ncompute; icompute++)
|
||||
if (strcmp(refresh,modify->compute[icompute]->id) == 0) break;
|
||||
if (icompute < modify->ncompute) irefresh = icompute;
|
||||
else error->all(FLERR,"Dump could not find refresh compute ID");
|
||||
}
|
||||
|
||||
// preallocation for PBC copies if requested
|
||||
|
||||
if (pbcflag && atom->nlocal > maxpbc) pbc_allocate();
|
||||
@ -483,6 +499,11 @@ void Dump::write()
|
||||
atom->image = imagehold;
|
||||
}
|
||||
|
||||
// trigger post-dump refresh by specified compute
|
||||
// currently used for incremental dump files
|
||||
|
||||
if (refreshflag) modify->compute[irefresh]->refresh();
|
||||
|
||||
// if file per timestep, close file if I am filewriter
|
||||
|
||||
if (multifile) {
|
||||
|
||||
Reference in New Issue
Block a user