Skip to content

Commit

Permalink
removed print from dmk
Browse files Browse the repository at this point in the history
  • Loading branch information
enricofacca committed Aug 1, 2024
1 parent 70b5a9a commit 1971a04
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/darsia/measure/wasserstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,11 @@ def __init__(self, grid, options) -> None:

self._setup_discretization()

self.kappa = self.options.get("kappa", np.ones(self.grid.shape,dtype=float))
"""np.ndarray: kappa"""
self.kappa_faces = darsia.cell_to_face_average(self.grid, self.kappa, mode="harmonic")
"""np.ndarray: kappa on faces"""

def _setup_discretization(self) -> None:
"""Setup of fixed discretization operators.
Expand Down Expand Up @@ -1775,7 +1780,7 @@ def setup_elliptic_solver(self, transport_density, rtol=1e-6):
"ksp_rtol": rtol,
"ksp_maxit": 100,
"pc_type": "hypre",
"ksp_monitor": None,
#"ksp_monitor": None,
}
weighted_Poisson_solver.setup(weighted_Poisson_ksp_ctrl)

Expand Down Expand Up @@ -1851,7 +1856,7 @@ def _solve(self,
start = time.time()

# udpate transport density
update = self.transport_density * ( np.abs(gradient_pressure) - kappa_faces)
update = self.transport_density * ( np.abs(gradient_pressure) - self.kappa_faces)
deltat = min(deltat * 1.05, 0.5)
self.transport_density += deltat * update
min_tdens = 1e-10
Expand Down Expand Up @@ -2121,7 +2126,7 @@ def _setup_discretization(self) -> None:
"ksp_rtol": 1e-6,
"ksp_maxit": 100,
"pc_type": "hypre",
"ksp_monitor": None,
#"ksp_monitor": None,
}
self.Poisson_solver.setup(self.Poisson_ksp_ctrl)

Expand Down Expand Up @@ -2177,7 +2182,7 @@ def compute_pressure(self, flux: np.ndarray, forcing: np.array) -> np.ndarray:
"ksp_rtol": 1e-6,
"ksp_maxit": 100,
"pc_type": "hypre",
"ksp_monitor": None,
#"ksp_monitor": None,
}
self.weighted_Poisson_solver.setup(self.weighted_Poisson_ksp_ctrl)
pressure = self.weighted_Poisson_solver.solve(forcing)
Expand Down

0 comments on commit 1971a04

Please sign in to comment.