Finite element modelling of static and stationary electric and magnetic fields