Skip to content

Commit

Permalink
MAINT: Initialize distance for robustness.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwboth committed Nov 5, 2023
1 parent c7c646d commit 284b9c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/darsia/measure/wasserstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,9 @@ def _solve(self, flat_mass_diff: np.ndarray) -> tuple[float, np.ndarray, dict]:
self.darcy_init.copy(), rhs.copy(), solution_i
)

# Initialize distance in case below iteration fails
new_distance = 0

# Initialize container for storing the convergence history
convergence_history = {
"distance": [],
Expand Down Expand Up @@ -1489,6 +1492,9 @@ def _solve(self, flat_mass_diff: np.ndarray) -> tuple[float, np.ndarray, dict]:
self.darcy_init.copy(), rhs.copy(), solution_i
)

# Initialize distance in case below iteration fails
new_distance = 0

# Initialize container for storing the convergence history
convergence_history = {
"distance": [],
Expand Down

0 comments on commit 284b9c6

Please sign in to comment.