resqpy.grid_surface.find_faces_to_represent_surface_regular_optimised

resqpy.grid_surface.find_faces_to_represent_surface_regular_optimised(grid, surface, name, title=None, centres=None, agitate=False, feature_type='fault', is_curtain=False, progress_fn=None, consistent_side=False, return_properties=None, raw_bisector=False)[source]

Returns a grid connection set containing those cell faces which are deemed to represent the surface.

Parameters:
  • grid (RegularGrid) – the grid for which to create a grid connection set representation of the surface; must be aligned, ie. I with +x, J with +y, K with +z and local origin of (0.0, 0.0, 0.0)

  • surface (Surface) – the surface to be intersected with the grid

  • name (str) – the feature name to use in the grid connection set

  • title (str, optional) – the citation title to use for the grid connection set; defaults to name

  • centres (numpy float array of shape (nk, nj, ni, 3), optional) – DEPRECATED, no longer used

  • agitate (bool, default False) – if True, the points of the surface are perturbed by a small random offset, which can help if the surface has been built from a regular mesh with a periodic resonance with the grid

  • feature_type (str, default 'fault') – ‘fault’, ‘horizon’ or ‘geobody boundary’

  • is_curtain (bool, default False) – if True, only the top layer of the grid is processed and the bisector property, if requested, is generated with indexable element columns

  • (f(x (progress_fn) – float), optional): a callback function to be called at intervals by this function; the argument will progress from 0.0 to 1.0 in unspecified and uneven increments

  • consistent_side (bool, default False) – DEPRECATED; True will result in an assertion exception

  • return_properties (List[str]) – if present, a list of property arrays to calculate and return as a dictionary; recognised values in the list are ‘triangle’, ‘depth’, ‘offset’, ‘flange bool’, ‘grid bisector’, or ‘grid shadow’; triangle is an index into the surface triangles of the triangle detected for the gcs face; depth is the z value of the intersection point of the inter-cell centre vector with a triangle in the surface; offset is a measure of the distance between the centre of the cell face and the intersection point; grid bisector is a grid cell boolean property holding True for the set of cells on one side of the surface, deemed to be shallower; grid shadow is a grid cell int8 property holding 0: cell neither above nor below a K face of the gridded surface, 1 cell is above K face(s), 2 cell is below K face(s), 3 cell is between K faces; the returned dictionary has the passed strings as keys and numpy arrays as values

  • raw_bisector (bool, default False) – if True and grid bisector is requested then it is left in a raw form without assessing which side is shallower (True values indicate same side as origin cell)

Returns:

gcs or (gcs, gcs_props) where gcs is a new GridConnectionSet with a single feature, not yet written to hdf5 nor xml created; gcs_props is a dictionary mapping from requested return_properties string to numpy array

Notes

this function is designed for aligned regular grids only; this function can handle the surface and grid being in different coordinate reference systems, as long as the implicit parent crs is shared; no trimming of the surface is carried out here: for computational efficiency, it is recommended to trim first; organisational objects for the feature are created if needed; if the offset return property is requested, the implicit units will be the z units of the grid’s crs