Skip to content

Commit

Permalink
fix: interpolator map support map for all 2d supports
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Jun 4, 2024
1 parent 4be3370 commit 547fea0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 6 additions & 3 deletions LoopStructural/interpolators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ class InterpolatorType(IntEnum):
2: SupportType.StructuredGrid2D,
3: SupportType.StructuredGrid,
},
InterpolatorType.DISCRETE_FOLD: SupportType.TetMesh,
InterpolatorType.PIECEWISE_LINEAR: SupportType.TetMesh,
InterpolatorType.PIECEWISE_QUADRATIC: SupportType.P2UnstructuredTetMesh,
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
6 changes: 1 addition & 5 deletions LoopStructural/interpolators/_interpolator_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ def create_interpolator(
interpolatortype = interpolator_string_map[interpolatortype]
if support is None:
# raise Exception("Support must be specified")
if interpolatortype is InterpolatorType.FINITE_DIFFERENCE:

supporttype = support_interpolator_map[interpolatortype][boundingbox.dimensions]

else:
supporttype = support_interpolator_map[interpolatortype]
supporttype = support_interpolator_map[interpolatortype][boundingbox.dimensions]

support = SupportFactory.create_support_from_bbox(
supporttype,
Expand Down

0 comments on commit 547fea0

Please sign in to comment.