resqpy.olio.box_utilitiesΒΆ

Simple functions relating to cartesian grid boxes.

A box is a logical cuboid subset of the cells of a cartesian grid. A box is defined by a small numpy array: [[min_k, min_j, min_i], [max_k, max_j, max_i]]. The cells identified by the max indices are included in the box (not following the python convention) The ordering of the i,j & k indices might be reversed - identifier names then have a suffix of _ijk instead of _kji. The indices can be in simulator convention, starting at 1, or python convention, starting at 0, indicated by suffix of 0 or 1

Functions

box_kji0_from_words_iijjkk1

Returns an integer array of extent [2, 3] converted from a list of words representing logical box.

boxes_overlap

Returns True if the two boxes have any overlap in 3D, otherwise False.

cell_in_box

Returns True if cell is within box, otherwise False.

central_cell

Returns the indices of the cell at the centre of the box.

extent_of_box

Returns a 3 integer numpy array holding the size of the box, with the same ordering as the box.

full_extent_box0

Returns a box containing all the cells in a grid of the given extent.

local_box_cell_from_parent_cell

Given a cell index triplet in the host grid, and a box, returns the equivalent local cell index triplet.

overlapping_boxes

Checks for 3D overlap of two boxes; returns True and sets trim_box if there is overlap, otherwise False.

parent_cell_from_local_box_cell

Given a box and a local cell index triplet, converts to the equivalent cell index triplet in the host grid.

single_cell_box

Returns a box containing the single given cell; protocol for box matches that of cell.

spaced_string_iijjkk1_for_box_kji0

Returns a string representing the box space in simulator input format, eg.

string_iijjkk1_for_box_kji0

Returns a string representing the box space in simulator protocol, eg.

trim_box_by_box_returning_new_mask

Reduces box_to_be_trimmed by trim_box; trim_box must be a neat subset box at one face of box_to_be_trimmed.

trim_box_to_mask_returning_new_mask

Reduce the coverage of bounding box to the minimum needed to contain True elements of mask.

union

Returns the box which contains both box_1 and box_2.

valid_box

Returns True if the entire box is within a grid of size host_extent.

volume_of_box

Returns the number of cells in the logical 3D cell space defined by box.