[petsc-dev] PetscOptionsGetString
Satish Balay
balay at mcs.anl.gov
Fri Apr 15 18:58:16 CDT 2011
Ah - missed the 'one char' part..
I guess you'll have to do:
char Mode [2];
PetscOptionsGetString(PETSC_NULL,"-Mode",Mode,2,&flag);
(and use Mode[0])
Satish
On Fri, 15 Apr 2011, Satish Balay wrote:
> Hm - if you have:
>
> char Mode [64];
>
> you should be using:
>
> PetscOptionsGetString(PETSC_NULL,"-Mode",&Mode,64,&flag);
>
> You can check an example - say src/ksp/ksp/examples/tutorials/ex10.c
>
> Satish
>
>
> On Fri, 15 Apr 2011, Shiyuan wrote:
>
> > Hi,
> > In the version of 3.1-p5, PetscOptionsGetString() can be used to get a char
> > input. It seems that it doesn't work any more in development version.
> > PetscOptionsGetString(PETSC_NULL,"-Mode",&Mode,1,&flag);
> > This gives me a \0. How can I get the input of only one character in dev?
> > Thanks.
> >
>
>
More information about the petsc-dev
mailing list