Direct and Inverse Design of Near-field Nanostructure