[petsc-users] Application context in fortran

Barry Smith bsmith at mcs.anl.gov
Mon Jan 23 10:26:54 CST 2017


> On Jan 22, 2017, at 11:16 PM, Praveen C <cpraveen at gmail.com> wrote:
> 
> Hello
> 
> With snes/ts, we use an "application context to contain data needed by the application-provided call-back routines, FormJacobian() and FormFunction()". This can be a struct in the C examples. What can I use in case of fortran ? Can I use a module to pass the data needed by the call-back routines ?

   You can use a module to communicate the information, in that case the ctx you would pass is 0

   You can also use a fortran derived type. See src/snes/examples/tests/ex12f.F 


> 
> Thanks
> praveen 



More information about the petsc-users mailing list