A robust and general Schrödinger and Dirac solver for  atomic structure calculations