Skip to content

Commit

Permalink
FIX Solve ordering issue with TBROM having more than 10 modes (#114)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Boucinha <108674439+lboucin@users.noreply.github.com>
  • Loading branch information
chrpetre and lboucin authored Sep 12, 2023
1 parent 741ce42 commit aab47af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ansys/pytwin/evaluate/twin_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,12 @@ def _tbrom_init(self, tbrom: TbRom):
for field in tbrom.field_input_names:
inmcs = dict()
for i in range(0, len(tbrom._infbasis[field])):
input_port_name = self._field_input_port_name(field, i, tbrom.name)
for key, item in self.inputs.items():
input_port_name = self._field_input_port_name(field, i, tbrom.name)
if input_port_name in key:
inmcs.update({key: item})
break
# e.g. inputfield_mode_1 has been found but we don't want to pick inputfield_mode_10 yet
if len(inmcs) == len(tbrom._infbasis[field]):
infmcs.update({field: inmcs})
hasinfmcs.update({field: True})
Expand All @@ -648,10 +650,12 @@ def _tbrom_init(self, tbrom: TbRom):

outmcs = dict()
for i in range(1, len(tbrom._outbasis) + 1):
output_port_name = self._field_output_port_name(i, tbrom.name)
for key, item in self.outputs.items():
output_port_name = self._field_output_port_name(i, tbrom.name)
if output_port_name in key:
outmcs.update({key: item})
break
# e.g. outField_mode_1 has been found but we don't want to pick outField_mode_10 yet
if len(outmcs) == len(tbrom._outbasis):
tbrom._outmcs = outmcs
tbrom._hasoutmcs = True
Expand Down

0 comments on commit aab47af

Please sign in to comment.