diff --git a/LoopStructural/interpolators/__init__.py b/LoopStructural/interpolators/__init__.py index 1b311f9d..272fe206 100644 --- a/LoopStructural/interpolators/__init__.py +++ b/LoopStructural/interpolators/__init__.py @@ -98,11 +98,16 @@ class InterpolatorType(IntEnum): } support_interpolator_map = { - InterpolatorType.FINITE_DIFFERENCE: SupportType.StructuredGrid, - InterpolatorType.DISCRETE_FOLD: SupportType.TetMesh, - InterpolatorType.PIECEWISE_LINEAR: SupportType.TetMesh, - InterpolatorType.PIECEWISE_QUADRATIC: SupportType.P2UnstructuredTetMesh, + InterpolatorType.FINITE_DIFFERENCE: { + 2: SupportType.StructuredGrid2D, + 3: SupportType.StructuredGrid, + }, + InterpolatorType.DISCRETE_FOLD: {3: SupportType.TetMesh, 2: SupportType.P1Unstructured2d}, + InterpolatorType.PIECEWISE_LINEAR: {3: SupportType.TetMesh, 2: SupportType.P1Unstructured2d}, + InterpolatorType.PIECEWISE_QUADRATIC: { + 3: SupportType.P2UnstructuredTetMesh, + 2: SupportType.P2Unstructured2d, + }, } - from ._interpolator_factory import InterpolatorFactory diff --git a/LoopStructural/interpolators/_interpolator_factory.py b/LoopStructural/interpolators/_interpolator_factory.py index 058e007a..c154cd2d 100644 --- a/LoopStructural/interpolators/_interpolator_factory.py +++ b/LoopStructural/interpolators/_interpolator_factory.py @@ -30,7 +30,9 @@ def create_interpolator( interpolatortype = interpolator_string_map[interpolatortype] if support is None: # raise Exception("Support must be specified") - supporttype = support_interpolator_map[interpolatortype] + + supporttype = support_interpolator_map[interpolatortype][boundingbox.dimensions] + support = SupportFactory.create_support_from_bbox( supporttype, bounding_box=boundingbox,