From 5398c3a00849763970d75788ef4005bc23f03f89 Mon Sep 17 00:00:00 2001 From: Luis Manuel Diaz Angulo Date: Thu, 3 Jul 2025 13:47:34 +0200 Subject: [PATCH 1/2] Makes near region bounding box smaller to improve compatibility with FDTD --- src/ShapesClassification.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ShapesClassification.py b/src/ShapesClassification.py index 84a3f4b..6af0afa 100644 --- a/src/ShapesClassification.py +++ b/src/ShapesClassification.py @@ -125,6 +125,8 @@ def _buildClosedVacuumDomain(self) -> Tuple[int, int]: return dict([[0, dom]]) def _buildDefaultVacuumDomain(self): + NEAR_REGION_BOUNDING_BOX_SCALING_FACTOR = 1.2 + FAR_REGION_DISK_SCALING_FACTOR = 4.0 nonVacuumSurfaces = [] for _, surf in self.pecs.items(): nonVacuumSurfaces.extend(surf) @@ -135,12 +137,15 @@ def _buildDefaultVacuumDomain(self): bbMaxLength = np.max(boundingBox.getLengths()) + nearVacuumBoxSize = bbMaxLength*NEAR_REGION_BOUNDING_BOX_SCALING_FACTOR nVOrigin = tuple( np.subtract(boundingBox.getCenter(), - (bbMaxLength, bbMaxLength, 0.0))) - nearVacuum = [(2, gmsh.model.occ.addRectangle(*nVOrigin, *(bbMaxLength*2.0,)*2))] + (nearVacuumBoxSize/2.0, nearVacuumBoxSize/2.0, 0.0))) + nearVacuum = [ + (2, gmsh.model.occ.addRectangle(*nVOrigin, *(nearVacuumBoxSize,)*2)) + ] - farVacuumDiameter = 4.0 * boundingBox.getDiagonal() + farVacuumDiameter = FAR_REGION_DISK_SCALING_FACTOR * boundingBox.getDiagonal() farVacuum = [(2, gmsh.model.occ.addDisk( *boundingBox.getCenter(), farVacuumDiameter, farVacuumDiameter))] From 7023e698277efd2781ca3c165e57b668c4a8c2c4 Mon Sep 17 00:00:00 2001 From: Luis Manuel Diaz Angulo Date: Fri, 4 Jul 2025 07:24:52 +0200 Subject: [PATCH 2/2] Forces specific version of gmsh --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0c66cd5..8382042 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -gmsh >= 4.11 +gmsh == 4.11 pytest >= 7.3 numpy \ No newline at end of file