PetscOptions (Options Database) - Low-level Interface
The options database holds the -ksp_type gmres-style settings PETSc objects read in their SetFromOptions calls. The high-level PETSc.PetscOptions type (see Utilities) covers the common cases; the functions here give full control.
A PetscOptions handle with a NULL pointer denotes the global options database.
Basic Usage
using PETSc, MPI
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
opts = LibPETSc.PetscOptions{typeof(petsclib)}() # NULL handle: the global database
LibPETSc.PetscOptionsSetValue(petsclib, opts, "-ksp_type", "gmres")
LibPETSc.PetscOptionsSetValue(petsclib, opts, "-ksp_max_it", "50")
maxit, set = LibPETSc.PetscOptionsGetInt(petsclib, opts, "", "-ksp_max_it") # (50, PETSC_TRUE)
has = LibPETSc.PetscOptionsHasName(petsclib, opts, "", "-ksp_type") # PETSC_TRUE
LibPETSc.PetscOptionsClearValue(petsclib, opts, "-ksp_max_it")
PETSc.finalize(petsclib)pre is an optional prefix ("mg_levels_"), "" for none. The PetscOptionsGet* functions return the value and a PetscBool telling whether the option was set.
Function Reference
PetscOptions
PETSc.LibPETSc.PetscOptionsAllUsed — Method
N::PetscInt = PetscOptionsAllUsed(petsclib::PetscLibType, options::AbstractPetscOptions)Returns a count of the number of options in the database that have never been selected.
Not Collective
Input Parameter:
options- options database, useNULLfor default global database
Output Parameter:
N- count of options not used
Level: advanced
See also: PetscOptionsView()
External Links
- PETSc Manual:
Sys/PetscOptionsAllUsed
PETSc.LibPETSc.PetscOptionsClear — Method
PetscOptionsClear(petsclib::PetscLibType, options::AbstractPetscOptions)Removes all options form the database leaving it empty.
Logically Collective
Input Parameter:
options- options database, useNULLfor the default global database
Level: developer
See also: PetscOptionsInsert()
External Links
- PETSc Manual:
Sys/PetscOptionsClear
PETSc.LibPETSc.PetscOptionsClearValue — Method
PetscOptionsClearValue(petsclib::PetscLibType, options::AbstractPetscOptions, name::String)Clears an option name-value pair in the options database, overriding whatever is already present.
Logically Collective
Input Parameters:
options- options database, useNULLfor the default global databasename- name of option, this SHOULD have the - prepended
Level: intermediate
See also: PetscOptionsInsert()
External Links
- PETSc Manual:
Sys/PetscOptionsClearValue
PETSc.LibPETSc.PetscOptionsCreate — Method
options::PetscOptions = PetscOptionsCreate(petsclib::PetscLibType)Creates an empty options database.
Logically Collective
Output Parameter:
options- Options database object
Level: advanced
See also: PetscOptionsDestroy(), PetscOptionsPush(), PetscOptionsPop(), PetscOptionsInsert(), PetscOptionsSetValue()
External Links
- PETSc Manual:
Sys/PetscOptionsCreate
PETSc.LibPETSc.PetscOptionsCreateDefault — Method
PetscOptionsCreateDefault(petsclib::PetscLibType)Creates the default global options database if it does not already exist
Logically collective
Level: developer
See also: PetscOptionsDestroyDefault(), PetscOptionsCreate(), PetscOptionsPush(), PetscOptionsPop()
External Links
- PETSc Manual:
Sys/PetscOptionsCreateDefault
PETSc.LibPETSc.PetscOptionsCreateViewer — Method
viewer::PetscViewer,format::PetscViewerFormat,set::PetscBool = PetscOptionsCreateViewer(petsclib::PetscLibType, comm::MPI_Comm, options::Union{Ptr, AbstractPetscOptions}, pre::String, name::String)Creates a viewer appropriate for the type indicated by the user
Collective
Input Parameters:
comm- the communicator to own the vieweroptions- options database, useNULLfor default global databasepre- the string to prepend to the name orNULLname- the options database name that will be checked for
Output Parameters:
viewer- the viewer, passNULLif not neededformat- thePetscViewerFormatrequested by the user, passNULLif not neededset-PETSC_TRUEif found, elsePETSC_FALSE
Level: intermediate
See also: PetscViewerDestroy(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscOptionsPushCreateViewerOff(), PetscOptionsPopCreateViewerOff(), PetscOptionsCreateViewerOff()
External Links
- PETSc Manual:
Viewer/PetscOptionsCreateViewer
PETSc.LibPETSc.PetscOptionsCreateViewers — Method
n_max::PetscInt,set::PetscBool = PetscOptionsCreateViewers(petsclib::PetscLibType, comm::MPI_Comm, options::AbstractPetscOptions, pre::String, name::String, viewers::Vector{PetscViewer}, formats::Vector{PetscViewerFormat})Create multiple viewers from a comma-separated list in the options database
Collective
Input Parameters:
comm- the communicator to own the viewersoptions- options database, useNULLfor default global databasepre- the string to prepend to the name orNULLname- the options database name that will be checked forn_max- on input: the maximum number of viewers; on output: the number of viewers in the comma-separated list
Output Parameters:
viewers- an array to hold at leastn_maxPetscViewers, orNULLif not needed; on output: if notNULL, the
first n_max entries are initialized PetscViewers
formats- an array to hold at leastn_maxPetscViewerFormats, orNULLif not needed; on output: if not
NULL, the first n_max entries are valid PetscViewewFormats
set-PETSC_TRUEif found, elsePETSC_FALSE
Level: intermediate
See also: PetscOptionsCreateViewer()
External Links
- PETSc Manual:
Viewer/PetscOptionsCreateViewers
PETSc.LibPETSc.PetscOptionsDestroy — Method
PetscOptionsDestroy(petsclib::PetscLibType, options::AbstractPetscOptions)Destroys an option database.
Logically Collective on whatever communicator was associated with the call to PetscOptionsCreate()
Input Parameter:
options- thePetscOptionsobject
Level: advanced
See also: PetscOptionsInsert(), PetscOptionsPush(), PetscOptionsPop(), PetscOptionsSetValue()
External Links
- PETSc Manual:
Sys/PetscOptionsDestroy
PETSc.LibPETSc.PetscOptionsDestroyDefault — Method
PetscOptionsDestroyDefault(petsclib::PetscLibType)Destroys the default global options database
Logically collective
Level: developer
See also: PetscOptionsCreateDefault(), PetscOptionsDestroy(), PetscOptionsPush(), PetscOptionsPop()
External Links
- PETSc Manual:
Sys/PetscOptionsDestroyDefault
PETSc.LibPETSc.PetscOptionsFindPair — Method
value::String,set::PetscBool = PetscOptionsFindPair(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets an option name-value pair from the options database.
Not Collective
Input Parameters:
options- options database, useNULLfor the default global databasepre- the string to prepend to the name orNULL, this SHOULD NOT have the "-" prependedname- name of option, this SHOULD have the "-" prepended
Output Parameters:
value- the option value (optional, not used for all options)set- whether the option is set (optional)
Level: developer
See also: PetscOptionsSetValue(), PetscOptionsClearValue()
External Links
- PETSc Manual:
Sys/PetscOptionsFindPair
PETSc.LibPETSc.PetscOptionsGetAll — Method
copts::Ptr{Cchar} = PetscOptionsGetAll(petsclib::PetscLibType, options::AbstractPetscOptions)Lists all the options the program was run with in a single string.
Not Collective
Input Parameter:
options- the options database, useNULLfor the default global database
Output Parameter:
copts- pointer where string pointer is stored
Level: advanced
See also: PetscOptionsAllUsed(), PetscOptionsView(), PetscOptionsPush(), PetscOptionsPop(), PetscOptionsLeftGet()
External Links
- PETSc Manual:
Sys/PetscOptionsGetAll
PETSc.LibPETSc.PetscOptionsGetBool — Method
ivalue::PetscBool,set::PetscBool = PetscOptionsGetBool(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets the Logical (true or false) value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- the string to prepend to the name orNULLname- the option one is seeking
Output Parameters:
ivalue- the logical value to returnset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetBool3(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsGetInt(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetBool
PETSc.LibPETSc.PetscOptionsGetBool3 — Method
ivalue::PetscBool3,set::PetscBool = PetscOptionsGetBool3(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets the ternary logical (true, false or unknown) value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- the string to prepend to the name orNULLname- the option one is seeking
Output Parameters:
ivalue- the ternary logical value to returnset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetBool(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsGetInt(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetBool3
PETSc.LibPETSc.PetscOptionsGetBoolArray — Method
nmax::PetscInt,set::PetscBool = PetscOptionsGetBoolArray(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String, dvalue::Vector{PetscBool}, nmax::PetscInt)Gets an array of Logical (true or false) values for a particular option in the database. The values must be separated with commas with no intervening spaces.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to each name orNULLname- the option one is seeking
Output Parameters:
dvalue- the Boolean values to returnnmax- On input maximum number of values to retrieve, on output the actual number of values retrievedset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetBoolArray
PETSc.LibPETSc.PetscOptionsGetCreateViewerOff — Method
flg::PetscBool = PetscOptionsGetCreateViewerOff(petsclib::PetscLibType)do PetscOptionsCreateViewer(), PetscOptionsViewer(), and PetscOptionsCreateViewers() return viewers
Logically Collective
Output Parameter:
flg- whether viewers are returned.
Level: developer
See also: PetscOptionsCreateViewer(), PetscOptionsPushCreateViewerOff(), PetscOptionsPopCreateViewerOff()
External Links
- PETSc Manual:
Viewer/PetscOptionsGetCreateViewerOff
PETSc.LibPETSc.PetscOptionsGetEList — Method
value::PetscInt,set::PetscBool = PetscOptionsGetEList(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, opt::String, list::String, ntext::PetscInt)Puts a list of option values that a single one may be selected from
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- the string to prepend to the name orNULLopt- option namelist- the possible choices (one of these must be selected, anything else is invalid)ntext- number of choices
Output Parameters:
value- the index of the value to return (defaults to zero if the option name is given but no choice is listed)set-PETSC_TRUEif found, elsePETSC_FALSE
Level: intermediate
See also: PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetEList
PETSc.LibPETSc.PetscOptionsGetEnum — Method
value::PetscEnum,set::PetscBool = PetscOptionsGetEnum(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, opt::String, list::String)Gets the enum value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- option prefix orNULLopt- option namelist- array containing the list of choices, followed by the enum name, followed by the enum prefix, followed by a null
Output Parameters:
value- the value to returnset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscOptionsGetEList(), PetscOptionsEnum()
External Links
- PETSc Manual:
Sys/PetscOptionsGetEnum
PETSc.LibPETSc.PetscOptionsGetEnumArray — Method
nmax::PetscInt,set::PetscBool = PetscOptionsGetEnumArray(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String, list::String, ivalue::Vector{PetscEnum}, nmax::PetscInt)Gets an array of enum values for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- option prefix orNULLname- option namelist- array containing the list of choices, followed by the enum name, followed by the enum prefix, followed by a null
Output Parameters:
ivalue- the enum values to returnnmax- On input maximum number of values to retrieve, on output the actual number of values retrievedset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(), PetscOptionsGetEnum(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscOptionsGetEList(), PetscOptionsEnum()
External Links
- PETSc Manual:
Sys/PetscOptionsGetEnumArray
PETSc.LibPETSc.PetscOptionsGetInt — Method
ivalue::PetscInt,set::PetscBool = PetscOptionsGetInt(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets the integer value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- the string to prepend to the name orNULLname- the option one is seeking
Output Parameters:
ivalue- the integer value to returnset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetInt
PETSc.LibPETSc.PetscOptionsGetIntArray — Method
nmax::PetscInt,set::PetscBool = PetscOptionsGetIntArray(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String, ivalue::Vector{PetscInt}, nmax::PetscInt)Gets an array of integer values for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to each name orNULLname- the option one is seeking
Output Parameters:
ivalue- the integer values to returnnmax- On input maximum number of values to retrieve, on output the actual number of values retrievedset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetIntArray
PETSc.LibPETSc.PetscOptionsGetMPIInt — Method
ivalue::PetscMPIInt,set::PetscBool = PetscOptionsGetMPIInt(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets the MPI integer value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- the string to prepend to the name orNULLname- the option one is seeking
Output Parameters:
ivalue- the MPI integer value to returnset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetMPIInt
PETSc.LibPETSc.PetscOptionsGetReal — Method
dvalue::PetscReal,set::PetscBool = PetscOptionsGetReal(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets the double precision value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to each name orNULLname- the option one is seeking
Output Parameters:
dvalue- the double value to returnset-PETSC_TRUEif found,PETSC_FALSEif not found
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetReal
PETSc.LibPETSc.PetscOptionsGetRealArray — Method
nmax::PetscInt,set::PetscBool = PetscOptionsGetRealArray(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String, dvalue::Vector{PetscReal}, nmax::PetscInt)Gets an array of double precision values for a particular option in the database. The values must be separated with commas with no intervening spaces.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to each name orNULLname- the option one is seeking
Output Parameters:
dvalue- the double values to returnnmax- On input maximum number of values to retrieve, on output the actual number of values retrievedset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetRealArray
PETSc.LibPETSc.PetscOptionsGetScalar — Method
dvalue::PetscScalar,set::PetscBool = PetscOptionsGetScalar(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets the scalar value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to each name orNULLname- the option one is seeking
Output Parameters:
dvalue- the scalar value to returnset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetScalar
PETSc.LibPETSc.PetscOptionsGetScalarArray — Method
nmax::PetscInt,set::PetscBool = PetscOptionsGetScalarArray(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String, dvalue::Vector{PetscScalar}, nmax::PetscInt)Gets an array of scalars for a particular option in the database. The values must be separated with commas with no intervening spaces.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to each name orNULLname- the option one is seeking
Output Parameters:
dvalue- the scalar values to returnnmax- On input maximum number of values to retrieve, on output the actual number of values retrievedset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetScalarArray
PETSc.LibPETSc.PetscOptionsGetString — Method
string::Union{Bool,String} = PetscOptionsGetString(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String, string::String, len::Csize_t)Gets the string value for a particular option in the database.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to name orNULLname- the option one is seekinglen- maximum length of the string including null termination
Output Parameters:
string- returns the value of the parameter ifn set, otherwisefalse
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetString
PETSc.LibPETSc.PetscOptionsGetStringArray — Method
strings::Ptr{Cchar},nmax::PetscInt,set::PetscBool = PetscOptionsGetStringArray(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Gets an array of string values for a particular option in the database. The values must be separated with commas with no intervening spaces.
Not Collective; No Fortran Support
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to name orNULLname- the option one is seeking
Output Parameters:
strings- location to copy stringsnmax- On input maximum number of strings, on output the actual number of strings foundset-PETSC_TRUEif found, elsePETSC_FALSE
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsGetStringArray
PETSc.LibPETSc.PetscOptionsGetVec — Method
set::PetscBool = PetscOptionsGetVec(petsclib::PetscLibType, options::AbstractPetscOptions, prefix::String, key::String, v::AbstractPetscVec)Gets a Vec from the options database as an array of real values
Collective
Input Parameters:
options- the options database, orNULLfor the default global oneprefix- an option prefix, orNULLkey- the option name (must include the leading-)
Output Parameters:
v- the vector to fill in on option match; unchanged if the option is not foundset-PETSC_TRUEif the option was found (may beNULL)
Level: intermediate
See also: Vec, PetscOptionsGetRealArray(), PetscOptionsGetInt(), PetscOptionsGetReal(), VecView()
External Links
- PETSc Manual:
Vec/PetscOptionsGetVec
PETSc.LibPETSc.PetscOptionsGetenv — Method
flag::PetscBool = PetscOptionsGetenv(petsclib::PetscLibType, comm::MPI_Comm, name::String, env::String, len::Csize_t)Gets an environmental variable, broadcasts to all processors in communicator from MPI rank zero
Collective
Input Parameters:
comm- communicator to share variablename- name of environmental variablelen- amount of space allocated to hold variable
Output Parameters:
flag- if notNULLindicates if the variable was foundenv- value of variable
Level: advanced
See also: PetscOptionsHasName()
External Links
- PETSc Manual:
Sys/PetscOptionsGetenv
PETSc.LibPETSc.PetscOptionsHasHelp — Method
set::PetscBool = PetscOptionsHasHelp(petsclib::PetscLibType, options::AbstractPetscOptions)Determines whether the "-help" option is in the database.
Not Collective
Input Parameter:
options- options database, useNULLfor default global database
Output Parameter:
set-PETSC_TRUEif found elsePETSC_FALSE.
Level: advanced
See also: PetscOptionsHasName()
External Links
- PETSc Manual:
Sys/PetscOptionsHasHelp
PETSc.LibPETSc.PetscOptionsHasName — Method
set::PetscBool = PetscOptionsHasName(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String)Determines whether a certain option is given in the database. This returns true whether the option is a number, string or Boolean, even if its value is set to false.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- string to prepend to the name orNULLname- the option one is seeking
Output Parameter:
set-PETSC_TRUEif found elsePETSC_FALSE.
Level: beginner
See also: PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsHasName
PETSc.LibPETSc.PetscOptionsInsert — Method
argc::Cint = PetscOptionsInsert(petsclib::PetscLibType, options::AbstractPetscOptions, args::Cchar, file::String)Inserts into the options database from the command line, the environmental variable and a file.
Collective on PETSC_COMM_WORLD
Input Parameters:
options- options database orNULLfor the default global databaseargc- count of number of command line argumentsargs- the command line argumentsfile- [optional] PETSc database file, append ":yaml" to filename to specify YAML options format.
Use NULL or empty string to not check for code specific file. Also checks ~/.petscrc, .petscrc and petscrc. Use -skip_petscrc in the code specific file (or command line) to skip ~/.petscrc, .petscrc and petscrc files.
Options Database Keys:
-options_file filename- read options from a file-options_file_yaml filename- read options from a YAML file
Level: advanced
See also: PetscOptionsDestroy(), PetscOptionsView(), PetscOptionsInsertString(), PetscOptionsInsertFile(), PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscOptionsInsert
PETSc.LibPETSc.PetscOptionsInsertArgs — Method
PetscOptionsInsertArgs(petsclib::PetscLibType, options::AbstractPetscOptions, argc::Cint, args::String)Inserts options into the database from a array of strings
Logically Collective
Input Parameters:
options- options objectargc- the array lengthargs- the string array
Level: intermediate
See also: PetscOptions, PetscOptionsInsertString(), PetscOptionsInsertFile()
External Links
- PETSc Manual:
Sys/PetscOptionsInsertArgs
PETSc.LibPETSc.PetscOptionsInsertFile — Method
PetscOptionsInsertFile(petsclib::PetscLibType, comm::MPI_Comm, options::AbstractPetscOptions, file::String, require::PetscBool)Inserts options into the database from a file.
Collective
Input Parameters:
comm- the processes that will share the options (usuallyPETSC_COMM_WORLD)options- options database, useNULLfor default global databasefile- name of file,
".yml" and ".yaml" filename extensions are inserted as YAML options, append ":yaml" to filename to force YAML options.
require- ifPETSC_TRUEwill generate an error if the file does not exist
Level: developer
See also: PetscOptionsSetValue(), PetscOptionsView(), PetscOptionsHasName(), PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsInsertFile
PETSc.LibPETSc.PetscOptionsInsertFileYAML — Method
PetscOptionsInsertFileYAML(petsclib::PetscLibType, comm::MPI_Comm, options::AbstractPetscOptions, file::String, require::PetscBool)Insert a YAML-formatted file in the options database
Collective
Input Parameters:
comm- the processes that will share the options (usuallyPETSC_COMM_WORLD)options- options database, useNULLfor default global databasefile- name of filerequire- ifPETSC_TRUEwill generate an error if the file does not exist
Level: intermediate
See also: PetscOptionsSetValue(), PetscOptionsView(), PetscOptionsHasName(), PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscOptionsInsertFile(), PetscOptionsInsertStringYAML()
External Links
- PETSc Manual:
Sys/PetscOptionsInsertFileYAML
PETSc.LibPETSc.PetscOptionsInsertString — Method
PetscOptionsInsertString(petsclib::PetscLibType, options::AbstractPetscOptions, in_str::String)Inserts options into the database from a string
Logically Collective
Input Parameters:
options- options objectin_str- string that contains options separated by blanks
Level: intermediate
The collectivity of this routine is complex; only the MPI processes that call this routine will have the affect of these options. If some processes that create objects call this routine and others do not the code may fail in complicated ways because the same parallel solvers may incorrectly use different options on different ranks.
Contributed by Boyana Norris
See also: PetscOptionsSetValue(), PetscOptionsView(), PetscOptionsHasName(), PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscOptionsInsertFile()
External Links
- PETSc Manual:
Sys/PetscOptionsInsertString
PETSc.LibPETSc.PetscOptionsInsertStringYAML — Method
PetscOptionsInsertStringYAML(petsclib::PetscLibType, options::AbstractPetscOptions, in_str::String)Inserts YAML-formatted options into the options database from a string
Logically Collective
Input Parameters:
options- options database, useNULLfor default global databasein_str- YAML-formatted string options
Level: intermediate
See also: PetscOptionsSetValue(), PetscOptionsView(), PetscOptionsHasName(), PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), PetscOptionsInsertFile(), PetscOptionsInsertFileYAML()
External Links
- PETSc Manual:
Sys/PetscOptionsInsertStringYAML
PETSc.LibPETSc.PetscOptionsLeft — Method
PetscOptionsLeft(petsclib::PetscLibType, options::AbstractPetscOptions)Prints to screen any options that were set and never used.
Not Collective
Input Parameter:
options- options database; useNULLfor default global database
Options Database Key:
-options_left- activatesPetscOptionsAllUsed()withinPetscFinalize()
Level: advanced
See also: PetscOptionsAllUsed()
External Links
- PETSc Manual:
Sys/PetscOptionsLeft
PETSc.LibPETSc.PetscOptionsLeftError — Method
PetscOptionsLeftError(petsclib::PetscLibType)Prints a warning listing any options in the default database that were never used
Not Collective
Level: developer
See also: PetscOptionsLeft(), PetscOptionsAllUsed(), PetscOptionsView()
External Links
- PETSc Manual:
Sys/PetscOptionsLeftError
PETSc.LibPETSc.PetscOptionsLeftGet — Method
N::PetscInt,names::Vector{String},values::Vector{String} = PetscOptionsLeftGet(petsclib::PetscLibType, options::AbstractPetscOptions)Returns all options that were set and never used.
Not Collective
Input Parameter:
options- options database, useNULLfor default global database
Output Parameters:
N- count of options not usednames- names of options not usedvalues- values of options not used
Level: advanced
See also: PetscOptionsAllUsed(), PetscOptionsLeft()
External Links
- PETSc Manual:
Sys/PetscOptionsLeftGet
PETSc.LibPETSc.PetscOptionsLeftRestore — Method
PetscOptionsLeftRestore(petsclib::PetscLibType, options::AbstractPetscOptions, N::PetscInt, names::String, values::String)Free memory for the unused PETSc options obtained using PetscOptionsLeftGet().
Not Collective
Input Parameters:
options- options database, useNULLfor default global databaseN- count of options not usednames- names of options not usedvalues- values of options not used
Level: advanced
See also: PetscOptionsAllUsed(), PetscOptionsLeft(), PetscOptionsLeftGet()
External Links
- PETSc Manual:
Sys/PetscOptionsLeftRestore
PETSc.LibPETSc.PetscOptionsMonitorDefault — Method
PetscOptionsMonitorDefault(petsclib::PetscLibType, name::String, value::String, source::PetscOptionSource, ctx::Ptr{Cvoid})Print all options set value events using the supplied PetscViewer.
Logically Collective
Input Parameters:
name- option name stringvalue- option value stringsource- The source for the optionctx- aPETSCVIEWERASCIIorNULL
Level: intermediate
See also: PetscOptionsMonitorSet()
External Links
- PETSc Manual:
Sys/PetscOptionsMonitorDefault
PETSc.LibPETSc.PetscOptionsMonitorSet — Method
PetscOptionsMonitorSet(petsclib::PetscLibType, monitor::external, mctx::Ptr{Cvoid}, monitordestroy::Ptr{Cvoid})Sets an ADDITIONAL function to be called at every method that modified the PETSc options database.
Not Collective
Input Parameters:
monitor- pointer to function (if this isNULL, it turns off monitoringmctx- [optional] context for private data for the monitor routine (useNULLif
no context is desired)
monitordestroy- [optional] routine that frees monitor context (may beNULL), seePetscCtxDestroyFnfor its calling sequence
Calling sequence of monitor:
name- option name stringvalue- option value string, a value ofNULLindicates the option is being removed from the database. A value
of "" indicates the option is in the database but has no value.
source- option sourcemctx- optional monitoring context, as set byPetscOptionsMonitorSet()
Options Database Keys:
-options_monitor viewer- turn on default monitoring of changes to the options database-options_monitor_cancel- turn off any option monitors except the default monitor obtained with-options_monitor
Level: intermediate
See also: PetscOptionsMonitorDefault(), PetscInitialize(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Sys/PetscOptionsMonitorSet
PETSc.LibPETSc.PetscOptionsPop — Method
PetscOptionsPop(petsclib::PetscLibType)Pop the most recent PetscOptionsPush() to return to the previous default options
Logically Collective on whatever communicator was associated with the call to PetscOptionsCreate()
Level: advanced
See also: PetscOptionsCreate(), PetscOptionsInsert(), PetscOptionsSetValue(), PetscOptionsLeft()
External Links
- PETSc Manual:
Sys/PetscOptionsPop
PETSc.LibPETSc.PetscOptionsPopCreateViewerOff — Method
PetscOptionsPopCreateViewerOff(petsclib::PetscLibType)reset whether PetscOptionsCreateViewer() returns a viewer.
Logically Collective
Level: developer
See also: PetscOptionsCreateViewer(), PetscOptionsPushCreateViewerOff()
External Links
- PETSc Manual:
Viewer/PetscOptionsPopCreateViewerOff
PETSc.LibPETSc.PetscOptionsPrefixPop — Method
PetscOptionsPrefixPop(petsclib::PetscLibType, options::AbstractPetscOptions)Remove the latest options prefix, see PetscOptionsPrefixPush() for details
Logically Collective on the MPI_Comm used when called PetscOptionsPrefixPush()
Input Parameter:
options- options database, orNULLfor the default global database
Level: advanced
See also: PetscOptionsPrefixPush(), PetscOptionsPush(), PetscOptionsPop(), PetscOptionsCreate(), PetscOptionsSetValue()
External Links
- PETSc Manual:
Sys/PetscOptionsPrefixPop
PETSc.LibPETSc.PetscOptionsPrefixPush — Method
PetscOptionsPrefixPush(petsclib::PetscLibType, options::AbstractPetscOptions, prefix::String)Designate a prefix to be used by all options insertions to follow.
Logically Collective
Input Parameters:
options- options database, orNULLfor the default global databaseprefix- The string to append to the existing prefix
Options Database Keys:
-prefix_push some_prefix_- push the given prefix-prefix_pop- pop the last prefix
Level: advanced
See also: PetscOptionsPrefixPop(), PetscOptionsPush(), PetscOptionsPop(), PetscOptionsCreate(), PetscOptionsSetValue()
External Links
- PETSc Manual:
Sys/PetscOptionsPrefixPush
PETSc.LibPETSc.PetscOptionsPush — Method
PetscOptionsPush(petsclib::PetscLibType, opt::AbstractPetscOptions)Push a new PetscOptions object as the default provider of options Allows using different parts of a code to use different options databases
Logically Collective
Input Parameter:
opt- the options obtained withPetscOptionsCreate()
Level: advanced
See also: PetscOptionsPop(), PetscOptionsCreate(), PetscOptionsInsert(), PetscOptionsSetValue(), PetscOptionsLeft()
External Links
- PETSc Manual:
Sys/PetscOptionsPush
PETSc.LibPETSc.PetscOptionsPushCreateViewerOff — Method
PetscOptionsPushCreateViewerOff(petsclib::PetscLibType, flg::PetscBool)sets if PetscOptionsCreateViewer(), PetscOptionsViewer(), and PetscOptionsCreateViewers() return viewers.
Logically Collective
Input Parameter:
flg-PETSC_TRUEto turn off viewer creation,PETSC_FALSEto turn it on.
Level: developer
See also: PetscOptionsCreateViewer(), PetscOptionsPopCreateViewerOff()
External Links
- PETSc Manual:
Viewer/PetscOptionsPushCreateViewerOff
PETSc.LibPETSc.PetscOptionsReject — Method
PetscOptionsReject(petsclib::PetscLibType, options::AbstractPetscOptions, pre::String, name::String, mess::String)Generates an error if a certain option is given.
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasepre- the option prefix (may beNULL)name- the option name one is seekingmess- error message (may beNULL)
Level: advanced
See also: PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsReject
PETSc.LibPETSc.PetscOptionsSetAlias — Method
PetscOptionsSetAlias(petsclib::PetscLibType, options::AbstractPetscOptions, newname::String, oldname::String)Makes a key and alias for another key
Logically Collective
Input Parameters:
options- options database, orNULLfor default global databasenewname- the aliasoldname- the name that alias will refer to
Level: advanced
See also: PetscOptionsGetInt(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList()
External Links
- PETSc Manual:
Sys/PetscOptionsSetAlias
PETSc.LibPETSc.PetscOptionsSetValue — Method
PetscOptionsSetValue(petsclib::PetscLibType, options::AbstractPetscOptions, name::String, value::Union{Ptr, String})Sets an option name-value pair in the options database, overriding whatever is already present.
Logically Collective
Input Parameters:
options- options database, useNULLfor the default global databasename- name of option, this SHOULD have the - prependedvalue- the option value (not used for all options, so can beNULL)
Level: intermediate
See also: PetscOptionsInsert(), PetscOptionsClearValue()
External Links
- PETSc Manual:
Sys/PetscOptionsSetValue
PETSc.LibPETSc.PetscOptionsStringToBool — Method
a::PetscBool = PetscOptionsStringToBool(petsclib::PetscLibType, value::String)Converts a string to a PetscBool
Not Collective
Input Parameter:
value- the string to convert; may beNULLor""
Output Parameter:
a- the resultingPetscBool
Level: developer
See also: PetscOptionsStringToInt(), PetscOptionsStringToReal(), PetscOptionsStringToScalar(), PetscOptionsGetBool()
External Links
- PETSc Manual:
Sys/PetscOptionsStringToBool
PETSc.LibPETSc.PetscOptionsStringToInt — Method
a::PetscInt = PetscOptionsStringToInt(petsclib::PetscLibType, name::String)Converts a string to an integer value. Handles special cases such as "default" and "decide"
Not Collective
Input Parameter:
name- the string to convert
Output Parameter:
a- the resultingPetscIntvalue
Level: developer
See also: PetscOptionsStringToReal(), PetscOptionsStringToScalar(), PetscOptionsStringToBool(), PetscOptionsGetInt()
External Links
- PETSc Manual:
Sys/PetscOptionsStringToInt
PETSc.LibPETSc.PetscOptionsStringToReal — Method
a::PetscReal = PetscOptionsStringToReal(petsclib::PetscLibType, name::String)Converts a string to a PetscReal value. Handles special cases like default and decide
Not Collective
Input Parameter:
name- the string to convert
Output Parameter:
a- the resultingPetscRealvalue
Level: developer
See also: PetscOptionsStringToInt(), PetscOptionsStringToScalar(), PetscOptionsStringToBool(), PetscOptionsGetReal()
External Links
- PETSc Manual:
Sys/PetscOptionsStringToReal
PETSc.LibPETSc.PetscOptionsStringToScalar — Method
a::PetscScalar = PetscOptionsStringToScalar(petsclib::PetscLibType, name::String)Converts a string to a PetscScalar value; when PETSc is built with complex scalars, parses an optional imaginary part
Not Collective
Input Parameter:
name- the string to convert
Output Parameter:
a- the resultingPetscScalarvalue
Level: developer
See also: PetscOptionsStringToInt(), PetscOptionsStringToReal(), PetscOptionsStringToBool(), PetscOptionsGetScalar()
External Links
- PETSc Manual:
Sys/PetscOptionsStringToScalar
PETSc.LibPETSc.PetscOptionsUsed — Method
used::PetscBool = PetscOptionsUsed(petsclib::PetscLibType, options::AbstractPetscOptions, name::String)Indicates if PETSc has used a particular option set in the database
Not Collective
Input Parameters:
options- options database, useNULLfor default global databasename- string name of option
Output Parameter:
used-PETSC_TRUEif the option was used, otherwise false, including if option was not found in options database
Level: advanced
See also: PetscOptionsView(), PetscOptionsLeft(), PetscOptionsAllUsed()
External Links
- PETSc Manual:
Sys/PetscOptionsUsed
PETSc.LibPETSc.PetscOptionsValidKey — Method
valid::PetscBool = PetscOptionsValidKey(petsclib::PetscLibType, key::String)PETSc Options database keys must begin with one or two dashes (-) followed by a letter.
Not Collective
Input Parameter:
key- string to check if valid
Output Parameter:
valid-PETSC_TRUEif a valid key
Level: intermediate
See also: PetscOptionsCreate(), PetscOptionsInsert()
External Links
- PETSc Manual:
Sys/PetscOptionsValidKey
PETSc.LibPETSc.PetscOptionsView — Method
PetscOptionsView(petsclib::PetscLibType, options::AbstractPetscOptions, viewer::PetscViewer)Prints the options that have been loaded. This is useful for debugging purposes.
Logically Collective, No Fortran Support
Input Parameters:
options- options database, useNULLfor default global databaseviewer- must be anPETSCVIEWERASCIIviewer
Options Database Key:
-options_view- ActivatesPetscOptionsView()withinPetscFinalize()
Level: advanced
See also: PetscOptionsAllUsed()
External Links
- PETSc Manual:
Sys/PetscOptionsView
Options helpers (PetscOptionsGetViewer, ...)
PETSc.LibPETSc.PetscOptionsHelpPrintedCheck — Method
found::PetscBool = PetscOptionsHelpPrintedCheck(petsclib::PetscLibType, hp::PetscOptionsHelpPrCinted, pre::String, name::String)Checks if a particular pre, name pair has previous been entered (meaning the help message was printed)
Not Collective
Input Parameters:
hp- the object used to manage tracking what help messages have been printedpre- the prefix part of the string, many beNULLname- the string to look for (cannot beNULL)
Output Parameter:
found-PETSC_TRUEif the string was already set
Level: intermediate
See also: PetscOptionsHelpPrintedCreate()
External Links
- PETSc Manual:
Viewer/PetscOptionsHelpPrintedCheck
PETSc.LibPETSc.PetscOptionsHelpPrintedCreate — Method
hp::PetscOptionsHelpPrCinted = PetscOptionsHelpPrintedCreate(petsclib::PetscLibType)Creates an object used to manage tracking which help messages have been printed so they will not be printed again.
Output Parameter:
hp- the created object
Not Collective
Level: developer
See also: PetscOptionsHelpPrintedCheck(), PetscOptionsHelpPrintChecked()
External Links
- PETSc Manual:
Viewer/PetscOptionsHelpPrintedCreate
PETSc.LibPETSc.PetscOptionsHelpPrintedDestroy — Method
PetscOptionsHelpPrintedDestroy(petsclib::PetscLibType, hp::Union{PetscOptionsHelpPrCinted, Ref{PetscOptionsHelpPrCinted}})Destroys the object used to track which help messages have already been printed
Not Collective
Input Parameter:
hp- pointer to thePetscOptionsHelpPrintedobject to destroy; set toNULLon return
Level: developer
See also: PetscOptionsHelpPrintedCreate(), PetscOptionsHelpPrintedCheck()
External Links
- PETSc Manual:
Viewer/PetscOptionsHelpPrintedDestroy