Topologies

MMJMesh.Topologies.TopologyType
Topology(entities, links)

A Topology stores connections between entities of a mesh. The approach is based on the mesh implementation in the FEniCSx project.

Mesh entities have a parametric dimension $d$. We use the terminology

  • $d=0$: Node
  • $d=1$: Edge
  • $d=2$: Face
  • $d=3$: Solid

Connections between entities (of two not necessarily different dimensions) are stored in ConnectivityLists. A ConnectivityList contains links which are arrays of indices of other mesh entities. Hence, in the code, a connectivity list is called linkslist, one element in the list is called links.

When constructing a topology, entities are added by specifying their IDs and connectivities to vertexes. Each entity of dimension d > 1 defines additional entities of dimensions d-1, ..., 1 (such as a face comes with edges). If not specified explicitly, these entities are added as needed but do not have IDs. Thus, they are called anonymous.

Remarks:

  • Links refer to the index of an entity not the ID.
  • IDs are mostly for compatibility with software which relies on numbering.

Example (anonymous entities are in parentheses):

    4   (3)   5   (7)   6
    *---------*---------*
    |         |         |
 (4)|    1    |(2) 2    |(6)
    |         |         |
    *---------*---------*
    1   (1)   2   (5)   3
  • Entities
    • 0: [1, 2, 3, 4, 5, 6]
    • 2: [1, 2]
  • Links
    • (2, 0): [[1, 2, 5, 4], [2, 3, 6, 5]]
  • Generated and upward links
    • (2, 2): [[2], [1]]
    • (2, 1): [[1, 2, 3, 4], [5, 6, 7, 2]]
    • (1, 2): [[1], [1, 2], [1], [1], [2], [2], [2]]
    • (1, 1): [[2, 4, 5], [1, 3, 5, 7], [2, 4, 7], [1, 3], [1, 2, 6], [5, 7], [2, 3, 6]]
    • (1, 0): [[1, 2], [2, 5], [4, 5], [1, 4], [2, 3], [3, 6], [5, 6]]
    • (0, 2): [[1], [1, 2], [2], [1], [1, 2], [2]]
    • (0, 1): [[1, 4], [1, 2, 5], [5, 6], [3, 4], [2, 3, 7], [6, 7]]
    • (0, 0): [[], [], [], [], [], []]
source
Base.push!Method
push!(cl::ConnectivityList, links::Vector{Int})

Add entity by adding links to the end of the list.

source
Base.showMethod
show([io, ]t::Topology[, all=false])

Show the topology t on io (default: stdout). If all is true, anonymous links are shown as well.

source
MMJMesh.Topologies.addlinks!Method
addlinks!(t::Topology, d0::Int, d1::Int, cl::ConnectivityList)
addlinks!(t::Topology, d0::Int, d1::Int, cl::Vector{Vector{Int}})

Add links from entities of dimension d0 to entities of dimension d1 by specifying the connectivity list. Entity IDs are generated automatically.

source
MMJMesh.Topologies.addlinks!Method
addlinks!(t::Topology, d0::Int, d1::Int, ids::Vector{Int}, cl::ConnectivityList)

Add links from entities of dimension d0 to entities of dimension d1 by specifying the entities ids and the ConnectivityList cl.

source
MMJMesh.Topologies.inverseMethod
inverse(cl::ConnectivityList)

The inverse of a connectivity list maps links to an index. Note that the inverse does not take into account the order of the links.

source
MMJMesh.Topologies.linksMethod
links(t::Topology, d0::Int, d1::Int)

Links from entities of dimension d0 to entities of dimension d1 in the form of a ConnectivityList.

source
MMJMesh.Topologies.nlinksMethod
nlinks(t::Topology, d0::Int, d1::Int, idx::Int)

Number of links from entity idx of dimension d0 to entities of dimension d1.

source