I'm writing a program that uses PETSc and SLEPc, and I was looking for a convienient way to read in options from the command line. The description of PetscBagSetFromOptions() in the official documentation says it "allows setting options from a bag". Does this mean that if I create a bag with a variety of PetscFoo elements I can read in my program's parameters from the command line without having to use PetscOptionsGetInt() and other functions like it?
Tell me more
×
Computational Science Stack Exchange is a question and answer site for
scientists using computers to solve scientific problems. It's 100% free, no registration required.
|
|
||||
|
|
|
It appears from the code, linked on the very page you have described, that PetscBagSetFromOptions literally just goes through the bag's item names and checks to see if they are in the options database (by appending - in front and using PetscOptionsInt, PetscOptionsReal, etc.). It's silly that the linked examples, however, use this redundantly with the PetscOptionsXXX routines, so I can see why this might be confusing. Requests like this may be sent to petsc-users@mcs.anl.gov. |
|||||||
|