Skip to content

Commit

Permalink
Merge branch 'develop' into make_examples_working
Browse files Browse the repository at this point in the history
Conflicts:
    src/porepy/fracs/fractures.py
    src/porepy/fracs/simplex.py
    src/porepy/grids/gmsh/gmsh_interface.py
    src/porepy/grids/grid.py
    src/porepy/utils/comp_geom.py
  • Loading branch information
alessiofumagalli committed Nov 2, 2017
2 parents 69242c9 + 0d38b05 commit 5a2e834
Show file tree
Hide file tree
Showing 23 changed files with 1,735 additions and 682 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
*.coverage
.cache/*
bin/*
*.pvd
*.so
*.png
6 changes: 4 additions & 2 deletions Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ The expectation is that it should work out nicely. If you try this, please let u
# Setting up GMSH
PorePy currently depends on `GMSH` for meshing of fractured domains.
To make this work, you need gmsh installed on your system, and PorePy needs to know where to look for it.
First, visit the [GMSH webpage](http://gmsh.info) and download a suitable version.
First, visit the [Gmsh webpage](http://gmsh.info) and download a suitable version.
Extract, and move the binary (probably located in the subfolder gmsh-x.x.x-Linux/bin or similar) to whereever you prefer.

Note to Linux users: Although GMSH is available through the standard packaging tools, it tends to be hopelessly outdated,
NOTE: We have experienced that some fracture geometries are best handled by somewhat older versions of Gmsh (2.11 seems to be a good version) - newer versions are often result in error messages. Until this is resolved, we therefore recommend to use Gmsh 2.11 with PorePy.

Note to Linux users: Although Gmsh is available through the standard packaging tools, it tends to be hopelessly outdated,
and resulted in severe issues for the fracture meshing last time we checked. Use the GMSH web page instead.


Expand Down
49 changes: 48 additions & 1 deletion examples/example3/test_simple_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ def test_T_intersection_within_plane(**kwargs):

domain = {'xmin':-1, 'xmax': 2, 'ymin': -2, 'ymax': 2, 'zmin': -1,
'zmax':2}
grids = meshing.simplex_grid([p1, p2], domain)
# This test, when used with certain versions of gmsh (<2.15?) gives a
# a mismatch between 2d cells and 3d faces on fracture surfaces. The bug
# can be located in the .msh-file. To function as a test, we disband the
# test of cell-face relations.
grids = meshing.simplex_grid([p1, p2], domain,
ensure_matching_face_cell=False)

def test_T_intersection_one_outside_plane(**kwargs):
p1 = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]).T
Expand All @@ -216,3 +221,45 @@ def test_T_intersection_both_outside_plane(**kwargs):
domain = {'xmin':-1, 'xmax': 2, 'ymin': -2, 'ymax': 2, 'zmin': -1,
'zmax':2}
grids = meshing.simplex_grid([p1, p2], domain)

def test_T_intersection_both_on_boundary(**kwargs):
p1 = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]).T
p2 = np.array([[0., 0.5, 0], [1, 0.5, 0], [0.5, 0.5, 1.]]).T

domain = {'xmin':-1, 'xmax': 2, 'ymin': -2, 'ymax': 2, 'zmin': -1,
'zmax':2}
grids = meshing.simplex_grid([p1, p2], domain)

def test_T_intersection_one_boundary_one_outside(**kwargs):
p1 = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]).T
p2 = np.array([[-0.2, 0.5, 0], [1, 0.5, 0], [0.5, 0.5, 1.]]).T

domain = {'xmin':-1, 'xmax': 2, 'ymin': -2, 'ymax': 2, 'zmin': -1,
'zmax':2}
grids = meshing.simplex_grid([p1, p2], domain)

def test_T_intersection_one_boundary_one_inside(**kwargs):
p1 = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]).T
p2 = np.array([[0.2, 0.5, 0], [1, 0.5, 0], [0.5, 0.5, 1.]]).T

domain = {'xmin':-1, 'xmax': 2, 'ymin': -2, 'ymax': 2, 'zmin': -1,
'zmax':2}
grids = meshing.simplex_grid([p1, p2], domain)

def test_issue_54():
mesh_kwargs = {}
mesh_size = 5e-1
mesh_kwargs['mesh_size'] = {'mode': 'constant',
'value': mesh_size, 'bound_value': 1.2*mesh_size}
mesh_kwargs['file_name'] = 'bounding_box_test'
domain = {'xmin': -1, 'xmax': 1,
'ymin': 0, 'ymax': 1,
'zmin': 0, 'zmax': 1}
f_1 = np.array([[.5,.5,.5,.5],
[.4,.5,.5,.4],
[0.2,0.2,.8,.8]])
f_2 = np.array([[0,.8,.8,0],
[.5,.5,.5,.5],
[0.2,0.2,.8,.8]])
grids = meshing.simplex_grid([f_1, f_2], domain,
ensure_matching_face_cell=False)
Loading

0 comments on commit 5a2e834

Please sign in to comment.