Skip to content

Commit

Permalink
minor bugfix in sesam reader
Browse files Browse the repository at this point in the history
  • Loading branch information
Krande committed Feb 5, 2024
1 parent 9890a08 commit 9c5e917
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/ada/fem/formats/sesam/read/read_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from operator import itemgetter
from typing import TYPE_CHECKING

from ada.config import logger
from ada.fem import FemSet
from ada.fem.containers import FemSets
from ada.fem.formats.utils import str_to_int
Expand Down Expand Up @@ -40,10 +41,12 @@ def get_setmap(m, parent):
def get_femsets(m, set_map, parent) -> FemSet:
d = m.groupdict()
isref = str_to_int(d["isref"])
fem_set = FemSet(
d["set_name"].strip(),
set_map[isref][0],
set_map[isref][1],
parent=parent,
)
set_name = d["set_name"].strip()
try:
isref_set = set_map[isref]
except KeyError:
logger.info(f"Set ID={isref} [{set_name=}] is likely an empty set.")
isref_set = [[], "nset"]

fem_set = FemSet(set_name, isref_set[0], isref_set[1], parent=parent)
return fem_set

0 comments on commit 9c5e917

Please sign in to comment.