From f805d96009d390cde3adf7f13628af5aa981e9ed Mon Sep 17 00:00:00 2001 From: xywei Date: Sat, 5 May 2018 10:01:56 -0500 Subject: [PATCH 1/7] Keep tmp files --- meshmode/mesh/io.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meshmode/mesh/io.py b/meshmode/mesh/io.py index fd8a82a2..799b0cd5 100644 --- a/meshmode/mesh/io.py +++ b/meshmode/mesh/io.py @@ -229,7 +229,7 @@ def read_gmsh(filename, force_ambient_dim=None): def generate_gmsh(source, dimensions=None, order=None, other_options=[], extension="geo", gmsh_executable="gmsh", force_ambient_dim=None, - output_file_name="output.msh"): + output_file_name="output.msh", keep_tmp_dir=False): """Run :command:`gmsh` on the input given by *source*, and return a :class:`meshmode.mesh.Mesh` based on the result. @@ -244,7 +244,9 @@ def generate_gmsh(source, dimensions=None, order=None, other_options=[], from gmsh_interop.reader import parse_gmsh with GmshRunner(source, dimensions, order=order, other_options=other_options, extension=extension, - gmsh_executable=gmsh_executable) as runner: + gmsh_executable=gmsh_executable, + output_file_name=output_file_name, + keep_tmp_dir=keep_tmp_dir) as runner: parse_gmsh(recv, runner.output_file, force_dimension=force_ambient_dim) -- GitLab From 8e2a40ae14719e7d90ad292305d38ee694155ccb Mon Sep 17 00:00:00 2001 From: xywei Date: Wed, 11 Jul 2018 03:31:42 +0800 Subject: [PATCH 2/7] Fix --- meshmode/discretization/poly_element.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshmode/discretization/poly_element.py b/meshmode/discretization/poly_element.py index 1d25e337..2e92b67f 100644 --- a/meshmode/discretization/poly_element.py +++ b/meshmode/discretization/poly_element.py @@ -142,7 +142,7 @@ class InterpolatoryQuadratureSimplexElementGroup(PolynomialSimplexElementGroupBa def _quadrature_rule(self): dims = self.mesh_el_group.dim if dims == 1: - return mp.LegendreGaussQuadrature(self.order) + return mp.GaussLegendreQuadrature(self.order) else: return mp.VioreanuRokhlinSimplexQuadrature(self.order, dims) @@ -176,7 +176,7 @@ class QuadratureSimplexElementGroup(SimplexElementGroupBase): def _quadrature_rule(self): dims = self.mesh_el_group.dim if dims == 1: - return mp.LegendreGaussQuadrature(self.order) + return mp.GaussLegendreQuadrature(self.order) else: return mp.XiaoGimbutasSimplexQuadrature(self.order, dims) -- GitLab From 851cfd29a22b06fd6113eee5b48ae13d1f05258a Mon Sep 17 00:00:00 2001 From: xywei Date: Sat, 26 Jan 2019 20:49:36 -0600 Subject: [PATCH 3/7] Bug fix --- meshmode/mesh/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshmode/mesh/io.py b/meshmode/mesh/io.py index b3a9caf4..93d5980d 100644 --- a/meshmode/mesh/io.py +++ b/meshmode/mesh/io.py @@ -292,7 +292,7 @@ def read_gmsh(filename, force_ambient_dim=None, mesh_construction_kwargs=None): def generate_gmsh(source, dimensions=None, order=None, other_options=[], extension="geo", gmsh_executable="gmsh", force_ambient_dim=None, output_file_name="output.msh", keep_tmp_dir=False, - output_file_name="output.msh", mesh_construction_kwargs=None): + mesh_construction_kwargs=None): """Run :command:`gmsh` on the input given by *source*, and return a :class:`meshmode.mesh.Mesh` based on the result. -- GitLab From 59361806d6c38b02b8d417ea4699b9966b60f367 Mon Sep 17 00:00:00 2001 From: xywei Date: Sat, 26 Jan 2019 21:02:23 -0600 Subject: [PATCH 4/7] Revert changes of quadrature names --- meshmode/discretization/poly_element.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshmode/discretization/poly_element.py b/meshmode/discretization/poly_element.py index 2e92b67f..1d25e337 100644 --- a/meshmode/discretization/poly_element.py +++ b/meshmode/discretization/poly_element.py @@ -142,7 +142,7 @@ class InterpolatoryQuadratureSimplexElementGroup(PolynomialSimplexElementGroupBa def _quadrature_rule(self): dims = self.mesh_el_group.dim if dims == 1: - return mp.GaussLegendreQuadrature(self.order) + return mp.LegendreGaussQuadrature(self.order) else: return mp.VioreanuRokhlinSimplexQuadrature(self.order, dims) @@ -176,7 +176,7 @@ class QuadratureSimplexElementGroup(SimplexElementGroupBase): def _quadrature_rule(self): dims = self.mesh_el_group.dim if dims == 1: - return mp.GaussLegendreQuadrature(self.order) + return mp.LegendreGaussQuadrature(self.order) else: return mp.XiaoGimbutasSimplexQuadrature(self.order, dims) -- GitLab From 6fc072b1ff89761b3417863d39d1fdcda0917390 Mon Sep 17 00:00:00 2001 From: xywei Date: Sat, 18 May 2019 23:06:54 -0500 Subject: [PATCH 5/7] Update tmp file interface --- meshmode/mesh/io.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meshmode/mesh/io.py b/meshmode/mesh/io.py index 515a4317..d67cfa39 100644 --- a/meshmode/mesh/io.py +++ b/meshmode/mesh/io.py @@ -291,7 +291,7 @@ def read_gmsh(filename, force_ambient_dim=None, mesh_construction_kwargs=None): def generate_gmsh(source, dimensions=None, order=None, other_options=[], extension="geo", gmsh_executable="gmsh", force_ambient_dim=None, - output_file_name="output.msh", keep_tmp_dir=False, + output_file_name="output.msh", keep_tmp_dir=False, overwrite_tmp_files=True, mesh_construction_kwargs=None): """Run :command:`gmsh` on the input given by *source*, and return a :class:`meshmode.mesh.Mesh` based on the result. @@ -307,13 +307,17 @@ def generate_gmsh(source, dimensions=None, order=None, other_options=[], """ recv = GmshMeshReceiver(mesh_construction_kwargs=mesh_construction_kwargs) + if keep_tmp_dir: + tmp_files_dir = "./gmsh_tmp" + from gmsh_interop.runner import GmshRunner from gmsh_interop.reader import parse_gmsh with GmshRunner(source, dimensions, order=order, other_options=other_options, extension=extension, gmsh_executable=gmsh_executable, output_file_name=output_file_name, - keep_tmp_dir=keep_tmp_dir) as runner: + save_tmp_files_in=tmp_files_dir, + overwrite_tmp_files=overwrite_tmp_files) as runner: parse_gmsh(recv, runner.output_file, force_dimension=force_ambient_dim) -- GitLab From de7319f7a2d0e196fd2f450fe45bc045fefccf57 Mon Sep 17 00:00:00 2001 From: xywei Date: Mon, 20 May 2019 11:36:32 -0500 Subject: [PATCH 6/7] Allow assigning tmp dir name --- meshmode/mesh/io.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meshmode/mesh/io.py b/meshmode/mesh/io.py index d67cfa39..8e069468 100644 --- a/meshmode/mesh/io.py +++ b/meshmode/mesh/io.py @@ -307,7 +307,9 @@ def generate_gmsh(source, dimensions=None, order=None, other_options=[], """ recv = GmshMeshReceiver(mesh_construction_kwargs=mesh_construction_kwargs) - if keep_tmp_dir: + if isinstance(keep_tmp_dir, str): + tmp_files_dir = keep_tmp_dir + elif keep_tmp_dir: tmp_files_dir = "./gmsh_tmp" from gmsh_interop.runner import GmshRunner -- GitLab From f4fdf8269e6c6fb0fcc89ddf54aa5df006730197 Mon Sep 17 00:00:00 2001 From: xywei Date: Sun, 2 Jun 2019 13:19:00 -0500 Subject: [PATCH 7/7] Bug fix --- meshmode/mesh/io.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshmode/mesh/io.py b/meshmode/mesh/io.py index 8e069468..daaaa178 100644 --- a/meshmode/mesh/io.py +++ b/meshmode/mesh/io.py @@ -311,6 +311,8 @@ def generate_gmsh(source, dimensions=None, order=None, other_options=[], tmp_files_dir = keep_tmp_dir elif keep_tmp_dir: tmp_files_dir = "./gmsh_tmp" + else: + tmp_files_dir = None from gmsh_interop.runner import GmshRunner from gmsh_interop.reader import parse_gmsh -- GitLab