Mesoscopic modeling of acoustic emission through an energetic approach.