Layerwise Analyses of Compact and Thin-Walled Beams Made of Viscoelastic Materials