-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matrix coupled equations #285
Comments
hmm things work if you concatenate the matrices horizontally, which I assume is going to be the most efficient once views stop allocating. |
I don't quite understand your issue. If you use |
Thanks Chris, I can't reproduce the problem, so I must have made a mistake (probably when trying out different function styles). Nevertheless, concatenating the matrices (whether in the 2nd or 3rd dimension) is not ideal due to all the views that need to be made for each function execution (needed for matrix multiplication). Could the solver somehow be made to work with a vector of matrices instead? |
It would take a lot of work to make arrays of arrays work. That's #254 . Arrays of static arrays work, so a vector of static matrices will do the trick if those matrices are small enough. Another way to do this is using an Here's a blog post demonstrating array partitions: http://www.stochasticlifestyle.com/solving-systems-stochastic-pdes-using-gpus-julia/ |
RecursiveArrayTools seems to use a tuple of arrays as storage, is it possible to use that directly? Maybe by manually specifying some needed functions? |
You'd have to define a recursive broadcast, which is the most difficult part of the code. |
Understood, thanks Chris. |
I have a system of many coupled equations, where the output of each equation is a matrix. When you have a coupled system of scalar functions, you can just set up
u
anddu
to beVector
s, and unpack the system in a single vector ODE. What can you do when each equation instead outputs a matrix?I tried simply choosing my
u
to be a vector of matrices, but the solver fails while trying to set the cache up:I also tried putting everything in a 3D array, and using views, but that didn't work either.
The text was updated successfully, but these errors were encountered: