Open simonbyrne opened 4 years ago
Need to think a bit more about it, but I love the idea of splitting out functionality into a Field
. This is really the base object we are working with and MPIStateArray
is just how the data for it is stored.
@lcw and I have been thinking some about this over the past few months.
It seem that we have too many ideas in MPIStateArrays and need to split some out.
It would also be nice to be semi-agnostic about data layout, e.g., do we want state to be fastest, which degree of freedom first (i, j, k), element order, etc.
We've been thinking that a series of wrapper array types could do this for us. Something along the lines of the following
GhostedArray:
StructArray / VarsArray
WeightedArray
MPICommArray
On top of all this
After discussion with @blallen, @sandreza and @leios:
Take #731 and make a new "Field" object basically consisting of
struct Field{V<:Vars,A,G}
array::A
grid::G
end
Figure out recursive Vars (I have some ideas)
Instead of passing state
, aux
, diffusive
etc to every function, we pass a single NamedTuple
containing the Vars
objects: this will considerably simply the function signatures, especially now that #658 is merged.
Figure out a way to have a filteredstate
inside the main DG loop, that can get passed as another element of the NamedTuple in 3 (related #775).
Be able to set boundary_state!
once for all fluxes.
Need to support broadcasting a horizontal-only field into 3D space. Ideally would capture the necessary restrictions in the grid object
Currently
MPIStateArray
is somewhere in between a "pure" array structure and a specialized backing datastore for values on aDiscontinuousSpectralElementGrid
. It has a bunch of compromises and assumptions that makes it a bit cumbersome to use.My current thinking is that we could define a
Field
object (perhaps there is a better name) that represents a set of numerical quantities that are defined over a spatial domain. In other words, this would be equivalent to a currentMPIStateArray
+Grid
+Vars
.weights
and the weighted norm/dot) into theField
objectField
object, and not require any externalDGModel
objectField
backed by a differentGrid
type (e.g.LatLongGrid
orRegularCartesianGrid
).Vars
variables.getproperty
on the wholeField
which could give you a subset of the vars e.g. a scalar or vector field.I haven't touched on issues like communication or ghost points, and I know others have opinions, so please chime in with your wishlist below.