Hi all,
please find the attached code to add external magnetic field develpoed by Timothy Sirk based on Spreiter alorithm. From the dissussion adding external field Magnetic field, I understand why the lammps does not have such function in the official distribution. This code is only tested with old version, I think other researchers will benifit it as well if the developers can port it to new version of lammps (if there is no plan to have it the official distribution) since there is similar request from the forum.
fix_bfield.cpp (16.5 KB)
fix_bfield.h (1.8 KB)