The current released version of ModelingToolkit.jl + MethodOfLines.jl doesn’t really work when the number of variables x the number of grid points is more than ~1,000.
In case it is of interest, I’ve created some vibe-coded edits to make it work for larger grids.
The general idea is that 1) discretization creates array operations using ArrayOp, 2) array-based equations are replaced by representative scalar equations, 3) the scalar equations go through tearing etc, and 4) the equations are converted back to array form for code generation.
I don’t think this correctly produces mass matrices; that would probably have to be a separate effort.
I think it does do sparse jacobians, but probably not in a way that would work at the scale this is intended for.
It currently is not able to work with parallel processing as far as I am aware, that would probably require changes to the code generation side.
To test:
[sources]
MethodOfLines = {rev = "array-discretization-phase1", url = "https://github.com/ctessum-claude/MethodOfLines.jl.git"}
ModelingToolkit = {rev = "arrayop-block-tearing", url = "https://github.com/ctessum-claude/ModelingToolkit.jl.git"}
ModelingToolkitBase = {rev = "arrayop-block-tearing", subdir = "lib/ModelingToolkitBase", url = "https://github.com/ctessum-claude/ModelingToolkit.jl.git"}
ModelingToolkitTearing = {rev = "arrayop-block-tearing", subdir = "lib/ModelingToolkitTearing", url = "https://github.com/ctessum-claude/StateSelection.jl.git"}
StateSelection = {rev = "arrayop-block-tearing", url = "https://github.com/ctessum-claude/StateSelection.jl.git"}