Finite element model of ionic nanowires with size-dependent mechanical properties determined by ab initio calculations