[petsc-users] a question about DAE Function

Jed Brown jedbrown at mcs.anl.gov
Wed Jun 5 14:39:02 CDT 2013


"Jin, Shuangshuang" <Shuangshuang.Jin at pnnl.gov> writes:

> I see. So for my IFunction which is called by TSSetIFunction, I can
> leave it as what it is right now (I mean scatter x and define
> equations), but for the IJacobian function which is called by
> TSSetIJacobian, I should define the Jacobian matrix as MATELEMENTAL
> type and set up its values accordingly?

Yes.

> My Jacobian matrix also use the values of the distributed array
> X. Generally, the benefit of MATELEMENTAL is to avoid the scattering
> of X to each processor inside the IJacobian function in each iteration
> by "using MatGetOwnershipIS() to determine which matrix entries are
> responsible for computing" and such?

The entries of the matrix might still have global dependence, but for
dense problems, it's important to use a "2D" distribution.
MatGetOwnershipIS tells you which of those entries you are responsible
for computing.  The entries are in a place that will work well for the
solve.


More information about the petsc-users mailing list