porepy.utils.tags module

Methods for tag handling. The following primary applications are intended:

–Grid tags, stored in the grids and data fields of the grid bucket. Geometry tags are stored in the grids, typical fields are cell, face or node tags, lists of length g.num_cell etc. Other information is stored in the data fields. The entries of the lists should be boolean or integers. Examples:

g.tags[‘fracture_faces’] = [0, 1, 1, 0, 1, 1] g.tags[‘fracture_face_ids’] = [0, 1, 2, 0, 1, 2]

for a grid with two immersed fractures (neighbour to faces (1 and 4) and (2 and 5), respectively). If the wells are located in cells 1 and 3, this may be tagged in the data as e.g.

data[‘well_cells’] = [0 1 0 2]

with 1 indicating injection and 2 production.

–Fracture network tags, stored in the fracture network field .tags. One list entry for each fracture:

network.tags[‘fracture_id’] = [1,2]

add_node_tags_from_face_tags(mdg, tag_base)[source]

Set domain boundary tags for all nodes at least one domain boundary face. The tag base should exist for all faces of all subdomains, and may e.g. be domain_boundary.

add_tags(parent, new_tags)[source]

Add new tags (as a pre-made dictionary) to the tags of the parent object (usually a grid). Values corresponding to keys existing in both dictionaries (parent.tags and new_tags) will be decided by those in new_tags.

all_face_tags(parent)[source]

Return a logical array indicate which of the parent (grid.tags) faces are tagged with any of the standard face tags.

all_node_tags(parent)[source]

Return a logical array indicate which of the parent (grid.nodes) nodes are tagged with any of the standard node tags.

all_tags(parent, ft)[source]

Return a logical array indicate which of the parent objects are tagged with any of the standard object tags.

append_tags(tags, keys, appendices)[source]

Append tags of certain keys. tags: dictionary with existing entries corresponding to keys: list of keys appendices: list of values to be appended, typically numpy arrays

extract(all_tags, indices, keys=None)[source]

Extracts only the values of indices (e.g. a face subset) for the given keys. Any unspecified keys are left untouched (e.g. all node tags). If keys=None, the extraction is performed on all fields.

standard_face_tags()[source]

Returns the three standard face tag keys.

standard_node_tags()[source]

Returns the standard node tag key.