DSS
ClimaCore.Topologies.dss_transform — Function
dss_transform(arg, local_geometry, weight, I)Transfrom arg[I] to a basis for direct stiffness summation (DSS). Transformations only apply to vector quantities.
local_geometry[I]is the relevantLocalGeometryobject. If it isnothing, then no transformation is performedweight[I]is the relevant DSS weights. Ifweightisnothing, then the result is simply summation.
ClimaCore.Topologies.dss_transform! — Function
dss_transform!(device, dss_buffer, data, local_geometry, dss_weights, perimeter, localelems)Transforms vectors in data from covariant/contravariant axes to physical axes, weights the data at perimeter nodes, and stores result in perimeter_data.
Arguments:
dss_buffer:DSSBuffergenerated bycreate_dss_bufferfunction for field datadata: field datalocal_geometry: local metric information defined at each nodedss_weights: local dss weights for horizontal spaceperimeter: perimeter iteratorlocalelems: list of local elements to perform transformation operations on
Part of ClimaCore.Spaces.weighted_dss!.
ClimaCore.Topologies.dss_untransform! — Function
dss_untransform!(device, dss_buffer, data, local_geometry, perimeter, localelems)Transforms physical vectors in perimeter_data back to their original covariant/contravariant axes, and stores the result in data.
Arguments:
dss_buffer:DSSBuffergenerated bycreate_dss_bufferfunction for field datadata: field datalocal_geometry: local metric information defined at each nodeperimeter: perimeter iteratorlocalelems: list of local elements to perform transformation operations on
Part of ClimaCore.Spaces.weighted_dss!.
ClimaCore.Topologies.dss_untransform — Function
dss_untransform(T, targ, local_geometry, I...)Transform targ[I...] back to a value of type T after performing direct stiffness summation (DSS).
ClimaCore.Topologies.dss_local! — Function
dss_local!(device, perimeter_data, perimeter, topology)Performs DSS on local vertices and faces.
Part of ClimaCore.Spaces.weighted_dss!.
ClimaCore.Topologies.dss_local_ghost! — Function
dss_local_ghost!(device, perimeter_data, perimeter, topology)Computes the "local" part of ghost vertex dss. (i.e. it computes the summation of all the shared local vertices of a unique ghost vertex and stores the value in each of the local vertex locations in perimeter_data)
Part of ClimaCore.Spaces.weighted_dss!.
ClimaCore.Topologies.dss_ghost! — Function
dss_ghost!(device, perimeter_data, perimeter, topology)Sets the value for all local vertices of each unique ghost vertex, in perimeter_data, to that of the representative ghost vertex.
Part of ClimaCore.Spaces.weighted_dss!.
ClimaCore.Topologies.create_dss_buffer — Function
create_dss_buffer(data, space)Creates a DSSBuffer for the field data corresponding to data
Spaces.create_dss_buffer(fv::FieldVector)Create a NamedTuple of buffers for communicating neighbour information of each Field in fv. In this NamedTuple, the name of each field is mapped to the buffer.
Spaces.create_dss_buffer(field::Field)Create a buffer for communicating neighbour information of field.
ClimaCore.Topologies.fill_send_buffer! — Function
fill_send_buffer!(topology, data, ghost_buffer::GhostBuffer)Loads the send buffer of ghost_buffer with the data of the elements that neighboring processes need for their ghost elements.
fill_send_buffer!(device, dss_buffer)Loads the send buffer from perimeter_data. For unique ghost vertices, only data from the representative vertices which store result of "ghost local" DSS are loaded.
Part of ClimaCore.Spaces.weighted_dss!.
ClimaCore.Topologies.DSSBuffer — Type
DSSBufferFields
graph_context: ClimaComms graph context for communicationperimeter_data: PerimeterDataLayoutsend_data: send bufferAbstractVector{FT}recv_data: recv bufferAbstractVector{FT}send_buf_idx: indexing array for loading send buffer fromperimeter_datarecv_buf_idx: indexing array for loading (and summing) data from recv buffer tointernal_elems: internal local elements (lidx)perimeter_elems: local elements (lidx) located on process boundary
ClimaCore.Topologies.load_from_recv_buffer! — Function
load_from_recv_buffer!(device, dss_buffer)Adds data from the recv buffer to the corresponding location in perimeter_data. For ghost vertices, this data is added only to the representative vertices. The values are then scattered to other local vertices corresponding to each unique ghost vertex in dss_local_ghost.
Part of ClimaCore.Spaces.weighted_dss!.
ClimaCore.Topologies.dss! — Function
dss!(data, topology)Computed unweighted/pure DSS of data.
ClimaCore.Spaces.weighted_dss_start! — Function
weighted_dss_start!(data, space, dss_buffer)It comprises of the following steps:
1). Apply Spaces.dss_transform! on perimeter elements. This weights and tranforms vector fields to physical basis if needed. Scalar fields are weighted. The transformed and/or weighted perimeter data is stored in perimeter_data.
2). Apply Spaces.dss_local_ghost! This computes partial weighted DSS on ghost vertices, using only the information from local vertices.
3). Spaces.fill_send_buffer! Loads the send buffer from perimeter_data. For unique ghost vertices, only data from the representative ghost vertices which store result of "ghost local" DSS are loaded.
4). Start DSS communication with neighboring processes
ClimaCore.Spaces.weighted_dss_internal! — Function
weighted_dss_internal!(data, space, dss_buffer)1). Apply Spaces.dss_transform! on interior elements. Local elements are split into interior and perimeter elements to facilitate overlapping of communication with computation.
2). Probe communication
3). Spaces.dss_local! computes the weighted DSS on local vertices and faces.
ClimaCore.Spaces.weighted_dss_ghost! — Function
weighted_dss_ghost!(data, space, dss_buffer)1). Finish communications.
2). Call Spaces.load_from_recv_buffer! After the communication is complete, this adds data from the recv buffer to the corresponding location in perimeter_data. For ghost vertices, this data is added only to the representative vertices. The values are then scattered to other local vertices corresponding to each unique ghost vertex in dss_local_ghost.
3). Call Spaces.dss_untransform! on all local elements. This transforms the DSS'd local vectors back to Covariant12 vectors, and copies the DSS'd data from the perimeter_data to data.
ClimaCore.Spaces.weighted_dss! — Function
function weighted_dss!(data, space, dss_buffer)Computes weighted dss of data.
It comprises of the following steps:
1). Spaces.weighted_dss_start!
Spaces.weighted_dss!(fv::FieldVector, dss_buffer = Spaces.create_dss_buffer(fv))Apply weighted direct stiffness summation (DSS) to each field in fv. If a dss_buffer object is not provided, a buffer will be created for each field in fv. Note that using the Pair interface here parallelizes the weighted_dss! calls.
Spaces.weighted_dss!(f::Field, dss_buffer = Spaces.create_dss_buffer(field))Apply weighted direct stiffness summation (DSS) to f. This operates in-place (i.e. it modifies the f). ghost_buffer contains the necessary information for communication in a distributed setting, see Spaces.create_dss_buffer.
This is a projection operation from the piecewise polynomial space $\mathcal{V}_0$ to the continuous space $\mathcal{V}_1 = \mathcal{V}_0 \cap \mathcal{C}_0$, defined as the field $\theta \in \mathcal{V}_1$ such that for all $\phi \in \mathcal{V}_1$
\[\int_\Omega \phi \theta \,d\Omega = \int_\Omega \phi f \,d\Omega\]
In matrix form, we define $\bar \theta$ to be the unique global node representation, and $Q$ to be the "scatter" operator which maps to the redundant node representation $\theta$
\[\theta = Q \bar \theta\]
Then the problem can be written as
\[(Q \bar\phi)^\top W J Q \bar\theta = (Q \bar\phi)^\top W J f\]
which reduces to
\[\theta = Q \bar\theta = Q (Q^\top W J Q)^{-1} Q^\top W J f\]
Spaces.weighted_dss!(field1 => ghost_buffer1, field2 => ghost_buffer2, ...)Call Spaces.weighted_dss! on multiple fields at once, overlapping communication as much as possible.
ClimaCore.Spaces.unique_nodes — Function
unique_nodes(space::SpectralElementSpace2D)An iterator over the unique nodes of space. Each node is represented by the first ((i,j), e) triple.
This function is experimental, and may change in future.