git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11079 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -442,6 +442,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
|
||||
// if restartflag set, process 2 command and quit
|
||||
// add args between wdfirst and wdlast to write_data
|
||||
// also add "noinit" to prevent write_data from doing system init
|
||||
|
||||
if (restartflag) {
|
||||
char cmd[128];
|
||||
@ -450,7 +451,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
sprintf(cmd,"write_data %s",dfile);
|
||||
for (iarg = wdfirst; iarg < wdlast; iarg++)
|
||||
sprintf(&cmd[strlen(cmd)]," %s",arg[iarg]);
|
||||
strcat(cmd,"\n");
|
||||
strcat(cmd," noinit\n");
|
||||
input->one(cmd);
|
||||
error->done();
|
||||
}
|
||||
|
||||
@ -71,8 +71,10 @@ void WriteData::command(int narg, char **arg)
|
||||
} else strcpy(file,arg[0]);
|
||||
|
||||
// read optional args
|
||||
// noinit is a hidden arg, only used by -r command-line switch
|
||||
|
||||
pairflag = II;
|
||||
int noinit = 0;
|
||||
|
||||
int iarg = 1;
|
||||
while (iarg < narg) {
|
||||
@ -82,12 +84,22 @@ void WriteData::command(int narg, char **arg)
|
||||
else if (strcmp(arg[iarg+1],"ij") == 0) pairflag = IJ;
|
||||
else error->all(FLERR,"Illegal write_data command");
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"noinit") == 0) {
|
||||
noinit = 1;
|
||||
iarg++;
|
||||
} else error->all(FLERR,"Illegal write_data command");
|
||||
}
|
||||
|
||||
// init entire system since comm->exchange is done
|
||||
// comm::init needs neighbor::init needs pair::init needs kspace::init, etc
|
||||
// exception is when called by -r command-line switch
|
||||
// then write_data immediately follows reading of restart file
|
||||
// assume that read_restart initialized necessary values
|
||||
// if don't make exception:
|
||||
// pair->init() can fail due to various unset values:
|
||||
// e.g. pair hybrid coeffs, dpd ghost-atom velocity setting
|
||||
|
||||
if (noinit == 0) {
|
||||
if (comm->me == 0 && screen)
|
||||
fprintf(screen,"System init for write_data ...\n");
|
||||
lmp->init();
|
||||
@ -105,6 +117,7 @@ void WriteData::command(int narg, char **arg)
|
||||
comm->exchange();
|
||||
comm->borders();
|
||||
if (domain->triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
}
|
||||
|
||||
write(file);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user