In situ polymerization in 3D porous materials