Isogeometric analysis of phase-field models for dynamic brittle and ductile fracture