Actual source code: ex49.c
2: static char help[] = "Demonstrates PetscDataTypeFromString().\n\n";
4: #include <petscsys.h>
5: int main(int argc,char **argv)
6: {
7: PetscDataType dtype;
8: PetscBool found;
10: /*
11: Every PETSc routine should begin with the PetscInitialize() routine.
12: argc, argv - These command line arguments are taken to extract the options
13: supplied to PETSc and options supplied to MPI.
14: help - When PETSc executable is invoked with the option -help,
15: it prints the various options that can be applied at
16: runtime. The user can use the "help" variable place
17: additional help messages in this printout.
18: */
19: PetscInitialize(&argc,&argv,(char*)0,help);
21: PetscDataTypeFromString("Scalar",&dtype,&found);
25: PetscDataTypeFromString("INT",&dtype,&found);
29: PetscDataTypeFromString("real",&dtype,&found);
33: PetscDataTypeFromString("abogusdatatype",&dtype,&found);
36: PetscFinalize();
37: return 0;
38: }
40: /*TEST
42: test:
44: TEST*/