Efficient finite element modeling across optical length scales