[petsc-dev] please review quick patch

Barry Smith bsmith at mcs.anl.gov
Thu Jun 30 11:03:11 CDT 2011


  Don't expect me to know send this to petsc-dev.

  I am not sure why you only want to do this if snes->dm? ????


   Barry

On Jun 30, 2011, at 10:50 AM, Lisandro Dalcin wrote:

> Barry, can you review the patch below? Is that what you intended?
> Since DM was added to SNES, things are getting more and more
> involved...
> 
> diff -r e5427cf07281 src/snes/interface/snes.c
> --- a/src/snes/interface/snes.c	Thu Jun 30 16:00:38 2011 +0200
> +++ b/src/snes/interface/snes.c	Thu Jun 30 12:41:54 2011 -0300
> @@ -1587,7 +1587,7 @@
>     ierr = DMGetMatrix(snes->dm,MATAIJ,&J);CHKERRQ(ierr);
>     ierr = SNESSetJacobian(snes,J,J,SNESDMComputeJacobian,PETSC_NULL);CHKERRQ(ierr);
>     ierr = MatDestroy(&J);CHKERRQ(ierr);
> -  } else if (snes->ops->computejacobian == MatMFFDComputeJacobian) {
> +  } else if (snes->dm && snes->ops->computejacobian ==
> MatMFFDComputeJacobian) {
>     Mat J;
>     ierr = MatCreateSNESMF(snes,&J);CHKERRQ(ierr);
>     ierr = MatMFFDSetOptionsPrefix(J,((PetscObject)snes)->prefix);CHKERRQ(ierr);
> 
> 
> -- 
> Lisandro Dalcin
> ---------------
> CIMEC (INTEC/CONICET-UNL)
> Predio CONICET-Santa Fe
> Colectora RN 168 Km 472, Paraje El Pozo
> 3000 Santa Fe, Argentina
> Tel: +54-342-4511594 (ext 1011)
> Tel/Fax: +54-342-4511169




More information about the petsc-dev mailing list