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
- 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()
.
- face_areas: ndarray
Areas of all faces
(shape=(num_cells,))
. Available after callingcompute_geometry()
.
- face_centers: ndarray
Centers of all faces.
(shape=(ambient_dimension, num_faces))
. Available after callingcompute_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 fieldface_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 breakcompute_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.
- nodes: ndarray
An array with
shape=(ambient_dimension, num_nodes)
containing node coordinates column-wise.
- 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 indexperiodic_face_map[1, i]
. This attribute is set withset_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.