We don't currently have a MatReset  (corresponding to PCRest() etc) but it 
is the right thing for you in this situation I think.

   A shallow MatReset() would destroy all the matrix data structures but not 
the Layout information (likely you want this one) while a deep reset would even 
get rid of the size information and be like the matrix just came from 
MatCreate(). 

    If you want to start a MatReset() and post a pull request we can get it in. 
Note that you will need a MatReset_SeqAIJ() and a MatReset_MPIAIJ() to start 
with.

    Barry

> On Oct 21, 2016, at 4:51 PM, Kong, Fande <[email protected]> wrote:
> 
> Hi,
> 
> For mechanics problems, the contact surface changes  during each nonlinear 
> iteration. Therefore, the sparsity of matrix also changes during each 
> nonlinear iteration. We know the preallocaiton is important for performance.
> 
> My question is:  it is possible to re-allocate memory during each nonlinear 
> iteration?
> 
> Fande

Reply via email to