Confined polymerization in porous materials