Constructing continuum models of ionic nanowires from quantum mechanics computations