Skip to content

Commit

Permalink
[Eq] Cleaned up old comments in models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arpastrana committed Jan 27, 2025
1 parent c90c605 commit 37cc7ef
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/jax_fdm/equilibrium/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ def equilibrium_iterative_fn(params, xyz_init):
"""
This closure function avoids re-computing A and f_fixed throughout iterations
because these two matrices remain constant during the fixed point search.
TODO: Extract closure into function shared with the other nodes equilibrium function?
"""
# TODO: Extract closure into function shared with the other nodes equilibrium function?
A, f_fixed, xyz_fixed, load_state = params

free = structure.indices_free
Expand All @@ -242,22 +241,17 @@ def equilibrium_iterative_fn(params, xyz_init):
"eta": eta,
"verbose": verbose,
"implicit": True}
# For jaxopt compatibility (as it does not support sparse matrices yet)
# "implicit": False if self.linearsolve_fn is spsolve else True}

solver_kwargs = {"solver_config": solver_config,
"f": equilibrium_iterative_fn,
"a": (A, f_fixed, xyz_fixed, load_state),
"x_init": xyz_init}

if implicit_diff:
# xyz_new = fixed_point(solver, **solver_kwargs)
return fixed_point(solver, **solver_kwargs)

# xyz_new = solver(**solver_kwargs)
return solver(**solver_kwargs)

# return xyz_new

# ----------------------------------------------------------------------
# Equilibrium state
Expand Down

0 comments on commit 37cc7ef

Please sign in to comment.