Extension of finite-element method to unbounded field problems