Topologies
A Topology
determines the ordering and connections between elements of a mesh.
Types
ClimaCore.Topologies.AbstractTopology
— TypeAbstractTopology
Subtypes of AbstractHorizontalTopology
define connectiveness of a mesh in the horizontal domain.
Interfaces
nelems
domain(topology::AbstractTopology)
mesh
nlocalelems
nneighbors
nsendelems
nghostelems
localelemindex
vertex_coordinates
opposing_face
face_node_index
interior_faces
ghost_faces
vertex_node_index
local_neighboring_elements
ghost_neighboring_elements
local_vertices
ghost_vertices
neighbors
boundary_tags
boundary_tag
boundary_faces
ClimaCore.Topologies.IntervalTopology
— TypeIntervalTopology([context::SingletonCommsContext,] mesh::IntervalMesh)
A sequential topology on an Meshes.IntervalMesh
.
ClimaCore.Topologies.Topology2D
— TypeTopology2D(mesh::AbstractMesh2D, elemorder=Mesh.elements(mesh))
This is a distributed topology for 2D meshes. elemorder
is a vector or other linear ordering of the Mesh.elements(mesh)
. elempid
is a sorted vector of the same length as elemorder
, each element of which contains the pid
of the owning process.
Internally, we can refer to elements in several different ways:
elem
: an element of themesh
. Often aCartesianIndex
object.gidx
: "global index": an enumeration of all elements:elemorder[gidx] == elem
orderindex[elem] == gidx
lidx
: "local index": an enumeration of local elements.local_elem_gidx[lidx] == gidx
sidx
: "send index": an index into the send buffer of a local element. A single local element may have multiplesidx
s if it needs to be send to multiple processes.send_elem_lidx[sidx] == lidx
ridx
: "receive index": an index into the receive buffer of a ghost element.recv_elem_gidx[ridx] == gidx
ClimaCore.Topologies.spacefillingcurve
— Functionspacefillingcurve(mesh::Meshes.AbstractCubedSphere)
Generate element ordering, elemorder
, based on a space filling curve for a CubedSphere
mesh.
spacefillingcurve(mesh::Meshes.RectilinearMesh)
Generate element ordering, elemorder
, based on a space filling curve for a Rectilinear
mesh.
ClimaCore.Topologies.nelems
— Functionnelems(topology)
The total number of elements in topology
.
ClimaCore.Topologies.nneighbors
— Functionnneighbors(topology)
The number of neighbors of this process in topology
.
ClimaCore.Topologies.nsendelems
— Functionnsendelems(topology)
The number of elements to send to neighbors in topology
.
ClimaCore.Topologies.nghostelems
— Functionnghostelems(topology)
The number of ghost elements in topology
.
ClimaCore.Topologies.localelemindex
— Functionlocalelemindex(topology, elem)
The local index for the specified element; useful for distributed topologies.
ClimaCore.Topologies.face_node_index
— Functioni,j = face_node_index(face, Nq, q, reversed=false)
The node indices of the q
th node on face face
, where Nq
is the number of face nodes in each direction.
ClimaCore.Topologies.ghost_faces
— Functionghost_faces(topology::AbstractTopology)
An iterator over the ghost faces of topology
. Each element of the iterator is a 5-tuple the form
(elem1, face1, elem2, face2, reversed)
where elemX, faceX
are the element and face numbers, and reversed
indicates whether they have opposing orientations.
ClimaCore.Topologies.vertex_node_index
— Functioni,j = vertex_node_index(vertex_num, Nq)
The node indices of vertex_num
, where Nq
is the number of face nodes in each direction.
ClimaCore.Topologies.local_vertices
— Functionlocal_vertices(topology)
An iterator over the interior vertices of topology
. Each vertex is an iterator over (lidx, vert)
pairs.
ClimaCore.Topologies.ghost_vertices
— Functionghost_vertices(topology)
An iterator over the ghost vertices of topology
. Each vertex is an iterator over (isghost, lidx/ridx, vert)
pairs.
ClimaCore.Topologies.neighbors
— Functionneighbors(topology)
Returns an array of the PIDs of the neighbors of this process.
Interfaces
ClimaCore.Topologies.mesh
— Functionmesh(topology)
Returns the mesh underlying the topology
ClimaCore.Topologies.nlocalelems
— Functionnlocalelems(topology)
The number of local elements in topology
.
ClimaCore.Topologies.vertex_coordinates
— Function(c1,c2,c3,c4) = vertex_coordinates(topology, elem)
The coordinates of the 4 vertices of element elem
.
ClimaCore.Topologies.opposing_face
— Function(opelem, opface, reversed) = opposing_face(topology, elem, face)
The opposing face of face number face
of element elem
in topology
.
opelem
is the opposing element number, 0 for a boundary, negative for a ghost elementopface
is the opposite face number, or boundary face number if a boundaryreversed
indicates whether the opposing face has the opposite orientation.
ClimaCore.Topologies.interior_faces
— Functioninterior_faces(topology::AbstractTopology)
An iterator over the interior faces of topology
. Each element of the iterator is a 5-tuple the form
(elem1, face1, elem2, face2, reversed)
where elemX, faceX
are the element and face numbers, and reversed
indicates whether they have opposing orientations.
ClimaCore.Topologies.boundary_tags
— Functionboundary_tags(topology)
A Tuple
or NamedTuple
of the boundary tags of the topology. A boundary tag is an integer that uniquely identifies a boundary.
ClimaCore.Topologies.boundary_tag
— Functionboundary_tag(topology, name::Symbol)
The boundary tag of the topology for boundary name name
. A boundary tag is an integer that uniquely identifies a boundary.
ClimaCore.Topologies.boundary_faces
— Functionboundary_faces(topology, boundarytag)
An iterator over the faces of topology
which face the boundary with tag boundarytag
. Each element of the iterator is an (elem, face)
pair.
ClimaCore.Topologies.local_neighboring_elements
— Functionlocal_neighboring_elements(topology::AbstractTopology, lidx::Integer)
An iterator of the local element indices (lidx) of the local elements which are neighbors of the local element lidx
in topology
(excluding lidx
itself).
ClimaCore.Topologies.ghost_neighboring_elements
— Functionghost_neighboring_elements(topology::AbstractTopology, ridx::Integer)
An iterator of the receive buffer indices (ridx) of the ghost elements which are neighbors of the local element lidx
in topology
.