Modelling the vibrations of multi-span beams and plates through adaptive global piecewise-smooth functions (A-GPSFS)