def METHOD_NAME(self, ttype):
    """
    Set the type of p grid generator.
    """
    if ttype == TYPE_UNIFORM or ttype == TYPE_BIUNIFORM:
        self.type = ttype
    else:
        raise DREAMException("PGrid {}: Unrecognized grid type specified: {}.".format(self.name, self.type))