Add verbose option in PyLammps methods

This option allows forcing LAMMPS output to be printed to the console.
This commit is contained in:
Richard Berger
2016-08-10 14:29:07 -04:00
parent 691de01b33
commit a08cf7a4b6

View File

@ -640,6 +640,10 @@ class PyLammps(object):
with OutputCapture() as capture: with OutputCapture() as capture:
self.lmp.command(' '.join(cmd_args)) self.lmp.command(' '.join(cmd_args))
output = capture.output output = capture.output
if 'verbose' in kwargs and kwargs['verbose']:
print(output)
lines = output.splitlines() lines = output.splitlines()
if len(lines) > 1: if len(lines) > 1: