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

This commit is contained in:
sjplimp
2006-10-12 23:53:52 +00:00
parent 227489b1d8
commit 17457a1181
2 changed files with 13 additions and 6 deletions

View File

@ -17,6 +17,7 @@
#include "string.h"
#include "input.h"
#include "system.h"
#include "universe.h"
#include "atom.h"
#include "comm.h"
#include "group.h"
@ -786,13 +787,17 @@ void Input::log()
if (logfile) fclose(logfile);
if (strcmp(arg[0],"none") == 0) logfile = NULL;
else {
logfile = fopen(arg[0],"w");
char fname[128];
if (universe->nworlds == 1) strcpy(fname,arg[0]);
else sprintf(fname,"%s.%d",arg[0],universe->iworld);
logfile = fopen(fname,"w");
if (logfile == NULL) {
char str[128];
sprintf(str,"Cannot open logfile %s",arg[0]);
sprintf(str,"Cannot open logfile %s",fname);
error->one(str);
}
}
if (universe->nworlds == 1) universe->ulogfile = logfile;
}
}