A novel computational method to identify/analyze hysteresis loops of hard magnetic materials