Three-dimensional structures of magnesium nanopores