Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

topology.adjacency (procNode)

A neighbour relation over a geometry: the faces, points or edges around a point, the points or faces of an edge, the edges, points or faces around a face. It answers a neighbour table (offsets into values, 0-based starts) plus a per-element neighbour count written as an attribute. A group limits the answer to the faces it selects: the table and the geometry then describe the geometry of those faces, whose faces and edges are numbered from 0 in their order and whose points keep their numbers.

Inputs

  • geometry (Geometry): the geometry whose neighbours are listed.
  • query (String, default "point_points"): the relation, named <source>_<target>: "edge_faces", "edge_points", "face_edges", "face_faces", "face_points", "point_edges", "point_faces" or "point_points". "point_points" is the points an edge joins a point to, "point_faces" the faces using a point, "face_faces" the faces sharing an edge with a face. The source half decides what the table and the count attribute are indexed by.
  • element (Float, default -1): one source element id to report the neighbour list of directly, in the Data's neighbours; negative, only the whole table comes back. An id outside the source class's element count is refused.
  • attribute (String, default "valence"): the name of the per-source-element neighbour count written onto the geometry.
  • group (String, default ""): names a 0/1 attribute on class restricting which faces take part; empty, the whole mesh takes part. A name the class does not carry is refused.
  • class (String, default "primitive"): the class group lives on: "edge", "point", "primitive" or "vertex".
  • promote (String, default "all"): how a group on a class other than "primitive" becomes a face set: "all" takes the faces every one of whose elements of that class is in the group, "any" the faces at least one is.

Outputs

A call answers a record by output name.

  • geometry (Geometry): the input (or, with a group, the faces it selects) with the count written under attribute on the source class.
  • adjacency (Data): query, sourceClass, targetClass, sourceCount, pairCount, offsets (where each source element's run starts in values, closed by the total), values (the neighbour ids), counts, attribute, and with an element given, element, neighbours and neighbourCount (-1 without one).

Example

local around = g.topology.adjacency({ geometry = g.mesh.grid({}), query = "point_points", element = 0 })
local count = g.value.get({ data = around.adjacency, path = "neighbourCount" })