Added verbose class option + removed empty output lines

This commit is contained in:
Eugen Rožić
2022-05-24 11:37:44 +02:00
parent 18df50356e
commit b66702c285

View File

@ -457,8 +457,9 @@ class PyLammps(object):
:vartype run: list :vartype run: list
""" """
def __init__(self, name="", cmdargs=None, ptr=None, comm=None): def __init__(self, name="", cmdargs=None, ptr=None, comm=None, verbose=False):
self.has_echo = False self.has_echo = False
self.verbose = verbose
if cmdargs: if cmdargs:
if '-echo' in cmdargs: if '-echo' in cmdargs:
@ -869,8 +870,8 @@ class PyLammps(object):
if comm: if comm:
output = self.lmp.comm.bcast(output, root=0) output = self.lmp.comm.bcast(output, root=0)
if 'verbose' in kwargs and kwargs['verbose']: if self.verbose or ('verbose' in kwargs and kwargs['verbose']):
print(output) print(output, end = '')
lines = output.splitlines() lines = output.splitlines()