[petsc-users] DAE user-defined Jacobian based on discretized variables

Li, Zhisong (lizs) lizs at mail.uc.edu
Wed May 5 20:46:47 CDT 2010


Hello, PETSc Team,

>From previous discussion with you on DAE solver, for some 2D/3D PDE equations (such as N-S equation), we can first discretized them before computing the Jacobian, if my understanding is correct.

Suppose we can derive the 3x3 Jacobian matrix elements: ddF1/ddU, ddF2/ddV, ...... as

J[0][0] = 0.5*(x[j][i+1].u-x[j][i-1].u)+...;...  J[0][1] = 0.5*(x[j+1][i].v-x[j-1][i].v)+..., J[0][2]=..., ..., J[2][2] = .....

The resulting Jacobian matrix A depends on the discretized variables x[][].u, x[][].v, ...or say, the location index [j][i]. That's A=A[j][i]. In the function of TSSetIJacobian(), the FormJacobian routine can only return one matrix, rather than an array of matrices (one for each grid point) as we need. My question is that how to construct the correct Jacobian in this case?

Thank you very much.


Regards,


Zhisong Li


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100506/1a04f42d/attachment-0001.htm>


More information about the petsc-users mailing list