Skip to content

Commit

Permalink
Make the topology simplification reset a public method
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Oct 21, 2024
1 parent 9002ab4 commit 3edfd08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/tespy/networks/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ def presolve_fluid_topology(self):
}
self.num_conn_vars += 1

def _reset_topology_reduction_specifications(self):
def reset_topology_reduction_specifications(self):
for c in self.conns["object"]:
if hasattr(c, "_m_tmp"):
value = c.m.val_SI
Expand Down Expand Up @@ -1963,7 +1963,7 @@ def solve(self, mode, init_path=None, design_path=None,
self.initialise()

if init_only:
self._reset_topology_reduction_specifications()
self.reset_topology_reduction_specifications()
return

msg = 'Starting solver.'
Expand All @@ -1974,7 +1974,7 @@ def solve(self, mode, init_path=None, design_path=None,
self.solve_loop(print_results=print_results)

if not prepare_fast_lane:
self._reset_topology_reduction_specifications()
self.reset_topology_reduction_specifications()

if self.lin_dep:
msg = (
Expand Down
3 changes: 2 additions & 1 deletion tutorial/advanced/starting_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
nw.solve("design")
except ValueError as e:
print(e)
nw._reset_topology_reduction_specifications()
nw.reset_topology_reduction_specifications()

# %%[sec_4]
import CoolProp.CoolProp as CP

Expand Down

0 comments on commit 3edfd08

Please sign in to comment.