[petsc-users] TSSetIJacobian question

Jed Brown jed at jedbrown.org
Mon Feb 16 00:11:47 CST 2015


Mark Adams <mfadams at lbl.gov> writes:

> I am advancing a two equation system with TS that has an additional
> constraint equation.  I build a 3x3 composite matrix a_ts%FJacobean 

Any particular reason for spelling it incorrectly?

> that has my F(U).  I then do:
>
>   call
> MatDuplicate(a_ts%FJacobean,MAT_DO_NOT_COPY_VALUES,a_ts%FJacobean2,ierr)
>   call
> TSSetIJacobian(a_ts%ts,a_ts%FJacobean2,a_ts%FJacobean2,FormIJacobian,a_ts,ierr)
>
> I am thinking my FormIJacobian would look like this:
>
>   ! copy in linear operator
>   call MatCopy(a_ts%FJacobean,Jpre,ierr);CHKERRQ(ierr)
>   ! shift 1 & 2 by 'shift'
>   call MatShift(mat00,shift,ierr);CHKERRQ(ierr)  ????
>   call MatShift(mat11,shift,ierr);CHKERRQ(ierr)  ????

What does this mean?  Why not include the shift while assembling?
> Is this a good basic approach?
>
> I'm not sure how to shift just the first two blocks.  MatGetSubMatrix does
> not seem usable here.  I want these two diagonal block matrices to shift
> them.  Can I get an array of matrices out of a composite matrix?

Since I assume you read the MATCOMPOSITE man page say that all the
matrices have the same size, I have no idea what you're asking for.

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATCOMPOSITE.html

Maybe you don't want a composite matrix?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150216/68018791/attachment.pgp>


More information about the petsc-users mailing list