[petsc-dev] PetscOptionsXXX, PetscOptionsGetXX, and PetscBag in Fortran
bourdin at mcmaster.ca
Tue May 16 10:33:23 CDT 2023
I am revisiting the way I handle options my fortran fracture code. I see the following options:
- use PetscGetXXX, with the caveat that as far as I can see options define this way do not show up when using -help
- use PetscBags, which is what I do now. It is a bit convoluted and I am still struggling to make it work with fortran deferred types for instance
In a C code, I would use PetscOptionsXXX, but this is not an options since PetscOptionsBegin / PetscOptionsEnd do not exist in fortran. I remember looking at this a while ago, and concluding that a Fortran version was not possible because these were macro that defined local variables at locations where it cannot be done legally in Fortran. With the concept of blocks in modern fortran, this issue is gone, but PetscOptionsBegin has become more complicated and relies on multiple operations and data types that are not available in Fortran.
Does anybody see a way to build fortran versions of PetscOptionsBegin/PetscOptionsEnd?
Canada Research Chair in Mathematical and Computational Aspects of Solid Mechanics (Tier 1)
Professor, Department of Mathematics & Statistics
Hamilton Hall room 409A, McMaster University
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada
https://www.math.mcmaster.ca/bourdin | +1 (905) 525 9140 ext. 27243
More information about the petsc-dev