[petsc-dev] Fortran equivalent + separate output with output_file

Pierre Jolivet pierre.jolivet at enseeiht.fr
Fri Jan 17 15:18:29 CST 2020

> On 13 Jan 2020, at 4:38 PM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
>> On Jan 13, 2020, at 9:32 AM, Pierre Jolivet <pierre.jolivet at enseeiht.fr> wrote:
>> Hello,
>> This is actually two separate questions, sorry.
>> 1) I’m looking for the Fortran equivalent of the following, but I couldn’t get any help looking at the sources.
>> ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","","");CHKERRQ(ierr);
>> ierr = PetscOptionsFList("-mat_type","Matrix type","MatSetType",MatList,deft,type,256,&flg);CHKERRQ(ierr);
>> ierr = PetscOptionsEnd();CHKERRQ(ierr);
>   These are based on C macros and have some funny arguments so would require all custom Fortran stubs and interfaces. Sorry no one has written them.

OK. No big deal.
Another question about Fortran: what’s the equivalent of a NULL PetscErrorCode (*setup)(Mat, PetscReal, Vec, Vec, PetscReal, IS, void*)?
I’m passing a PETSC_NULL_FUNCTION but it doesn’t seem to do the job as I’m getting segmentation faults in C (for some architectures), the code goes in the if(setup) branch.

I want to convert this: https://gitlab.com/petsc/petsc/blob/fbda2a43629902c7e64367d3e3c13db2ceb5b740/src/ksp/ksp/examples/tutorials/ex76.c#L68 <https://gitlab.com/petsc/petsc/blob/fbda2a43629902c7e64367d3e3c13db2ceb5b740/src/ksp/ksp/examples/tutorials/ex76.c#L68>
Into (hopefully something similar to) this: https://gitlab.com/petsc/petsc/commit/fbda2a43629902c7e64367d3e3c13db2ceb5b740#42254f97b9989f77d6aa51f62644a282fc31f3fd_0_93 <https://gitlab.com/petsc/petsc/commit/fbda2a43629902c7e64367d3e3c13db2ceb5b740#42254f97b9989f77d6aa51f62644a282fc31f3fd_0_93>
Thanks in advance for bearing with me,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200117/907c7f99/attachment.html>

More information about the petsc-dev mailing list