We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2917c8 commit a95435dCopy full SHA for a95435d
1 file changed
plugin/mpi/PETSc-code.hpp
@@ -1063,11 +1063,13 @@ namespace PETSc {
1063
}
1064
if (!isType) {
1065
Mat backup = ptA->_petsc;
1066
- MatGetType(ptA->_petsc, &type);
1067
- PetscStrcmp(type, MATNEST, &isType);
1068
- if(isType) {
1069
- delete [] reinterpret_cast<HPDDM::Subdomain<PetscScalar>**>(ptA->_exchange);
1070
- ptA->_exchange = nullptr;
+ if (ptA->_petsc) {
+ MatGetType(ptA->_petsc, &type);
+ PetscStrcmp(type, MATNEST, &isType);
+ if (isType) {
+ delete [] reinterpret_cast<HPDDM::Subdomain<PetscScalar>**>(ptA->_exchange);
1071
+ ptA->_exchange = nullptr;
1072
+ }
1073
1074
ptA->_petsc = nullptr;
1075
ptA->dtor( );
0 commit comments