This may be a Petsc newbie question, but...
I'm using Petsc to solve a large sparse linear system. The initial creation of the matrix is fairly slow, which I'm given to understand is largely due to memory allocations; that's tolerable for the moment. My problem is that as the simulation progresses, the structure of my domain/mesh changes such that the size of the resulting matrix will need to be increased. Do I really need to create a brand new matrix for this each time, or is there a way to just resize an existing matrix? (i.e. in order to avoid the cost of re-allocating the entire matrix from scratch.)
I have tried calling MatSetSizes, but it gives me an error: "Cannot change/reset row sizes to [...]" Am I doing something wrong, or is this a fundamental limitation?