Skip to content

Commit

Permalink
Revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriyzabegaev committed Mar 13, 2024
1 parent b2746da commit 33b9366
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
13 changes: 7 additions & 6 deletions examples/mandel_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np
import porepy as pp
import scipy.sparse
from mandel_biot import MandelSetup as MandelSetup_
from porepy.examples.mandel_biot import MandelSetup as MandelSetup_
from mandel_solvers import MandelSolverAssembler
from porepy_common import PorepyNewtonSolver, PorepySimulation
from scipy.sparse import csr_matrix
Expand Down Expand Up @@ -125,16 +125,16 @@ def get_fixed_stress_stabilization(self, l_factor: float) -> csr_matrix:

units = pp.Units(
# m=1e-3,
# kg=1e3,
kg=1e9,
)

ls = 1 / units.m # length scaling

mandel_solid_constants = {
"lame_lambda": 1.65e9 * 1e-6, # [MPa]
"shear_modulus": 2.475e9 * 1e-6, # [MPa]
"specific_storage": 6.0606e-11 * 1e6, # [MPa^-1]
"permeability": 9.869e-14 * 1e6, # [mm^2]
"lame_lambda": 1.65e9, # [Pa]
"shear_modulus": 2.475e9, # [Pa]
"specific_storage": 6.0606e-11, # [Pa^-1]
"permeability": 9.869e-14, # [m^2]
"biot_coefficient": 1.0, # [-]
}

Expand All @@ -161,6 +161,7 @@ def make_mandel_setup(
"meshing_arguments": {
"cell_size": cell_size * ls,
},
'units': units,
"time_manager": time_manager,
"material_constants": {
"solid": pp.SolidConstants(mandel_solid_constants),
Expand Down
8 changes: 3 additions & 5 deletions examples/solvers_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,15 @@ def solve(self, b, x0=None, tol: Optional[float] = None):
res_0 = np.linalg.norm(b)
else:
res_0 = np.linalg.norm(self.mat.dot(x0) - b)
x, info = gmres(
x, info = pyamg.krylov.gmres(
A=self.mat,
b=b,
x0=x0,
tol=tol,
atol=0,
restart=restart,
maxiter=maxiter * restart,
maxiter=maxiter,
M=self.preconditioner.aslinearoperator(),
callback=self.gmres_callback,
callback_type="legacy",
restrt=restart,
)

res_end = np.linalg.norm(self.mat.dot(x) - b)
Expand Down

0 comments on commit 33b9366

Please sign in to comment.