From 1b41f2f1031a905a73709088e7f4d138efcd1c82 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 18 Mar 2005 17:21:48 +0000 Subject: [PATCH] if no mesh file name is specified, use the problem name to construct one --- utils/solvers/python/postcsv.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utils/solvers/python/postcsv.py b/utils/solvers/python/postcsv.py index 1e0d3eadec..f90dc1942d 100755 --- a/utils/solvers/python/postcsv.py +++ b/utils/solvers/python/postcsv.py @@ -265,15 +265,17 @@ elif cmdline.has_key('--options'): Gmsh.send('--noaverage', Gmsh.OPTION) Gmsh.send('--average', Gmsh.OPTION) else: - if not cmdline.has_key('--mesh'): - Gmsh.send("No mesh specified.", Gmsh.ERROR) - sys.exit(1) if not cmdline.has_key('--results'): Gmsh.send("No results specified.", Gmsh.ERROR) sys.exit(1) + if not cmdline.has_key('--mesh'): + mshname = cmdline['--results'].split('.')[0] + '.msh' + else: + mshname = cmdline['--mesh'] + try: - mshfile = open(cmdline['--mesh']) + mshfile = open(mshname) csvfile = open(cmdline['--results']) except: Gmsh.send(str(sys.exc_info()[1]), Gmsh.ERROR) -- GitLab