[petsc-users] How to set matrix values using "MatSetValuesStencil" when dof>1 idxn -

Jed Brown jed at jedbrown.org
Sat Sep 20 00:16:43 CDT 2014


Feng  Shi <fshi at fit.edu> writes:

> Hi Folks,
>
> I get hard times in using the routine MatSetValuesStencil for
> dof>1. There numerous examples for dof=1 but dof>1, neither in the
> Petsc manual. The routine on-line manual
> (http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetValuesStencil.html) says, idxm/idxn are grid coordinates (and component number when dof > 1) for matrix columns being entered. What is the general form of these indices? 

If you have dof>1, please use MatSetValuesBlockedStencil.  See
src/snes/examples/tutorials/ex48.c for an example usage for a
finite-element method.

> Am I right, for example, for idxn, if I write idxn[ix, dof].i?

That's not valid syntax, so I don't know what you're asking.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140919/b3220da8/attachment.pgp>


More information about the petsc-users mailing list