# PetscDataTypeFromString
Gets the enum value of a PETSc datatype represented as a string 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscDataTypeFromString(const char *name, PetscDataType *ptype, PetscBool *found)
```
Not collective


## Input Parameter

- ***name -*** the PETSc datatype name (for example, "double" or "real")



## Output Parameters

- ***ptype -*** the enum value, only valid if found is `PETSC_TRUE`
- ***found -*** the string matches one of the data types





## See Also
 `PetscDataType`, `PetscDataTypeToMPIDataType()`, `PetscDataTypeGetSize()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/ptype.c.html#PetscDataTypeFromString">src/sys/objects/ptype.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/ptype.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
