porepy.fracs.simplex module

Module for creating simplex grids with fractures.

line_grid_from_gmsh(file_name, constraints=None, **kwargs)[source]

Generate a list of grids dimensions {1, 0}, starting from a gmsh mesh.

Parameters
  • file_name (str) – Path to file of gmsh.msh specification.

  • constraints (np.array, optional) – Index of fracture lines that are constraints in the meshing, but should not have a lower-dimensional mesh. Defaults to empty.

Returns

grids in 2d, 1d and 0d. If no grids exist in a

specified dimension, the inner list will be empty.

Return type

list of list of grids

tetrahedral_grid_from_gmsh(file_name, constraints=None, **kwargs)[source]

Generate a list of grids of dimensions {3, 2, 1, 0}, starting from a gmsh mesh.

Parameters
  • file_name (str) – Path to file of gmsh.msh specification.

  • TODO – Line tag is unused. Maybe surface_tag replaces it?? Fix docs. This documentation is copied from mesh_2_grid.create_2d_grids().

  • constraints (np.array, optional) – Array with lists of lines that should not become grids. The array items should match the INDEX in line_tag, see above.

Returns

grids in 2d, 1d and 0d. If no grids exist in a

specified dimension, the inner list will be empty.

Return type

list of list of grids

triangle_grid_embedded(file_name)[source]

Create triangular (2D) grid of a domain embedded in 3D space, without meshing the 3D volume.

The resulting grid can be used in a DFN model. The grid will be fully conforming along intersections between fractures.

This function produces a set of grids for fractures and lower-dimensional objects, but it does nothing to merge the grids. To create a MixedDimensionalGrid, use the function fracs.meshing.dfn instead, with the option conforming=True.

To set the mesh size, use parameters mesh_size_frac and mesh_size_min, to represent the ideal and minimal mesh size sent to gmsh. For more details, see the gmsh manual on how to set mesh sizes.

Parameters

file_name (str, optional) – Filename for communication with gmsh. The config file for gmsh will be f_name.geo, with the grid output to f_name.msh. Defaults to dfn_network.

Returns

For each dimension (2 -> 0), a list of all grids in

that dimension.

Return type

list (length 3)

triangle_grid_from_gmsh(file_name, constraints=None, **kwargs)[source]

Generate a list of grids dimensions {2, 1, 0}, starting from a gmsh mesh.

Parameters
  • file_name (str) – Path to file of gmsh.msh specification.

  • constraints (np.array, optional) – Index of fracture lines that are constraints in the meshing, but should not have a lower-dimensional mesh. Defaults to empty.

Returns

grids in 2d, 1d and 0d. If no grids exist in a

specified dimension, the inner list will be empty.

Return type

list of list of grids