1f26ada1bSBarry Smith /* 237f753daSBarry Smith Routines to determine options set in the options database. 3f26ada1bSBarry Smith */ 40a835dfdSSatish Balay #if !defined(__PETSCOPTIONS_H) 50a835dfdSSatish Balay #define __PETSCOPTIONS_H 63a3b2205SBarry Smith #include "petsc.h" 7e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN 83a3b2205SBarry Smith 9ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsHasName(const char[],const char[],PetscTruth*); 10045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsHasName,(const char b[],PetscTruth *f),(PETSC_NULL,b,f)) 11ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetInt(const char[],const char [],PetscInt *,PetscTruth*); 12045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetInt,(const char b[],PetscInt *i,PetscTruth *f),(PETSC_NULL,b,i,f)) 13ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetLogical(const char[],const char [],PetscTruth *,PetscTruth*); 14045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetLogical,(const char b[],PetscTruth *i,PetscTruth *f),(PETSC_NULL,b,i,f)) 15ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetReal(const char[],const char[],PetscReal *,PetscTruth*); 16045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetReal,(const char b[],PetscReal *i,PetscTruth *f),(PETSC_NULL,b,i,f)) 17ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetScalar(const char[],const char[],PetscScalar *,PetscTruth*); 18045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetScalar,(const char b[],PetscScalar i[],PetscTruth *f),(PETSC_NULL,b,i,f)) 19ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetIntArray(const char[],const char[],PetscInt[],PetscInt *,PetscTruth*); 20045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetIntArray,(const char b[],PetscInt i[],PetscInt *ii,PetscTruth *f),(PETSC_NULL,b,i,ii,f)) 21ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetRealArray(const char[],const char[],PetscReal[],PetscInt *,PetscTruth*); 22045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetRealArray,(const char b[],PetscReal i[],PetscInt *ii,PetscTruth *f),(PETSC_NULL,b,i,ii,f)) 23ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetString(const char[],const char[],char[],size_t,PetscTruth*); 24045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetString,(const char b[],char i[],size_t s,PetscTruth *f),(PETSC_NULL,b,i,s,f)) 25ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetStringArray(const char[],const char[],char*[],PetscInt*,PetscTruth*); 26045ff3e0SBarry Smith PetscPolymorphicSubroutine(PetscOptionsGetStringArray,(const char b[],char *i[],PetscInt *ii,PetscTruth *f),(PETSC_NULL,b,i,ii,f)) 273a3b2205SBarry Smith 28ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsSetAlias(const char[],const char[]); 29ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsSetValue(const char[],const char[]); 30ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsClearValue(const char[]); 313a3b2205SBarry Smith 32ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsAllUsed(int*); 33ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsLeft(void); 34ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsPrint(FILE *); 354b0e389bSBarry Smith 36ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsCreate(void); 37ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsInsert(int*,char ***,const char[]); 38ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsInsertFile(const char[]); 39ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsInsertString(const char[]); 40ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsDestroy(void); 415d0dffe5SBarry Smith 42ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsReject(const char[],const char[]); 43ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetAll(char*[]); 445d0dffe5SBarry Smith 45ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsGetenv(MPI_Comm,const char[],char[],size_t,PetscTruth *); 46ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsAtoi(const char[],PetscInt*); 47ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsAtod(const char[],PetscReal*); 482e8a6d31SBarry Smith 49ff73aad6SKris Buschelman extern PETSC_DLLEXPORT PetscTruth PetscOptionsPublish; 50*7c307921SBarry Smith extern PETSC_DLLEXPORT PetscInt PetscOptionsPublishCount; 5130de9b25SBarry Smith 5230de9b25SBarry Smith /*MC 5330de9b25SBarry Smith PetscOptionsBegin - Begins a set of queries on the options database that are related and should be 5430de9b25SBarry Smith displayed on the same window of a GUI that allows the user to set the options interactively. 5530de9b25SBarry Smith 56d360dc6fSBarry Smith Synopsis: PetscErrorCode PetscOptionsBegin(MPI_Comm comm,const char prefix[],const char title[],const char mansec[]) 5730de9b25SBarry Smith 5830de9b25SBarry Smith Collective on MPI_Comm 5930de9b25SBarry Smith 6030de9b25SBarry Smith Input Parameters: 6130de9b25SBarry Smith + comm - communicator that shares GUI 6230de9b25SBarry Smith . prefix - options prefix for all options displayed on window 6330de9b25SBarry Smith . title - short descriptive text, for example "Krylov Solver Options" 6430de9b25SBarry Smith - mansec - section of manual pages for options, for example KSP 6530de9b25SBarry Smith 6630de9b25SBarry Smith Level: intermediate 6730de9b25SBarry Smith 6830de9b25SBarry Smith Notes: Needs to be ended by a call the PetscOptionsEnd() 6930de9b25SBarry Smith 7030de9b25SBarry Smith Can add subheadings with PetscOptionsHead() 7130de9b25SBarry Smith 7230de9b25SBarry Smith .seealso: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(), 7330de9b25SBarry Smith PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical() 7430de9b25SBarry Smith PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsLogical(), 7530de9b25SBarry Smith PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(), 7630de9b25SBarry Smith PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(), 7730de9b25SBarry Smith PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(), 7830de9b25SBarry Smith PetscOptionsList(), PetscOptionsEList() 7930de9b25SBarry Smith 8030de9b25SBarry Smith M*/ 81b0a32e0cSBarry Smith #define PetscOptionsBegin(comm,prefix,mess,sec) 0; {\ 82b0a32e0cSBarry Smith for (PetscOptionsPublishCount=(PetscOptionsPublish?-1:1); PetscOptionsPublishCount<2; PetscOptionsPublishCount++) {\ 83*7c307921SBarry Smith PetscErrorCode _5_ierr = PetscOptionsBegin_Private(comm,prefix,mess,sec);CHKERRQ(_5_ierr); 8430de9b25SBarry Smith 8530de9b25SBarry Smith /*MC 8630de9b25SBarry Smith PetscOptionsEnd - Ends a set of queries on the options database that are related and should be 8730de9b25SBarry Smith displayed on the same window of a GUI that allows the user to set the options interactively. 8830de9b25SBarry Smith 8930de9b25SBarry Smith Collective on the MPI_Comm used in PetscOptionsBegin() 9030de9b25SBarry Smith 91d360dc6fSBarry Smith Synopsis: PetscErrorCode PetscOptionsEnd(void) 9230de9b25SBarry Smith 9330de9b25SBarry Smith Level: intermediate 9430de9b25SBarry Smith 9530de9b25SBarry Smith Notes: Needs to be preceded by a call to PetscOptionsBegin() 9630de9b25SBarry Smith 9730de9b25SBarry Smith .seealso: PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetInt(), 9830de9b25SBarry Smith PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical() 9930de9b25SBarry Smith PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsLogical(), 10030de9b25SBarry Smith PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(), 10130de9b25SBarry Smith PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(), 10230de9b25SBarry Smith PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(), 10330de9b25SBarry Smith PetscOptionsList(), PetscOptionsEList() 10430de9b25SBarry Smith 10530de9b25SBarry Smith M*/ 106ef66eb69SBarry Smith #define PetscOptionsEnd() _5_ierr = PetscOptionsEnd_Private();CHKERRQ(_5_ierr);}} 10730de9b25SBarry Smith 108ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsBegin_Private(MPI_Comm,const char[],const char[],const char[]); 109ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsEnd_Private(void); 110ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsHead(const char[]); 11130de9b25SBarry Smith 11230de9b25SBarry Smith /*MC 11330de9b25SBarry Smith PetscOptionsTail - Ends a section of options begun with PetscOptionsHead() 11430de9b25SBarry Smith See, for example, KSPSetFromOptions_GMRES(). 11530de9b25SBarry Smith 11630de9b25SBarry Smith Collective on the communicator passed in PetscOptionsBegin() 11730de9b25SBarry Smith 118d360dc6fSBarry Smith Synopsis: PetscErrorCode PetscOptionsTail(void) 11930de9b25SBarry Smith 12030de9b25SBarry Smith Level: intermediate 12130de9b25SBarry Smith 12230de9b25SBarry Smith Notes: Must be between a PetscOptionsBegin() and a PetscOptionsEnd() 12330de9b25SBarry Smith 12430de9b25SBarry Smith Must be preceded by a call to PetscOptionsHead() in the same function. 12530de9b25SBarry Smith 12630de9b25SBarry Smith Concepts: options database^subheading 12730de9b25SBarry Smith 12830de9b25SBarry Smith .seealso: PetscOptionsGetInt(), PetscOptionsGetReal(), 12930de9b25SBarry Smith PetscOptionsHasName(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsLogical(), 13030de9b25SBarry Smith PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHead(), 13130de9b25SBarry Smith PetscOptionsStringArray(),PetscOptionsRealArray(), PetscOptionsScalar(), 13230de9b25SBarry Smith PetscOptionsLogicalGroupBegin(), PetscOptionsLogicalGroup(), PetscOptionsLogicalGroupEnd(), 13330de9b25SBarry Smith PetscOptionsList(), PetscOptionsEList() 13430de9b25SBarry Smith M*/ 135b0a32e0cSBarry Smith #define PetscOptionsTail() 0; {if (PetscOptionsPublishCount != 1) PetscFunctionReturn(0);} 136186905e3SBarry Smith 137ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsInt(const char[],const char[],const char[],PetscInt,PetscInt*,PetscTruth*); 138ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsReal(const char[],const char[],const char[],PetscReal,PetscReal*,PetscTruth*); 139ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsScalar(const char[],const char[],const char[],PetscScalar,PetscScalar*,PetscTruth*); 140ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsName(const char[],const char[],const char[],PetscTruth*); 141ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsString(const char[],const char[],const char[],const char[],char*,size_t,PetscTruth*); 142ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsLogical(const char[],const char[],const char[],PetscTruth,PetscTruth*,PetscTruth*); 143ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsLogicalGroupBegin(const char[],const char[],const char[],PetscTruth*); 144ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsLogicalGroup(const char[],const char[],const char[],PetscTruth*); 145ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsLogicalGroupEnd(const char[],const char[],const char[],PetscTruth*); 146ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsList(const char[],const char[],const char[],PetscFList,const char[],char[],PetscInt,PetscTruth*); 147ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsEList(const char[],const char[],const char[],const char*[],PetscInt,const char[],PetscInt*,PetscTruth*); 148ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsRealArray(const char[],const char[],const char[],PetscReal[],PetscInt*,PetscTruth*); 149ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsIntArray(const char[],const char[],const char[],PetscInt[],PetscInt*,PetscTruth*); 150ff73aad6SKris Buschelman EXTERN PetscErrorCode PETSC_DLLEXPORT PetscOptionsStringArray(const char[],const char[],const char[],char*[],PetscInt*,PetscTruth*); 151e9fa29b7SSatish Balay 152e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 1533a3b2205SBarry Smith #endif 154