[petsc-users] Using operators in KSP

Jed Brown jed at jedbrown.org
Mon Jun 16 07:50:41 CDT 2014


"Sun, Hui" <hus003 at ucsd.edu> writes:
> The scalar field epsilon is not part of x, neither is it part of f, it
> seems that the only choice is to pass it in the third void*. However,
> if I have some other parameters, should I set up a struct, which
> includes those other parameters, and a distributed Vec for epsilon,
> and pass it in the third void*?

Yes, this is the typical approach.  See
src/snes/examples/tutorials/ex28.c for an example of a way to structured
code that reuses local physics for a 2-field problem and can solve for
either field or both fields.
-------------- 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/20140616/b018df74/attachment.pgp>


More information about the petsc-users mailing list