Skip to content

Commit 078b3e5

Browse files
authored
Merge pull request Loop3D#196 from Loop3D/2d_3d_support
fix: auto select support dimension
2 parents d2e7e95 + 547fea0 commit 078b3e5

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

LoopStructural/interpolators/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,16 @@ class InterpolatorType(IntEnum):
9090
}
9191

9292
support_interpolator_map = {
93-
InterpolatorType.FINITE_DIFFERENCE: SupportType.StructuredGrid,
94-
InterpolatorType.DISCRETE_FOLD: SupportType.TetMesh,
95-
InterpolatorType.PIECEWISE_LINEAR: SupportType.TetMesh,
96-
InterpolatorType.PIECEWISE_QUADRATIC: SupportType.P2UnstructuredTetMesh,
93+
InterpolatorType.FINITE_DIFFERENCE: {
94+
2: SupportType.StructuredGrid2D,
95+
3: SupportType.StructuredGrid,
96+
},
97+
InterpolatorType.DISCRETE_FOLD: {3: SupportType.TetMesh, 2: SupportType.P1Unstructured2d},
98+
InterpolatorType.PIECEWISE_LINEAR: {3: SupportType.TetMesh, 2: SupportType.P1Unstructured2d},
99+
InterpolatorType.PIECEWISE_QUADRATIC: {
100+
3: SupportType.P2UnstructuredTetMesh,
101+
2: SupportType.P2Unstructured2d,
102+
},
97103
}
98104

99-
100105
from ._interpolator_factory import InterpolatorFactory

LoopStructural/interpolators/_interpolator_factory.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def create_interpolator(
3030
interpolatortype = interpolator_string_map[interpolatortype]
3131
if support is None:
3232
# raise Exception("Support must be specified")
33-
supporttype = support_interpolator_map[interpolatortype]
33+
34+
supporttype = support_interpolator_map[interpolatortype][boundingbox.dimensions]
35+
3436
support = SupportFactory.create_support_from_bbox(
3537
supporttype,
3638
bounding_box=boundingbox,

0 commit comments

Comments
 (0)