From 7bf048a44f82d864d95d12568f50a30e5efa762c Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Tue, 22 Dec 2015 16:58:27 +0000 Subject: [PATCH] Tidy up of code formatting --- gprMax/input_cmds_singleuse.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gprMax/input_cmds_singleuse.py b/gprMax/input_cmds_singleuse.py index c3e3c457..a6789cbc 100644 --- a/gprMax/input_cmds_singleuse.py +++ b/gprMax/input_cmds_singleuse.py @@ -112,18 +112,15 @@ def process_singlecmds(singlecmds, multicmds, G): # Domain cmd = '#domain' tmp = [float(x) for x in singlecmds[cmd].split()] - nx = rvalue(tmp[0]/G.dx) - ny = rvalue(tmp[1]/G.dy) - nz = rvalue(tmp[2]/G.dz) if len(tmp) != 3: raise CmdInputError(cmd + ' requires exactly three parameters') - G.nx = nx - G.ny = ny - G.nz = nz + G.nx = rvalue(tmp[0]/G.dx) + G.ny = rvalue(tmp[1]/G.dy) + G.nz = rvalue(tmp[2]/G.dz) if G.messages: - print('Model domain: {:.3f} x {:.3f} x {:.3f} m ({:d} x {:d} x {:d} = {:d} Mcells)'.format(tmp[0], tmp[1], tmp[2], G.nx, G.ny, G.nz, int((G.nx * G.ny * G.nz)/1e6))) + print('Model domain: {:.3f} x {:.3f} x {:.3f} m ({:d} x {:d} x {:d} = {:.1f} Mcells)'.format(tmp[0], tmp[1], tmp[2], G.nx, G.ny, G.nz, (G.nx * G.ny * G.nz)/1e6)) mem = (((G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 13 * np.dtype(floattype).itemsize + (G.nx + 1) * (G.ny + 1) * (G.nz + 1) * 18) * 1.1) + 30e6 - print('Memory (approx) required/available: {} / {}'.format(human_size(mem), human_size(virtual_memory().total))) + print('Memory: ~{} required, {} available'.format(human_size(mem), human_size(virtual_memory().total))) # Time step CFL limit - use either 2D or 3D (default)