Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
multiscale
lammps
Commits
2e40c009
Commit
2e40c009
authored
7 years ago
by
Axel Kohlmeyer
Browse files
Options
Downloads
Patches
Plain Diff
add option to the print command to also print to the global universe screen and logfile
parent
ba434652
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/src/print.txt
+10
-3
10 additions, 3 deletions
doc/src/print.txt
src/input.cpp
+11
-0
11 additions, 0 deletions
src/input.cpp
with
21 additions
and
3 deletions
doc/src/print.txt
+
10
−
3
View file @
2e40c009
...
@@ -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
.
This diff is collapsed.
Click to expand it.
src/input.cpp
+
11
−
0
View file @
2e40c009
...
@@ -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
);
}
}
}
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment