Skip to content

Commit

Permalink
using different direct solver
Browse files Browse the repository at this point in the history
  • Loading branch information
enricofacca committed Aug 22, 2024
1 parent f17b453 commit d58e565
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/darsia/measure/wasserstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def __init__(
- "direct": direct solver
- "amg": algebraic multigrid solver
- "cg": conjugate gradient solver preconditioned with AMG
- "ksp": PETSc KSP solver
- formulation (str): formulation of the linear system. Defaults to
"pressure". Supported formulations are:
- "full": full system
Expand Down Expand Up @@ -462,6 +463,7 @@ def setup_ksp_solver(self, matrix: sps.csc_matrix) -> None:
kernel = kernel / np.linalg.norm(kernel)
nullspace=[kernel]
self.linear_solver = darsia.linalg.KSP(matrix)#, nullspace=nullspace)


# Define solver options
linear_solver_options = self.options.get("linear_solver_options", {})
Expand All @@ -472,7 +474,8 @@ def setup_ksp_solver(self, matrix: sps.csc_matrix) -> None:
if approach == "direct":
self.solver_options = {
"ksp_type": "preonly",
'pc_type': 'lu',
'pc_type': 'lu',
"pc_factor_mat_solver_type": "mumps",
}
else:
self.solver_options = {
Expand Down

0 comments on commit d58e565

Please sign in to comment.