Hello all,
I am coding up a large time-dependent flow problem with many variables coupled together. The matrix is composed of 16 blocks, some of which are zero. However, only one of the blocks will change between time steps. Thus it seems I am wasting a lot of time reassembling the whole matrix. Can someone provide a reference to how I can assemble just one block of a BlockSparseMatrix? I know I can do it the obvious way--write a separate assembly routine, make a new matrix, fe_system, dof_handler and so on. Is there a better way?
Additionally, due to that structure, where most of the matrix does not change, I could probably solve much more efficiently too. Currently I am using UMFPACK. Figuring out and implementing a nice preconditioner is another project for another time. However, what I'm hoping is possible is some sort of scheme like:
1) Solve the system directly once, store the LU decomposition and how long it took to solve.
2) Switch to GMRES (nonsymmetric problem) and precondition the next solve with the precomputed LU decomposition. Time the computation.
3) If that solve took less time that the direct one took, do go back to stop 2 for the next solve. If it took longer go to step 1.
I understand every part of this except for how to store and reuse the LU. From what (little) I understand, UMFPACK does literally store the entire LU. How can I get access to it directly. If I can't for whatever reason, I was thinking about using a similar setup with an ILU decomposition. However, I have the same problem there and am back to hoping that someone can tell me how to get access to such a thing. Note that I would like to avoid making a copy of the whole system matrix--as I notice many of the preconditioner types are pass by reference, I can't change it and then use the old values.
Thank you for any help that you can give. A quick copy-paste to a relevant example and a couple words about where to find the information would be more than sufficient help! I was not using the correct search terms to find such examples.