C Mesh data structures and functions.
Notes
The memory is allocated/freed in C - this class just wraps NumPy arrays around that data without copying.
Create a new CMesh instance, with cells corresponding to the given entities of dimension dent.
Parameters: | entities : array, optional
dent : int, optional
localize : bool
|
---|---|
Returns: | cmesh : CMesh
|
Fill CMesh data using Python data.
Return the coordinates of centroids of mesh entities with dimension dim.
Get entities of dimension dim that are completely given by entities of dimension dent listed in entities.
Get d1 -> d2 connectivity as a sparse matrix graph (values = ones).
For safety, creates a copy of the connectivity arrays. The connectivity is created if necessary.
Return the normals of facets for each mesh cell. The normals can be accessed using the cell-facet connectivity.
If which is -1, two normals of each quadrilateral face are averaged. If it is 0 or 1, the corresponding normal is used.
Get non-unique entities indices of dimension dim that are contained in entities of dimension dent listed in entities. As each of entities can be in several entities of dimension dent, offsets array is returned optionally.
Get local ids of non-unique entities incident of dimension dim (with given offsets per entities) incident to entities of dimension dent, see mesh_get_incident(), with respect to entities.
Get orientations of entities of dimension dim. Alternatively, co-dimension can be specified using codim argument.
Get facets (edges in 2D, faces in 3D) on the mesh surface.
Set up mesh edge (2D and 3D) and face connectivities (3D only) as well as their orientations.
Create sparse (CSR) graph corresponding to given row and column connectivities.
Parameters: | n_row : int
n_col : int
n_gr : int
rconns : list of arrays
cconns : list of arrays
|
---|---|
Returns: | nnz : int
prow : array
icol : array
|
Determine connected compoments of a compressed sparse graph.
Returns: | n_comp : int
flag : array
|
---|
Swap element nodes so that its volume is positive.