Hello, Thanks. Looks like I could set all the possible entries I'll use to zero and selectively overwrite them.
Can I overwrite any entries without incurring additional cost in memory? I currently use MatSetValue with the option INSERT_VALUES? Does Petsc have an option to OVERWRITE the existing value? ganesh On Fri, May 8, 2015 at 5:10 PM, Jed Brown <[email protected]> wrote: > Ganesh Vijayakumar <[email protected]> writes: > > > Hello, > > > > I have a CFD application where some entries of the matrix change every > > time step. > > The entries change value or the set of nonzero entries changes? If the > former, just MatSetValues and carry on. If the latter, either allocate > for the union of all possible nonzeros (storing some explicit zeros) or > reallocate the matrix each time. > > > However, the total number of non-zero elements never changes. Is there > > anyway I can efficiently do this. My current attempts at doing this > > results in running over the total initial memory allocation very soon. > > > > ganesh > -- ganesh
