From fb84e555f1170965a1420d1d1e696ae0236adaa3 Mon Sep 17 00:00:00 2001 From: Anthony Ford Date: Fri, 19 Jul 2024 11:49:35 -0400 Subject: [PATCH] Add option to toggle show_pml for Mesh --- pyems/mesh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyems/mesh.py b/pyems/mesh.py index 12172a1..5793946 100644 --- a/pyems/mesh.py +++ b/pyems/mesh.py @@ -518,6 +518,7 @@ def __init__( simulation_bounds: Tuple[ Tuple[float, float], Tuple[float, float], Tuple[float, float] ] = None, + show_pml: bool = True, ): """ :param sim: Simulation object to which mesh should be added. @@ -548,6 +549,8 @@ def __init__( strict total mesh size and expand_bounds will be ignored. An error will trigger if the internal CSX structures require a larger mesh than the one specified here. + :param show_pml: Whether to show the PML (perfectly-matched + layers) in the CSX rendering. Default True. """ self._sim = sim self._sim.register_mesh(self) @@ -560,6 +563,7 @@ def __init__( self.min_lines = min_lines self.expand_bounds = expand_bounds self.simulation_bounds = simulation_bounds + self.show_pml = show_pml # Keep track of mesh regions already applied. This is an array # of 3 elements. The 1st element is a list of ranges in the # x-dimension that have already been meshed. The 2nd @@ -591,7 +595,7 @@ def __init__( # set later self.bounded_types = None - self.generate_mesh() + self.generate_mesh(show_pml = self.show_pml) @property def sim(self) -> Simulation: