Gravar-mail: Understanding nanostructure formation from first principles