From e2005f411ec90f2ea2c8c694161db543116c93af Mon Sep 17 00:00:00 2001 From: dmay Date: Wed, 12 Nov 2014 00:44:52 +0100 Subject: [PATCH] Allow for case when J is not square and F=NULL --- src/mat/impls/mffd/mffd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mat/impls/mffd/mffd.c b/src/mat/impls/mffd/mffd.c index 09158c4..cdc63c6 100644 --- a/src/mat/impls/mffd/mffd.c +++ b/src/mat/impls/mffd/mffd.c @@ -546,7 +546,7 @@ PETSC_EXTERN PetscErrorCode MatMFFDSetBase_MFFD(Mat J,Vec U,Vec F) ctx->current_f = F; ctx->current_f_allocated = PETSC_FALSE; } else if (!ctx->current_f_allocated) { - ierr = VecDuplicate(ctx->current_u, &ctx->current_f);CHKERRQ(ierr); + ierr = MatGetVecs(J,NULL,&ctx->current_f);CHKERRQ(ierr); ctx->current_f_allocated = PETSC_TRUE; } -- 1.8.3.4 (Apple Git-47)