Skip to content
Snippets Groups Projects
Commit 2e40c009 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

add option to the print command to also print to the global universe screen and logfile

parent ba434652
No related branches found
No related tags found
No related merge requests found
...@@ -14,10 +14,11 @@ print string keyword value :pre ...@@ -14,10 +14,11 @@ print string keyword value :pre
string = text string to print, which may contain variables :ulb,l string = text string to print, which may contain variables :ulb,l
zero or more keyword/value pairs may be appended :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 {file} value = filename
{append} value = filename {append} value = filename
{screen} value = {yes} or {no} :pre {screen} value = {yes} or {no}
{universe} value = {yes} or {no} :pre
:ule :ule
[Examples:] [Examples:]
...@@ -26,6 +27,7 @@ print "Done with equilibration" file info.dat ...@@ -26,6 +27,7 @@ print "Done with equilibration" file info.dat
print Vol=$v append info.dat screen no print Vol=$v append info.dat screen no
print "The system volume is now $v" print "The system volume is now $v"
print 'The system volume is now $v' print 'The system volume is now $v'
print "NEB calculation 1 complete" screen no universe yes
print """ print """
System volume = $v System volume = $v
System temperature = $t System temperature = $t
...@@ -49,6 +51,11 @@ it does not exist. ...@@ -49,6 +51,11 @@ it does not exist.
If the {screen} keyword is used, output to the screen and logfile can If the {screen} keyword is used, output to the screen and logfile can
be turned on or off as desired. 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 If you want the print command to be executed multiple times (with
changing variable values), there are 3 options. First, consider using changing variable values), there are 3 options. First, consider using
the "fix print"_fix_print.html command, which will print a string the "fix print"_fix_print.html command, which will print a string
...@@ -74,4 +81,4 @@ thermodynamic properties, global values calculated by a ...@@ -74,4 +81,4 @@ thermodynamic properties, global values calculated by a
[Default:] [Default:]
The option defaults are no file output and screen = yes. The option defaults are no file output, screen = yes, and universe = no.
...@@ -1175,6 +1175,7 @@ void Input::print() ...@@ -1175,6 +1175,7 @@ void Input::print()
FILE *fp = NULL; FILE *fp = NULL;
int screenflag = 1; int screenflag = 1;
int universeflag = 0;
int iarg = 1; int iarg = 1;
while (iarg < narg) { while (iarg < narg) {
...@@ -1197,6 +1198,12 @@ void Input::print() ...@@ -1197,6 +1198,12 @@ void Input::print()
else if (strcmp(arg[iarg+1],"no") == 0) screenflag = 0; else if (strcmp(arg[iarg+1],"no") == 0) screenflag = 0;
else error->all(FLERR,"Illegal print command"); else error->all(FLERR,"Illegal print command");
iarg += 2; 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"); } else error->all(FLERR,"Illegal print command");
} }
...@@ -1208,6 +1215,10 @@ void Input::print() ...@@ -1208,6 +1215,10 @@ void Input::print()
fclose(fp); 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);
}
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment