[petsc-users] Regarding FormFunction in the SNES class

baikadi pranay pranayreddy865 at gmail.com
Wed Oct 7 13:41:18 CDT 2020


Hello,
I have a few questions regarding FormFunction when using the SNES solvers.
I am using Fortran90.

1) I went through the example (ex1f.F90) provided in the documentation that
uses Newton method to solve a two-variable system. In the subroutine
FormFunction, the first argument is an input vector (x). However in the
code, no attributes are specified saying that it is an input argument for
the subroutine (i.e. intent attribute is not specified). Is this
automatically taken care of or should I be defining the intent attribute in
my code ? Also, should I use the "allocatable" attribute when defining the
vector x? Please comment similarly on the output vector f as well.
2) Should the ctx argument of the subroutine FormFunction be defined as
"PETSC_NULL_INTEGER"?

Please let me know if you need any further information.

Thank you.
Best Regards,
Pranay.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201007/9a7d9c8a/attachment.html>


More information about the petsc-users mailing list