IDAES / idaes-pse

The IDAES Process Systems Engineering Framework
https://idaes-pse.readthedocs.io/
Other
216 stars 232 forks source link

Fix PETSc scaling and unscaling #1410

Open dallan-keylogic opened 4 months ago

dallan-keylogic commented 4 months ago

Presently, PETSc ignores the active attribute of scaling suffixes and scales/unscales the corresponding blocks anyway. It needs to be fixed to take this attribute into account and probably modified to look for scaling suffixes in more places than it looks now (either the component's parent block or the overall model) using Pyomo's suffix locator:

from pyomo.core.base.suffix import SuffixFinder

suffix_finder = SuffixFinder('scaling_factor', 1.0)
suffix_finder.find(component)