From 1971a04caa5a076c73c9f0bf55219fc2cd1edbc0 Mon Sep 17 00:00:00 2001 From: enrico facca Date: Thu, 1 Aug 2024 17:46:57 +0200 Subject: [PATCH] removed print from dmk --- src/darsia/measure/wasserstein.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/darsia/measure/wasserstein.py b/src/darsia/measure/wasserstein.py index f278c628..227526fe 100644 --- a/src/darsia/measure/wasserstein.py +++ b/src/darsia/measure/wasserstein.py @@ -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. @@ -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) @@ -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 @@ -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) @@ -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)