Micromechanical models for porous and cellular materials in linear elasticity and viscoelasticity