Electron transport in quantum devices is governed by discrete quantum states due to electron confinement. A crucial requirement for the modeling of quantum devices is the the numerical identification and resolution of these quantum states. We present an algorithm utilized in our general purpose quantum device simulator (NEMO), where we locate the resonances of the system first and then generate the optimized grid used to integrate over the resonances. We find this algorithm important in the modeling of coherent transport involving ultrafine resonances and crucial for the modeling of incoherent transport.