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