A mathematical analogy and a unified asymptotic formulation for singular elastic and electromagnetic fields at multimaterial wedges