Actual source code: petscoptions.h

      1: /*
      2:    Routines to determine options set in the options database.
      3: */
     6:  #include petsc.h

      9: EXTERN PetscErrorCode  PetscOptionsHasName(const char[],const char[],PetscTruth*);
     10: EXTERN PetscErrorCode  PetscOptionsGetInt(const char[],const char [],PetscInt *,PetscTruth*);
     11: EXTERN PetscErrorCode  PetscOptionsGetLogical(const char[],const char [],PetscTruth *,PetscTruth*);
     12: EXTERN PetscErrorCode  PetscOptionsGetReal(const char[],const char[],PetscReal *,PetscTruth*);
     13: EXTERN PetscErrorCode  PetscOptionsGetScalar(const char[],const char[],PetscScalar *,PetscTruth*);
     14: EXTERN PetscErrorCode  PetscOptionsGetIntArray(const char[],const char[],PetscInt[],PetscInt *,PetscTruth*);
     15: EXTERN PetscErrorCode  PetscOptionsGetRealArray(const char[],const char[],PetscReal[],PetscInt *,PetscTruth*);
     16: EXTERN PetscErrorCode  PetscOptionsGetString(const char[],const char[],char[],size_t,PetscTruth*);
     17: EXTERN PetscErrorCode  PetscOptionsGetStringArray(const char[],const char[],char*[],PetscInt*,PetscTruth*);

     19: EXTERN PetscErrorCode  PetscOptionsSetAlias(const char[],const char[]);
     20: EXTERN PetscErrorCode  PetscOptionsSetValue(const char[],const char[]);
     21: EXTERN PetscErrorCode  PetscOptionsClearValue(const char[]);

     23: EXTERN PetscErrorCode  PetscOptionsAllUsed(int*);
     24: EXTERN PetscErrorCode  PetscOptionsLeft(void);
     25: EXTERN PetscErrorCode  PetscOptionsPrint(FILE *);

     27: EXTERN PetscErrorCode  PetscOptionsCreate(void);
     28: EXTERN PetscErrorCode  PetscOptionsInsert(int*,char ***,const char[]);
     29: EXTERN PetscErrorCode  PetscOptionsInsertFile(const char[]);
     30: EXTERN PetscErrorCode  PetscOptionsInsertString(const char[]);
     31: EXTERN PetscErrorCode  PetscOptionsDestroy(void);

     33: EXTERN PetscErrorCode  PetscOptionsReject(const char[],const char[]);
     34: EXTERN PetscErrorCode  PetscOptionsGetAll(char*[]);

     36: EXTERN PetscErrorCode  PetscOptionsGetenv(MPI_Comm,const char[],char[],size_t,PetscTruth *);
     37: EXTERN PetscErrorCode  PetscOptionsAtoi(const char[],PetscInt*);
     38: EXTERN PetscErrorCode  PetscOptionsAtod(const char[],PetscReal*);

     43: /*MC
     44:     PetscOptionsBegin - Begins a set of queries on the options database that are related and should be
     45:      displayed on the same window of a GUI that allows the user to set the options interactively.

     47:    Synopsis: PetscErrorCode PetscOptionsBegin(MPI_Comm comm,const char prefix[],const char title[],const char mansec[])

     49:     Collective on MPI_Comm

     51:   Input Parameters:
     52: +   comm - communicator that shares GUI
     53: .   prefix - options prefix for all options displayed on window
     54: .   title - short descriptive text, for example "Krylov Solver Options"
     55: -   mansec - section of manual pages for options, for example KSP

     57:   Level: intermediate

     59:   Notes: Needs to be ended by a call the PetscOptionsEnd()

     61:          Can add subheadings with PetscOptionsHead()

     63: .seealso: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(),
     64:           PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical()
     65:           PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsLogical(),
     66:           PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(),
     67:           PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(),
     68:           PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(),
     69:           PetscOptionsList(), PetscOptionsEList()

     71: M*/
     72: #define    PetscOptionsBegin(comm,prefix,mess,sec) 0; {\
     73:              for (PetscOptionsPublishCount=(PetscOptionsPublish?-1:1); PetscOptionsPublishCount<2; PetscOptionsPublishCount++) {\
     74:              int _5_PetscOptionsBegin_Private(comm,prefix,mess,sec);CHKERRQ(_5_ierr);

     76: /*MC
     77:     PetscOptionsEnd - Ends a set of queries on the options database that are related and should be
     78:      displayed on the same window of a GUI that allows the user to set the options interactively.

     80:     Collective on the MPI_Comm used in PetscOptionsBegin()

     82:    Synopsis: PetscErrorCode PetscOptionsEnd(void)

     84:   Level: intermediate

     86:   Notes: Needs to be preceded by a call to PetscOptionsBegin()

     88: .seealso: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(),
     89:           PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical()
     90:           PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsLogical(),
     91:           PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(),
     92:           PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(),
     93:           PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(),
     94:           PetscOptionsList(), PetscOptionsEList()

     96: M*/
     97: #define    PetscOptionsEnd() _5_PetscOptionsEnd_Private();CHKERRQ(_5_ierr);}}

     99: EXTERN PetscErrorCode PetscOptionsBegin_Private(MPI_Comm,const char[],const char[],const char[]);
    100: EXTERN PetscErrorCode PetscOptionsEnd_Private(void);
    101: EXTERN PetscErrorCode PetscOptionsHead(const char[]);

    103: /*MC
    104:      PetscOptionsTail - Ends a section of options begun with PetscOptionsHead()
    105:             See, for example, KSPSetFromOptions_GMRES().

    107:    Collective on the communicator passed in PetscOptionsBegin()

    109:    Synopsis: PetscErrorCode PetscOptionsTail(void)

    111:   Level: intermediate

    113:    Notes: Must be between a PetscOptionsBegin() and a PetscOptionsEnd()

    115:           Must be preceded by a call to PetscOptionsHead() in the same function.

    117:    Concepts: options database^subheading

    119: .seealso: PetscOptionsGetInt(), PetscOptionsGetReal(),
    120:            PetscOptionsHasName(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical(),
    121:           PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(),
    122:           PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(),
    123:           PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(),
    124:           PetscOptionsList(), PetscOptionsEList()
    125: M*/
    126: #define    PetscOptionsTail() 0; {if (PetscOptionsPublishCount != 1) return(0);}

    128: EXTERN PetscErrorCode PetscOptionsInt(const char[],const char[],const char[],PetscInt,PetscInt*,PetscTruth*);
    129: EXTERN PetscErrorCode PetscOptionsReal(const char[],const char[],const char[],PetscReal,PetscReal*,PetscTruth*);
    130: EXTERN PetscErrorCode PetscOptionsScalar(const char[],const char[],const char[],PetscScalar,PetscScalar*,PetscTruth*);
    131: EXTERN PetscErrorCode PetscOptionsName(const char[],const char[],const char[],PetscTruth*);
    132: EXTERN PetscErrorCode PetscOptionsString(const char[],const char[],const char[],const char[],char*,size_t,PetscTruth*);
    133: EXTERN PetscErrorCode PetscOptionsLogical(const char[],const char[],const char[],PetscTruth,PetscTruth*,PetscTruth*);
    134: EXTERN PetscErrorCode PetscOptionsLogicalGroupBegin(const char[],const char[],const char[],PetscTruth*);
    135: EXTERN PetscErrorCode PetscOptionsLogicalGroup(const char[],const char[],const char[],PetscTruth*);
    136: EXTERN PetscErrorCode PetscOptionsLogicalGroupEnd(const char[],const char[],const char[],PetscTruth*);
    137: EXTERN PetscErrorCode PetscOptionsList(const char[],const char[],const char[],PetscFList,const char[],char[],PetscInt,PetscTruth*);
    138: EXTERN PetscErrorCode PetscOptionsEList(const char[],const char[],const char[],const char*[],PetscInt,const char[],PetscInt*,PetscTruth*);
    139: EXTERN PetscErrorCode PetscOptionsRealArray(const char[],const char[],const char[],PetscReal[],PetscInt*,PetscTruth*);
    140: EXTERN PetscErrorCode PetscOptionsIntArray(const char[],const char[],const char[],PetscInt[],PetscInt*,PetscTruth*);
    141: EXTERN PetscErrorCode PetscOptionsStringArray(const char[],const char[],const char[],char*[],PetscInt*,PetscTruth*);

    144: #endif