I am advancing a two equation system with TS that has an additional
constraint equation.  I build a 3x3 composite matrix a_ts%FJacobean 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)  ????

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?

Thanks,
Mark

Reply via email to