Skip to content

Commit

Permalink
update test_tpfaMultiDim
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiofumagalli committed Nov 2, 2017
1 parent 4dfd7d5 commit 69242c9
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions test/integration/test_tpfaMultiDim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import unittest

from porepy.numerics.fv.tpfa import TpfaMixDim
from porepy.fracs import meshing
Expand Down Expand Up @@ -55,28 +56,30 @@ def check_pressures(gb):
p_diff = pressure - pressure_analytic
assert np.max(np.abs(p_diff)) < 0.033

def test_uniform_flow_cart_2d_1d_cartesian():
# Structured Cartesian grid
gb = setup_2d_1d(np.array([10, 10]))
class BasicsTest(unittest.TestCase):

# Python inverter is most efficient for small problems
flux_discr = TpfaMixDim('flow')
A, rhs = flux_discr.matrix_rhs(gb)
p = np.linalg.solve(A.A, rhs)
def test_uniform_flow_cart_2d_1d_cartesian(self):
# Structured Cartesian grid
gb = setup_2d_1d(np.array([10, 10]))

flux_discr.solver.split(gb, 'pressure', p)
# Python inverter is most efficient for small problems
flux_discr = TpfaMixDim('flow')
A, rhs = flux_discr.matrix_rhs(gb)
p = np.linalg.solve(A.A, rhs)

check_pressures(gb)
flux_discr.solver.split(gb, 'pressure', p)

def test_uniform_flow_cart_2d_1d_simplex():
# Unstructured simplex grid
gb = setup_2d_1d(np.array([10, 10]), simplex_grid=True)
check_pressures(gb)

# Python inverter is most efficient for small problems
flux_discr = TpfaMixDim('flow')
A, rhs = flux_discr.matrix_rhs(gb)
p = np.linalg.solve(A.A, rhs)
def test_uniform_flow_cart_2d_1d_simplex(self):
# Unstructured simplex grid
gb = setup_2d_1d(np.array([10, 10]), simplex_grid=True)

flux_discr.solver.split(gb, 'pressure', p)
# Python inverter is most efficient for small problems
flux_discr = TpfaMixDim('flow')
A, rhs = flux_discr.matrix_rhs(gb)
p = np.linalg.solve(A.A, rhs)

check_pressures(gb)
flux_discr.solver.split(gb, 'pressure', p)

check_pressures(gb)

0 comments on commit 69242c9

Please sign in to comment.