I've noticed that throughout the codebase, we are assuming that an AbstractDiffEqLinearOperator has a size of the form (N,M). But since they may now in general be mappings between multiple dimensions, I think this doesn't really hold, and that we should try to move away from the idea that these operators are some form of fancy matrix to some more general kind of abstraction.
D2x = CenteredDifference{1}(2, 6, dx, length(x))
D2y = CenteredDifference{2}(2, 6, dy, length(y))
D2z = CenteredDifference{3}(2, 6, dz, length(z))
L = D2x + D2y + D2z
We need a method to check that some AbstractDiffEqLinearOperator has a size that is compatible with some u. .
There is a sense in which
size(L) = ((length(x)-2, length(y)-2, length(z)-2), (length(x), length(y), length(z)))
But when L is discretized, it is concretized in to a matrix, so that it's size would be
size(Array(L)) = prod.(size(L))
The source of ambiguity
Now consider the following operator, with the intention that it will operate on some u::AbstractArray{T,3}
then there is a sense in which
size(L) = ((length(x)-2, length(y)-2, n-2), (length(x), length(y), n)
where n is some arbitrary number that is as yet unknown.
But the operator has no idea that it is going to multiply a higher dimensional u. So there is also a sense in which
size(L) = ((length(x)-2, length(y)-2), (length(x), length(y)))
So the question is, what should the size of L be given as in this case?
This is also a problem when concretizing
since the operator doesn't know about length(y), it is still ambiguous what it's final size should be, even though we know that it will operate on a u of at least 3 dimensions.