diff --git a/history.md b/history.md index c2c8dd0..f22ae34 100644 --- a/history.md +++ b/history.md @@ -233,5 +233,5 @@ ### Version 0.5.6 (Aug 25, 2024) * Defining material with float refractive index enabled for FDTDSimulation.add_structure_from_gdsii(). -### Version 0.5.8 (Sep 4, 2024) +### Version 0.5.9 (Sep 4, 2024) * New pixelated region class: CirclePixelsRegionwithGroup. \ No newline at end of file diff --git a/splayout/__init__.py b/splayout/__init__.py index 4766171..fc040d2 100644 --- a/splayout/__init__.py +++ b/splayout/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.5.8" +__version__ = "0.5.9" ## Submodules from . import utils diff --git a/splayout/components/pixelsregion.py b/splayout/components/pixelsregion.py index da8b819..bc18f8b 100644 --- a/splayout/components/pixelsregion.py +++ b/splayout/components/pixelsregion.py @@ -330,9 +330,10 @@ def update(self, matrix): self.__initialize() else: self.__lastest_array = np.array(masked_matrix,dtype=np.double) - self.__last_array = np.array(masked_matrix,dtype=np.double) - self.fdtd_engine.fdtd.putv("radius_matrix", self.__lastest_array) - self.fdtd_engine.eval("setnamed(\"::model::"+self.group_name+"\",\"radius_matrix\",radius_matrix);") + if not (self.__lastest_array == self.__last_array).all(): + self.__last_array = np.array(masked_matrix,dtype=np.double) + self.fdtd_engine.fdtd.putv("radius_matrix", self.__lastest_array) + self.fdtd_engine.eval("setnamed(\"::model::"+self.group_name+"\",\"radius_matrix\",radius_matrix);") def draw_layout(self, matrix, cell, layer): '''