User defined magnetic field