Computer modeling of nucleation, growth, and templating in hydrothermal synthesis