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

Barry Smith bsmith at mcs.anl.gov
Wed May 5 21:16:12 CDT 2010


On May 5, 2010, at 8:46 PM, Li, Zhisong (lizs) wrote:

> 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? 

  You need to assemble the Jacobian in the usual finite element way. That assembled Jacobian is what is passed to the set Jacobian routines. (see any finite element book on assembling the global stiffness matrix from element stiffness matrices).


   Barry

> 
> Thank you very much.
> 
> 
> Regards,
> 
> 
> Zhisong Li
> 
> 

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


More information about the petsc-users mailing list