porepy.fracs.fracture_importer module
- dfm_3d_from_fab(file_name, tol=1e-4, domain=None, return_domain=False, **mesh_kwargs)[source]
Create the grid bucket from a set of 3d fractures stored in a fab file and domain.
- Parameters
- Returns
the mixed-dimensional grid
- Return type
mdg
- dfm_from_gmsh(file_name, dim, **kwargs)[source]
Generate a MixedDimensionalGrid from a gmsh file.
If the provided file is input for gmsh (.geo, not .msh), gmsh will be called to generate the mesh before the MixedDimensionalGrid is constructed.
- Parameters
- Returns
Mixed-dimensional grid as contained in the gmsh file.
- Return type
- elliptic_network_3d_from_csv(file_name, has_domain=True, tol=1e-4, degrees=False)[source]
Create the fracture network from a set of 3d fractures stored in a csv file and domain. In the csv file, we assume the following structure - first line (optional) describes the domain as a rectangle with
X_MIN, Y_MIN, Z_MIN, X_MAX, Y_MAX, Z_MAX
the other lines describe the N fractures as a elliptic fractures: center_x, center_y, center_z, major_axis, minor_axis, major_axis_angle,
strike_angle, dip_angle, num_points.
See create_elliptic_fracture for information about the parameters
Lines that start with a # are ignored.
Parameters
- file_name
Name of the file
- has_domain
Whether the first line in the csv file specify the domain
- tol
Tolerance for geometry related methods (snapping etc.) of FractureNetwork3d. Defaults to 1e-4.
# TODO document argument degrees
Returns
- FractureNetwork3d
the fracture network
- network_2d_from_csv(f_name, tagcols=None, tol=1e-8, max_num_fracs=None, polyline=False, return_frac_id=False, domain=None, **kwargs)[source]
Read csv file with fractures to obtain fracture description.
Create the mixed-dimensional grid from a set of fractures stored in a csv file and a domain. In the csv file, we assume one of the two following structures:
FID, START_X, START_Y, END_X, END_Y
FID, PT_X, PT_Y
Format a) is used to describe fractures consisting of a straight line. FID is the fracture id, START_X and START_Y are the abscissa and coordinate of the starting point, and END_X and END_Y are the abscissa and coordinate of the ending point.
Format b) can be used to describe polyline fractures: Each row in the file represents a separate points, points with the same FID will be assigned to the same fracture in the order specified in the file.
To change the delimiter from the default comma, use kwargs passed to np.genfromtxt.
The csv file is assumed to have a header of 1 line. To change this number, use kwargs skip_header.
- Parameters
f_name (
str
) – Path to csv filetagcols (
array-like, int. Optional
) – Column index where fracture tags are stored. 0-offset. Defaults to no columns.tol (
double, optional
) – Tolerance for merging points with almost equal coordinates.max_num_fracs (
int, optional
) – Maximum number of fractures included, counting from the start of the file. Defaults to inclusion of all fractures.**kwargs – keyword arguments passed on to np.genfromtxt.
- Returns
Network representation of the fractures
- Return type
- Raises
ValueError – If a fracture of a single point is specified.
- network_3d_from_csv(file_name, has_domain=True, tol=1e-4, **kwargs)[source]
Create the fracture network from a set of 3d fractures stored in a csv file and domain. In the csv file, we assume the following structure - first line (optional) describes the domain as a rectangle with
X_MIN, Y_MIN, Z_MIN, X_MAX, Y_MAX, Z_MAX
the other lines descibe the N fractures as a list of points P0_X, P0_Y, P0_Z, …,PN_X, PN_Y, PN_Z
Lines that start with a # are ignored.
- Parameters
- Returns
the fracture network
- Return type
network
- network_3d_from_fab(f_name, return_all=False, tol=None)[source]
Read fractures from a .fab file, as specified by FracMan.
The filter is based on the .fab-files available at the time of writing, and may not cover all options available.
- Parameters
- Returns
the network of fractures tess_fracs (optional returned if return_all==True, list of np.ndarray):
Each list element contains fracture cut by the domain boundary, represented by vertexes as a nd x n_pt array.
- tess_sgn (optional returned if return_all==True, np.ndarray):
For each element in tess_frac, a +-1 defining which boundary the fracture is on.
- Return type
network
The function also reads in various other information of unknown usefulness, see implementation for details. This information is currently not returned.