Skip to content

Commit 547fea0

Browse files
committed
fix: interpolator map support map for all 2d supports
1 parent 4be3370 commit 547fea0

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

LoopStructural/interpolators/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ class InterpolatorType(IntEnum):
102102
2: SupportType.StructuredGrid2D,
103103
3: SupportType.StructuredGrid,
104104
},
105-
InterpolatorType.DISCRETE_FOLD: SupportType.TetMesh,
106-
InterpolatorType.PIECEWISE_LINEAR: SupportType.TetMesh,
107-
InterpolatorType.PIECEWISE_QUADRATIC: SupportType.P2UnstructuredTetMesh,
105+
InterpolatorType.DISCRETE_FOLD: {3: SupportType.TetMesh, 2: SupportType.P1Unstructured2d},
106+
InterpolatorType.PIECEWISE_LINEAR: {3: SupportType.TetMesh, 2: SupportType.P1Unstructured2d},
107+
InterpolatorType.PIECEWISE_QUADRATIC: {
108+
3: SupportType.P2UnstructuredTetMesh,
109+
2: SupportType.P2Unstructured2d,
110+
},
108111
}
109112

110113
from ._interpolator_factory import InterpolatorFactory

LoopStructural/interpolators/_interpolator_factory.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ def create_interpolator(
3030
interpolatortype = interpolator_string_map[interpolatortype]
3131
if support is None:
3232
# raise Exception("Support must be specified")
33-
if interpolatortype is InterpolatorType.FINITE_DIFFERENCE:
3433

35-
supporttype = support_interpolator_map[interpolatortype][boundingbox.dimensions]
36-
37-
else:
38-
supporttype = support_interpolator_map[interpolatortype]
34+
supporttype = support_interpolator_map[interpolatortype][boundingbox.dimensions]
3935

4036
support = SupportFactory.create_support_from_bbox(
4137
supporttype,

0 commit comments

Comments
 (0)