Skip to content

Commit

Permalink
Enhanced meshing of fractured domains in 3d.
Browse files Browse the repository at this point in the history
Enhanced robustness of fracture intersection methods.
Less complex export routine to Gmsh, smaller chances of failure.
Several performance enhancements.
Automatic tuning of mesh size in 3d.
Simple functionality for extrusion of fractures from 2d outcrop to 3d.
  • Loading branch information
keileg authored Nov 2, 2017
2 parents 466013c + 5e5f48d commit 0d38b05
Show file tree
Hide file tree
Showing 26 changed files with 2,959 additions and 738 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,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
71 changes: 70 additions & 1 deletion examples/example3/test_simple_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,73 @@ def test_two_fractures_L_intersection_one_displaced(**kwargs):
else:
return grids


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

domain = {'xmin':-1, 'xmax': 2, 'ymin': -2, 'ymax': 2, 'zmin': -1,
'zmax':2}
# 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
p2 = np.array([[0.5, 0.5, 1], [0.5, 0.5, 0], [0.5, 1.9, 0.]]).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_both_outside_plane(**kwargs):
p1 = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]).T
p2 = np.array([[0.5, 0.5, 1], [0.5, -0.5, 0], [0.5, 1.9, 0.]]).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_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 0d38b05

Please sign in to comment.