zoomy_core.mesh.mesh_util

zoomy_core.mesh.mesh_util#

Reference-element geometry (face order, normals, areas, volumes, inradii) for the supported cell types, used by BaseMesh.

Module Contents#

Functions#

convert_mesh_type_to_meshio_mesh_type

Map a Zoomy cell type (wface = wedge) to the meshio cell-type name.

get_extruded_mesh_type

Cell type obtained by extruding mesh_type one layer (line -> quad, triangle -> wface, quad -> hexahedron).

get_global_cell_index_from_vertices

Index (plus offset) of the first cell, or of all cells if return_first is False, containing every vertex in coordinates.

get_element_neighbors

Elements sharing a face with current_elem; returns (n_found, neighbour_indices, local_face_indices).

face_normals

Unit normals of the faces of one element, (n_faces, 3); orientation follows the vertex order.

face_areas

Area (length in 2D) of each face of one element.

center

Vertex-average centre of element.

volume

Volume (area in 2D, length for lines) of one element of mesh_type.

inradius

Inradius of one element of mesh_type.

edge_length

Euclidean length of edge.

find_edge_index

Local index of the edge/face of element whose vertices lie in edge_vertices.

compute_subvolume

Volume of the sub-simplex spanned by a face and the cell centre (length, triangle, tetrahedron or pyramid for dim 1, 2, 3).

API#

zoomy_core.mesh.mesh_util.convert_mesh_type_to_meshio_mesh_type(mesh_type: str) → str#

Map a Zoomy cell type (wface = wedge) to the meshio cell-type name.

zoomy_core.mesh.mesh_util.get_extruded_mesh_type(mesh_type: str) → str#

Cell type obtained by extruding mesh_type one layer (line -> quad, triangle -> wface, quad -> hexahedron).

zoomy_core.mesh.mesh_util.get_global_cell_index_from_vertices(cells, coordinates, return_first=True, offset=0)#

Index (plus offset) of the first cell, or of all cells if return_first is False, containing every vertex in coordinates.

zoomy_core.mesh.mesh_util.get_element_neighbors(element_vertices, current_elem, mesh_type)#

Elements sharing a face with current_elem; returns (n_found, neighbour_indices, local_face_indices).

zoomy_core.mesh.mesh_util.face_normals(coordinates, element, mesh_type) → float#

Unit normals of the faces of one element, (n_faces, 3); orientation follows the vertex order.

zoomy_core.mesh.mesh_util.face_areas(coordinates, element, mesh_type) → float#

Area (length in 2D) of each face of one element.

zoomy_core.mesh.mesh_util.center(coordinates, element) → float#

Vertex-average centre of element.

zoomy_core.mesh.mesh_util.volume(coordinates, element, mesh_type) → float#

Volume (area in 2D, length for lines) of one element of mesh_type.

zoomy_core.mesh.mesh_util.inradius(coordinates, element, mesh_type) → float#

Inradius of one element of mesh_type.

zoomy_core.mesh.mesh_util.edge_length(coordinates, edge) → float#

Euclidean length of edge.

zoomy_core.mesh.mesh_util.find_edge_index(element, edge_vertices, element_type)#

Local index of the edge/face of element whose vertices lie in edge_vertices.

zoomy_core.mesh.mesh_util.compute_subvolume(face_vertices, cell_center, dim)#

Volume of the sub-simplex spanned by a face and the cell centre (length, triangle, tetrahedron or pyramid for dim 1, 2, 3).

Args

  • face_vertices: coordinates of the face vertices.

  • cell_center: coordinates of the cell centre.

  • dim: spatial dimension (1, 2 or 3).