Skip to content

Commit 4799740

Browse files
authored
Merge pull request #16 from OpenSEMBA/dev
Dev
2 parents 5f7d670 + 6a7f2ca commit 4799740

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
gmsh >= 4.11
1+
gmsh == 4.11
22
pytest >= 7.3
33
numpy

src/ShapesClassification.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def _buildClosedVacuumDomain(self) -> Tuple[int, int]:
125125
return dict([[0, dom]])
126126

127127
def _buildDefaultVacuumDomain(self):
128+
NEAR_REGION_BOUNDING_BOX_SCALING_FACTOR = 1.2
129+
FAR_REGION_DISK_SCALING_FACTOR = 4.0
128130
nonVacuumSurfaces = []
129131
for _, surf in self.pecs.items():
130132
nonVacuumSurfaces.extend(surf)
@@ -135,12 +137,15 @@ def _buildDefaultVacuumDomain(self):
135137

136138

137139
bbMaxLength = np.max(boundingBox.getLengths())
140+
nearVacuumBoxSize = bbMaxLength*NEAR_REGION_BOUNDING_BOX_SCALING_FACTOR
138141
nVOrigin = tuple(
139142
np.subtract(boundingBox.getCenter(),
140-
(bbMaxLength, bbMaxLength, 0.0)))
141-
nearVacuum = [(2, gmsh.model.occ.addRectangle(*nVOrigin, *(bbMaxLength*2.0,)*2))]
143+
(nearVacuumBoxSize/2.0, nearVacuumBoxSize/2.0, 0.0)))
144+
nearVacuum = [
145+
(2, gmsh.model.occ.addRectangle(*nVOrigin, *(nearVacuumBoxSize,)*2))
146+
]
142147

143-
farVacuumDiameter = 4.0 * boundingBox.getDiagonal()
148+
farVacuumDiameter = FAR_REGION_DISK_SCALING_FACTOR * boundingBox.getDiagonal()
144149
farVacuum = [(2, gmsh.model.occ.addDisk(
145150
*boundingBox.getCenter(),
146151
farVacuumDiameter, farVacuumDiameter))]

0 commit comments

Comments
 (0)