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:   */
 20:   PetscInitialize(&argc, &argv, (char *)0, help);

 22:   PetscDataTypeFromString("Scalar", &dtype, &found);

 26:   PetscDataTypeFromString("INT", &dtype, &found);

 30:   PetscDataTypeFromString("real", &dtype, &found);

 34:   PetscDataTypeFromString("abogusdatatype", &dtype, &found);

 37:   PetscFinalize();
 38:   return 0;
 39: }

 41: /*TEST

 43:    test:

 45: TEST*/