Topologies
MMJMesh.Topologies.ConnectivityList
— TypeConnectivityList
A ConnectivityList
stores connections between mesh entities. Each entry in a ConnectivityList
is an array of links to other entities.
MMJMesh.Topologies.ConnectivityList
— MethodConnectivityList()
ConnectivityList(linkslist::Vector{Vector{Int}})
ConnectivityList(linkslist::AbstractMatrix{Int})
Construct ConnectivityList
.
MMJMesh.Topologies.Topology
— TypeTopology(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 ConnectivityList
s. 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): [[], [], [], [], [], []]
MMJMesh.Topologies.Topology
— MethodTopology(d, nn)
Construct topology of parametric dimension d
with nn
nodes.
Base.adjoint
— Methodcl'
Returns the transpose of connectivity list cl
.
Base.getindex
— Methodcl[i, j]
Returns the j
-th link from entity i
.
Base.getindex
— Methodcl[i]
Returns the links from entity i
.
Base.length
— Methodlength(cl, i)
Returns the number of links from entity i
.
Base.length
— Methodlength(cl)
Returns the number of entities.
Base.push!
— Methodpush!(cl::ConnectivityList, links::Vector{Int})
Add entity by adding links to the end of the list.
Base.show
— Methodshow([io, ]t::Topology[, all=false])
Show the topology t
on io
(default: stdout
). If all
is true
, anonymous links are shown as well.
MMJMesh.Topologies.addlinks!
— Methodaddlinks!(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.
MMJMesh.Topologies.addlinks!
— Methodaddlinks!(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
.
MMJMesh.Topologies.inverse
— Methodinverse(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.
MMJMesh.Topologies.links
— Methodlinks(t::Topology, d0::Int, d1::Int)
Links from entities of dimension d0
to entities of dimension d1
in the form of a ConnectivityList
.
MMJMesh.Topologies.maxlinkssize
— Methodmaxlinkssize(cl::ConnectivityList)
Get the maximum link size of a connectivity list.
MMJMesh.Topologies.nlinks
— Methodnlinks(t::Topology, d0::Int, d1::Int, idx::Int)
Number of links from entity idx of dimension d0 to entities of dimension d1.