porepy.grids.point_grid module

Module for creating point grids.

class PointGrid(*args, **kwargs)[source]

Bases: Grid

Representation of a 0D grids.

Parameters
  • pt

    shape=(3,)

    Point which represents the grid.

  • name

    default=None

    Name of grid, passed to super constructor.

Return type

Grid

cell_centers: ndarray

An array containing column-wise the centers of all cells with shape=(ambient_dimension, num_cells).

Available after calling compute_geometry().

cell_faces: csc_matrix

An array with shape=(num_faces, num_cells) representing the map from cells to faces bordering respective cell.

Matrix elements have value +-1, where + corresponds to the face normal vector being outwards.

cell_volumes: ndarray

An array containing column-wise the volumes per cell with shape=(num_cells,).

Available after calling compute_geometry().

dim: int

Grid dimension. Should be in {0, 1, 2, 3}.

face_areas: ndarray

Areas of all faces (shape=(num_cells,)). Available after calling compute_geometry().

face_centers: ndarray

Centers of all faces. (shape=(ambient_dimension, num_faces)). Available after calling compute_geometry().

face_nodes: csc_matrix

An array with shape=(num_nodes, num_faces) representing the map from faces to nodes spanning respective face.

Assumes the nodes of each face are ordered according to the right-hand rule.

Note

To use compute_geometry() later, the field face_nodes.indices should store the nodes of each face sorted. face_nodes.indices[face_nodes.indptr[i]:face_nodes.indptr[i+1]] are the nodes of face i, which should be ordered counter-clockwise.

By counter-clockwise we mean as seen from cell cell_faces[i,:] == -1.

Equivalently the nodes will be clockwise as seen from cell cell_faces[i,:] == 1.

Note that operations on the face_nodes matrix (such as converting it to a csr-matrix) may change the ordering of the nodes (face_nodes.indices), which will break compute_geometry().

face_normals: ndarray

An array containing column-wise normal vectors of all faces with shape=(ambient_dimenaion, num_faces).

See also cell_faces.

Available after calling compute_geometry().

frac_num: int

Index of the fracture the grid corresponds to. Take value (0, 1, ...) if the grid corresponds to a fracture, -1 if not.

frac_pairs: ndarray

Indices of faces that are geometrically coinciding, but lay on different side of a lower-dimensional grid.

global_point_ind: ndarray

An array with shape=(num_nodes,) containing indices of each point, assigned during processing of mixed-dimensional grids created by gmsh.

Used to identify points that are geometrically equal, though on different grids.

Could potentially be used to identify such geometrically equal points at a later stage, but there is no guarantee that this will work.

history: list[str]

Information on the formation of the grid, such as the constructor, computations of geometry etc.

name: str

Name assigned to this grid.

nodes: ndarray

An array with shape=(ambient_dimension, num_nodes) containing node coordinates column-wise.

num_cells: int

Number of cells in the grid.

num_faces: int

Number of faces in the grid.

num_nodes: int

Number of nodes in the grid.

parent_cell_ind: ndarray

Index of parent the cell in the parent grid for grids that have refined sub-grids or are sub-grids of larger grids.

Defaults to a mapping to its own index with shape=(num_cells,).

periodic_face_map: ndarray

Index of periodic boundary faces, (shape=(2, num_periodic_faces), dtype=int).

Face index periodic_face_map[0, i] is periodic with face index periodic_face_map[1, i]. This attribute is set with set_periodic_map().

tags: dict[str, numpy.ndarray]

Tags allow to mark subdomains of interest.

The default tags are used to mark fractures, tips and domain boundaries. Tags are used for nodes, as well as faces. User tags can be provided in the constructor.

well_num: int

Index of the well associated to the grid. Takes a value in (0, 1, ..) if the grid corresponds to a well, -1 if not.