The Second Generation Shifted Boundary Method with Applications to Porous Media Flow and Solid Mechanics