Development of a methodology to define fragility functions based on macroseismic intensity