New quantized failure criteria: application to nanotubes and nanowires