Validate a Object

Zhifeng Sheng z.sheng at
Wed Oct 24 08:50:27 CDT 2007

Dear all

I am programming a simulator with PetSc, and I need to create matrix and 
vector which shall be destoried in the end.

However, the problem is : sometimes, a matrix is declared but never 
created, and if I try to destory this object, Petsc would dump error.

Is there anyway to check whether a Mat or Vec has been created or not?


Mat A;
MatDestory A; // this will dump error, which function should I use to 
check whether A is created?

Thank you.
Best regards
Zhifeng Sheng

More information about the petsc-users mailing list