Anush Krishnan <[email protected]> writes: >> >> > [1] Suppose my body moves, and the positions of the body points change, >> > will I have to completely deallocate C^T and reallocate the new rows on >> > each process? It's possible that the number of non-zeros on each process >> > can change. What would you suggest as the best strategy to do this? >> >> Just create a new matrix. >> > > Is this done using MatDestroy and MatCreate? I would need to do this at > every timestep. And suppose C^T was part of a bigger matrix Q = [G C^T], > and I only needed to change C^T (which has much fewer columns and non-zeros > compared to G) at every time step, is it possible to handle that separately?
MatCreate is cheap compared to communicating entries, which is usually cheap compared to a solve or a matrix-matrix multiply. If I were writing this and was concerned about performance or memory use, I would assemble Q in one shot, rather than assembling the pieces like you do.
pgpvRlXxKHBE9.pgp
Description: PGP signature
