Class VoroBuild#

Voronoi helper used by mesher.unstructuredmesh.UnstMesh to build the Centroidal Voronoi Tessellation underlying the finite-volume discretisation. Most users do not interact with it directly — _meshStructure() drives it.

class mesher.meshfunc.VoroBuild[source]#

Class for handling triangular meshes.

Attributes:
angles
ce_ratios_per_interior_edge
cell_barycenters
cell_centroids

Computes the centroids (barycenters) of all triangles.

cell_circumcenters
cell_partitions
circumradius
control_volume_centroids
control_volumes
edge_gid_to_edge_list
edge_lengths
edges_cells
face_partitions
inradius
is_boundary_facet
is_boundary_node
is_interior_node
signed_cell_areas

Signed area of a triangle in 2D.

surface_areas
triangle_quality

Methods

compute_curl(vector_field)

Computes the curl of a vector field over the mesh.

create_edges()

Set up edge-node and edge-cell relations.

initVoronoi(nodes, cells[, sort_cells])

Initialization.

mark_boundary

Initialise

initVoronoi(nodes, cells[, sort_cells])

Initialization.

Public Methods

Public functions#

VoroBuild.initVoronoi(nodes, cells, sort_cells=False)[source]#

Initialization.

VoroBuild.angles()#
VoroBuild.cell_barycenters()#
VoroBuild.cell_centroids()#

Computes the centroids (barycenters) of all triangles.

VoroBuild.cell_circumcenters()#
VoroBuild.cell_partitions()#
VoroBuild.ce_ratios_per_interior_edge()#
VoroBuild.circumradius()#
VoroBuild.compute_curl(vector_field)[source]#

Computes the curl of a vector field over the mesh. While the vector field is point-based, the curl will be cell-based. The approximation is based on

\[\begin{split}n\cdot curl(F) = \lim_{A\\to 0} |A|^{-1} <\int_{dGamma}, F> dr;\end{split}\]

see <https://en.wikipedia.org/wiki/Curl_(mathematics)>. Actually, to approximate the integral, one would only need the projection of the vector field onto the edges at the midpoint of the edges.

VoroBuild.control_volume_centroids()#
VoroBuild.control_volumes()#
VoroBuild.create_edges()[source]#

Set up edge-node and edge-cell relations.

VoroBuild.edge_gid_to_edge_list()#
VoroBuild.edge_lengths()#
VoroBuild.edges_cells()#
VoroBuild.face_partitions()#
VoroBuild.inradius()#
VoroBuild.is_boundary_facet()#
VoroBuild.is_boundary_node()#
VoroBuild.is_interior_node()#
VoroBuild.mark_boundary()[source]#
VoroBuild.signed_cell_areas()#

Signed area of a triangle in 2D.

VoroBuild.surface_areas()#
VoroBuild.triangle_quality()#