Simulations of flow-induced director structures in nematic liquid crystals through Leslie-Ericksen equations. I. Computational methodology in two dimensions