@@ -3847,6 +3847,7 @@ namespace PETSc {
38473847 nargs[2 ] && c != 1 ? GetAny< Matrice_Creuse< double >* >((*nargs[2 ])(stack)) : nullptr ;
38483848 PetscInt bs;
38493849 MatGetBlockSize (ptB->_petsc , &bs);
3850+ KN< double >* empty = nullptr ;
38503851 if (!pList) {
38513852 ptA->_A = new HpddmType (static_cast < const HPDDM::Subdomain< PetscScalar >& >(*ptB->_A ));
38523853 ptA->_A ->setMatrix (dA);
@@ -3858,14 +3859,14 @@ namespace PETSc {
38583859 ptA->_D = new KN<PetscReal>(dA->HPDDM_n );
38593860 for (int i = 0 ; i < dA->HPDDM_n ; ++i) ptA->_D ->operator [](i) = ptB->_A ->getScaling ()[i];
38603861 }
3862+ empty = new KN< double >(dA->HPDDM_n , (double *)(ptA->_D ));
38613863 initPETScStructure<D>(ptA, bs,
38623864 nargs[1 ] && GetAny< bool >((*nargs[1 ])(stack)) ? PETSC_TRUE : PETSC_FALSE,
3863- ptA-> _D );
3865+ empty );
38643866 } else {
38653867 int n = ptB->_A ->getDof ();
38663868 ffassert (dA->HPDDM_n == n);
38673869 HPDDM::MatrixCSR< void >* L;
3868- KN< double >* empty = nullptr ;
38693870 if (pList->A ) {
38703871 MatriceMorse< double >* mList = static_cast < MatriceMorse< double >* >(&*(pList->A ));
38713872 mList ->CSR ( );
@@ -3896,10 +3897,10 @@ namespace PETSc {
38963897 ptA->_num = new PetscInt[ptA->_A ->getDof ()];
38973898 initPETScStructure<D>(ptA, bs,
38983899 nargs[1 ] && GetAny< bool >((*nargs[1 ])(stack)) ? PETSC_TRUE : PETSC_FALSE, empty);
3899- delete empty;
39003900 if (c != 0 || !ptK->A )
39013901 delete dA;
39023902 }
3903+ delete empty;
39033904 if (c == 1 ) {
39043905 MatSetType (ptA->_petsc , MATSHELL);
39053906 User< LinearSolver< Dmat > > user = nullptr ;
0 commit comments