[petsc-users] check if object was created

Dominik Szczerba dominik at itis.ethz.ch
Sun Oct 2 04:46:09 CDT 2011


Is it OK to do:

KSP/Mat/Vec/etc object;

if(object)
   KSP/Mat/Vec/etcDestroy(object)

It other words, are default constructors initializing the object to
NULL, or is there an other dedicated way to check if an object was
actually allocated? I could not easily deduce it from the code...

Many thanks,
Dominik


More information about the petsc-users mailing list