From 6ab61f0f9e2d583c34ac8609a5ac44b473eceb6d Mon Sep 17 00:00:00 2001 From: Alex Fikl Date: Sun, 9 Sep 2018 15:05:19 -0500 Subject: [PATCH 1/2] runner: force output format to msh2 --- gmsh_interop/runner.py | 3 ++- test/test_gmsh.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gmsh_interop/runner.py b/gmsh_interop/runner.py index 9d9cf6b..d008223 100644 --- a/gmsh_interop/runner.py +++ b/gmsh_interop/runner.py @@ -151,7 +151,8 @@ class GmshRunner(object): cmdline = [ self.gmsh_executable, "-o", self.output_file_name, - "-nopopup"] + "-nopopup", + "-format", "msh2"] if self.dimensions is not None: cmdline.append("-%d" % self.dimensions) diff --git a/test/test_gmsh.py b/test/test_gmsh.py index 0cd9e75..29c6f6f 100644 --- a/test/test_gmsh.py +++ b/test/test_gmsh.py @@ -82,8 +82,11 @@ def test_gmsh(): skip("gmsh not found") from gmsh_interop.reader import generate_gmsh, GmshMeshReceiverBase + from gmsh_interop.runner import ScriptSource + mr = GmshMeshReceiverBase() - generate_gmsh(mr, GMSH_SPHERE, 3) + source = ScriptSource(GMSH_SPHERE, "geo") + generate_gmsh(mr, source, 3) # }}} -- GitLab From 2a964221fc53bad7b25b5fd942077ac674e2ac2f Mon Sep 17 00:00:00 2001 From: Alex Fikl Date: Sun, 9 Sep 2018 15:16:03 -0500 Subject: [PATCH 2/2] reader: fix some outdated docstrings --- gmsh_interop/reader.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gmsh_interop/reader.py b/gmsh_interop/reader.py index 89ae52e..5720ccb 100644 --- a/gmsh_interop/reader.py +++ b/gmsh_interop/reader.py @@ -619,8 +619,9 @@ def generate_gmsh(receiver, source, dimensions=None, order=None, other_options=[ output_file_name="output.msh"): """Run gmsh and feed the output to *receiver*. - :arg source: an instance of :class:`LiteralSource` or :class:`FileSource` - :param receiver: Implements the :class:`GmshMeshReceiverBase` interface. + :arg receiver: a class that implements the :class:`GmshMeshReceiverBase` + interface. + :arg source: an instance of :class:`ScriptSource` or :class:`FileSource`. """ from gmsh_interop.runner import GmshRunner runner = GmshRunner(source, dimensions, order=order, @@ -640,12 +641,12 @@ def generate_gmsh(receiver, source, dimensions=None, order=None, other_options=[ def parse_gmsh(receiver, line_iterable, force_dimension=None): """ - :arg source: an instance of :class:`LiteralSource` or :class:`FileSource` - :arg receiver: This object will be fed the entities encountered in reading the - GMSH file. See :class:`GmshMeshReceiverBase` for the interface this - object needs to conform to. - :param force_dimension: if not None, truncate point coordinates to this many - dimensions. + :arg receiver: this object will be fed the entities encountered in + reading the GMSH file. See :class:`GmshMeshReceiverBase` for the + interface this object needs to conform to. + :arg line_iterable: an iterable that generates the lines of the GMSH file. + :arg force_dimension: if not *None*, truncate point coordinates to this + many dimensions. """ feeder = LineFeeder(line_iterable) -- GitLab