SNES/KSPReset() destroys all the vectors and matrices but keeps all the 
options that have been set for the object. So using it saves rebuilding those 
objects. For large systems Reset would save only a trivial amount of rebuild.

> On Jan 15, 2016, at 6:15 PM, Bhalla, Amneet Pal S <[email protected]> 
> wrote:
> 
> 
> 
>> On Jan 15, 2016, at 3:53 PM, Jed Brown <[email protected]> wrote:
>> 
>> Do you need to create new objects versus merely resetting them?  I
>> suspect that calling KSPReset() between timesteps instead of creating a
>> new object and calling KSPSetFromOptions() will fix your performance
>> woes.
> 
> We definitely need to destroy Mat associated with KSP everytime. This is a 
> dynamic fluid-structure 
> interaction problem on AMR grid, where the Cartesian grid and the structure 
> moves at every timestep. 
> Is it possible to reset a KSP with a different Mat? Are you suggesting to 
> call KSPCreate() and 
> KSPSetFromOptions() only once at the beginning of simulation, KSPReset() 
> after every timestep,
> and KSPDestroy() at the end of the simulation? 

Reply via email to