diff --git a/doc/src/print.txt b/doc/src/print.txt index 4c9e5b4d7611c7638d469646469935b18298f903..77e0c7cfd3d64ed7a6bfeb6dcd17b716f0b1e1f3 100644 --- a/doc/src/print.txt +++ b/doc/src/print.txt @@ -14,10 +14,11 @@ print string keyword value :pre string = text string to print, which may contain variables :ulb,l zero or more keyword/value pairs may be appended :l -keyword = {file} or {append} or {screen} :l +keyword = {file} or {append} or {screen} or {universe} :l {file} value = filename {append} value = filename - {screen} value = {yes} or {no} :pre + {screen} value = {yes} or {no} + {universe} value = {yes} or {no} :pre :ule [Examples:] @@ -26,6 +27,7 @@ print "Done with equilibration" file info.dat print Vol=$v append info.dat screen no print "The system volume is now $v" print 'The system volume is now $v' +print "NEB calculation 1 complete" screen no universe yes print """ System volume = $v System temperature = $t @@ -49,6 +51,11 @@ it does not exist. If the {screen} keyword is used, output to the screen and logfile can be turned on or off as desired. +If the {universe} keyword is used, output to the global screen and +logfile can be turned on or off as desired. In multi-partition +calculations, the {screen} option and the corresponding output only +apply to the screen and logfile of the individual partition. + If you want the print command to be executed multiple times (with changing variable values), there are 3 options. First, consider using the "fix print"_fix_print.html command, which will print a string @@ -74,4 +81,4 @@ thermodynamic properties, global values calculated by a [Default:] -The option defaults are no file output and screen = yes. +The option defaults are no file output, screen = yes, and universe = no. diff --git a/src/input.cpp b/src/input.cpp index 3d287771b81ee6a25781891fad7e6f6af2828954..d18be498fd50d062866cf5ec2f50f14cb1341a9c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1175,6 +1175,7 @@ void Input::print() FILE *fp = NULL; int screenflag = 1; + int universeflag = 0; int iarg = 1; while (iarg < narg) { @@ -1197,6 +1198,12 @@ void Input::print() else if (strcmp(arg[iarg+1],"no") == 0) screenflag = 0; else error->all(FLERR,"Illegal print command"); iarg += 2; + } else if (strcmp(arg[iarg],"universe") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal print command"); + if (strcmp(arg[iarg+1],"yes") == 0) universeflag = 1; + else if (strcmp(arg[iarg+1],"no") == 0) universeflag = 0; + else error->all(FLERR,"Illegal print command"); + iarg += 2; } else error->all(FLERR,"Illegal print command"); } @@ -1208,6 +1215,10 @@ void Input::print() fclose(fp); } } + if (universeflag && (universe->me == 0)) { + if (universe->uscreen) fprintf(universe->uscreen, "%s\n",line); + if (universe->ulogfile) fprintf(universe->ulogfile,"%s\n",line); + } } /* ---------------------------------------------------------------------- */