From 76738904ca07523dc81dadb1ad48790907396705 Mon Sep 17 00:00:00 2001 From: Lawrence Mitchell Date: Thu, 15 May 2014 11:59:43 +0100 Subject: [PATCH] MatNest_Copy: Ensure result is assembled --- If the Mat we're copying to has all its nest blocks preallocated, but not assembled, after the copy it would not be considered assembled. I'm not sure if this is a bit heavyweight and instead one just wants to write: B->assembled = PETSC_TRUE Since all the sub-matrices will be assembled in their respective copies. src/mat/impls/nest/matnest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mat/impls/nest/matnest.c b/src/mat/impls/nest/matnest.c index 24b31bf..d596d7e 100644 --- a/src/mat/impls/nest/matnest.c +++ b/src/mat/impls/nest/matnest.c @@ -672,6 +672,9 @@ static PetscErrorCode MatCopy_Nest(Mat A,Mat B,MatStructure str) } else if (bA->m[i][j] || bB->m[i][j]) SETERRQ2(PetscObjectComm((PetscObject)A),PETSC_ERR_ARG_INCOMP,"Matrix block does not exist at %D,%D",i,j); } } + + ierr = MatAssemblyBegin(B,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); + ierr = MatAssemblyEnd(B,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); PetscFunctionReturn(0); } -- 1.8.4.474.g128a96c