Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

What should the size of an a discretized operator from R^n -> R^n be? #169

@xtalax

Description

@xtalax

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}

L = D2x+D2y

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

L = D2x + D2z

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions