Skip to content

Allow block-diagonal linear operators with diagonalize=True #4

@hippalectryon-0

Description

@hippalectryon-0

Use case: we have a lot of degrees of freedom (e.g. N=30000, for example a 3D grid 20x20x20 with 4 fields), but the linear step is diagonal by block with small blocks.

Example equation: homogeneous Rayleigh-Bénard system with variables $u_x,u_y,u_z,\theta$:
$\partial_t u_i + u_j\partial_ju_i + \nabla P = Pr\Delta u_i + RaPr \theta\delta_{i=z}$
$\partial\theta+u_j\partial_j\theta=\Delta \theta+u_z$.

In this system, the linear term for $\theta$ is extremely simple $\mathcal{L}(k_x,k_y,k_z)\theta=-k^2\theta+u_z$. It is block-diagonal with blocks of size 4 (the number of equations).

However, if we use (for instance) EDT35, we have to compute the NxN full matrix of the operator, which is way too big (1e10 elements !!).

Moreover, looking at the code of _ETD35_Diagonalized, it seems to me that all the quantities involved are stable by block diagonalization, so I expect that we could handle gracefully those cases (maybe using scipy.sparse ?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions