Molecular mechanics in crystalline media