Skip to content

Commit

Permalink
remove MAT_REUSE_MATRIX and add MatDestroySubMatrices
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianL1908 committed Nov 25, 2020
1 parent 4388834 commit 90ca768
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tinyasm/tinyasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class BlockJacobi {
PetscInt updateValuesPerBlock(Mat P) {
PetscInt ierr, dof;
int numBlocks = dofsPerBlock.size();
ierr = MatCreateSubMatrices(P, numBlocks, dofis.data(), dofis.data(), localmats_aij ? MAT_REUSE_MATRIX : MAT_INITIAL_MATRIX, &localmats_aij);CHKERRQ(ierr);
ierr = MatCreateSubMatrices(P, numBlocks, dofis.data(), dofis.data(), MAT_INITIAL_MATRIX, &localmats_aij);CHKERRQ(ierr);
PetscInt info;
PetscScalar *vv;
for(int p=0; p<numBlocks; p++) {
Expand All @@ -99,6 +99,8 @@ class BlockJacobi {
mymatinvert(&dof, vv, piv.data(), &info, fwork.data());
ierr = MatDenseRestoreArrayWrite(localmats[p],&vv);CHKERRQ(ierr);
}
ierr = MatDestroySubMatrices(numBlocks, &localmats_aij);CHKERRQ(ierr);
localmats_aij = NULL;

if(0){
const PetscScalar *vvv;
Expand Down

0 comments on commit 90ca768

Please sign in to comment.