Skip to content

Commit

Permalink
update mpfa test
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiofumagalli committed Nov 2, 2017
1 parent 58d96d0 commit 4dfd7d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/example4/test_mpfa_varing_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from porepy.grids import structured, simplex

from porepy.numerics.fv import mpfa
from porepy.numerics.fv import source

#------------------------------------------------------------------------------#

Expand Down Expand Up @@ -78,7 +79,8 @@ def main(N):

# Choose and define the solvers
solver = mpfa.Mpfa('flow')
A, b = solver.matrix_rhs(g, data)
A, _ = solver.matrix_rhs(g, data)
_, b = source.Integral('flow').matrix_rhs(g, data)
p = sps.linalg.spsolve(A, b)

diam = np.amax(g.cell_diameters())
Expand Down
5 changes: 4 additions & 1 deletion examples/example4/test_mpfa_varing_k_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import porepy.utils.comp_geom as cg

from porepy.numerics.fv import mpfa
from porepy.numerics.fv import source

#------------------------------------------------------------------------------#

Expand Down Expand Up @@ -72,6 +73,7 @@ def error_p(g, p):

def main(N):
Nx = Ny = N

#g = structured.CartGrid([Nx, Ny], [1, 1])
g = simplex.StructuredTriangleGrid([Nx, Ny], [1, 1])
R = cg.rot(np.pi/4., [1,0,0])
Expand All @@ -83,7 +85,8 @@ def main(N):

# Choose and define the solvers
solver = mpfa.Mpfa('flow')
A, b = solver.matrix_rhs(g, data)
A, _ = solver.matrix_rhs(g, data)
_, b = source.Integral('flow').matrix_rhs(g, data)
p = sps.linalg.spsolve(A, b)

diam = np.amax(g.cell_diameters())
Expand Down
4 changes: 3 additions & 1 deletion examples/example4/test_mpfa_varing_k_surface_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import porepy.utils.comp_geom as cg

from porepy.numerics.fv import mpfa
from porepy.numerics.fv import source

#------------------------------------------------------------------------------#

Expand Down Expand Up @@ -79,7 +80,8 @@ def main(N):

# Choose and define the solvers
solver = mpfa.Mpfa('flow')
A, b = solver.matrix_rhs(g, data)
A, _ = solver.matrix_rhs(g, data)
_, b = source.Integral('flow').matrix_rhs(g, data)
p = sps.linalg.spsolve(A, b)

diam = np.amax(g.cell_diameters())
Expand Down

0 comments on commit 4dfd7d5

Please sign in to comment.