New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spin origin #935

merged 105 commits into from Jun 27, 2018


None yet
5 participants

julient31 commented May 30, 2018


Pull request of the implementation of the SPIN package. Enabling the simulation of coupled spin dynamics and molecular dynamics.


Julien Tranchida (Sandia), Aidan P. Thompson (Sandia)

Backward Compatibility

Implementation Notes

  • the changes were mainly implemented within the src/SPIN repository
  • the implementation was checked by series of Valgrind tests (running on all the examples)
  • different compilation options were tested (-DLAMMPS_SMALLSMALL and -DLAMMPS_BIGBIG, -O -Wall -Wextra)
  • the implementation was compiled with different compilers (gcc, intel C++ and Clang++)

Further Information, Files, and Links

Details of the implementations are provided within the following article:

julient31 and others added some commits May 12, 2017

First commit for the SPIN package.
Changes to come:
-Exchange interaction computation to check (loop on neighbors),
-Temperature/random fluctuations to correct (effects too strong),
-Physical results to check,
-Add final interactions (DMI, ME, Dipolar),
-Compute spin temperature (Nurdin and Ma formslisms),
-Work on MPI parallelization,
-Ewald sums to implement (see with Stan's pakage),
-See for prefered magnetic axis (Mitchell's idea),
For paramagnetic simulation (no pair interaction declared), the "atom…
…_modify" command has to be used (in order to initialize the bin).

example: atom_modify sort 1000 4.0 (Freq. of sorting, Cutoff distance)

In order to print the actual time with the total mag., the vector associated to the mag. compute was modified. It is now: [time, Mx, My, Mz, |M|, En_mag]

Optimization of the spin_compute routine: energy and mag. have been gathered in a same loop.
- For Paramag. simulations, the option "atom_modify" has to be set
ex: atom_modify sort 1000 4.0 (Freq,Dist).
- Actual time is now printed (c_mag[0] in compute_spin)
- Value of Gilbert's damping corrected
- Now even results for SD/Lammps comp. in purely paramg. or aniso. situations
- Pack and unpack reverse needed corrections (f only was set, not fm)
- Spin temperature is now computed (data c_mag[7] in spin_compute)

To do:
- Fcc with p p p bc is still not working
- If Zeeman/Aniso force not defined, error => to be removed
- Add DMI and ME (see if new file or add in the exchange file)
Field compute error apparently corrected. The issue was related to th…
…e reverse communication.

To do:
- Remove all checks/prints used to debug
- Check all the flag set in the atom_vec_spin creator (very important for the reverse comm)
- Code DMI/ME interactions
- Start to work on parallel implementation of the integration
Changes: - DMI and ME interactions
         - Computation optimisations
         - lot of removed prints

Next work: - Sequential algo implemetation
           - temperature simulations (check)
           - Work on parallelization
Implemetation of SeqNei Algo 1
Still Seq and SeqNei versions
Loop on Neigh in SeqNei not working yet
Implementation of SeqNei V1 (Real)
Still both Seq and SeqNei versions
In SeqNei, loop on Neighb not working yet
First version of the parallel algorithm
Performed by sectoring (1, 2, 4, or 8 chuncks) each process.
First version of the spin tutorial (2)
Examples (example/SPIN), for BFO and Co
Changes for coupling magnetomech:
- hybrid_overlay friend with fix_nve_spin
- modif of the allocation of pair classes in fix_nve_spin
- modif input file for hybrid/overlay eam - spin/pair
- new file for cobalt eam potentials
Commit Julien 2 08/23/17
- reorganized includes
- start work on magneto-mechanic potential (adding function)
- renamed fix_nve_spin into fix_integration_spin
Commit Julien 08/24/17
- in pair_spin, magneto-mech force for exchange
- compute and added in integration_spin
Commit Julien 09/06/17
- units of J1_mag and J1_mech
- correct of pack and unpack in atom_vec_spin
- add conditions in fix_integration_spin
Commit Julien 09/14/17
- Changes and corrections in the computation of the energy
- Issue with newton_pair in the compute of pair
Commit Julien 10/19/2017
- New files for the pair interactions
- New files for the documentation
- Spin orbit coupling via Neel approach
Commit Julien 10/24/17
Correction in the pair/exchange for energy preservation

@akohlmey akohlmey added the needs_work label Jun 18, 2018

@julient31 julient31 requested a review from rbberger as a code owner Jun 18, 2018


This comment has been minimized.


akohlmey commented Jun 18, 2018

@julient31 am working through a bunch of issues most likely related to your rebasing onto a newer LAMMPS master. in the process the file `doc/src/tutorial_spin.txt seems to have gotten lost. i'll remove the reference to it now. you can add it in a future pull request after this one is merged properly into master.

@julient31 julient31 requested a review from junghans as a code owner Jun 27, 2018

@akohlmey akohlmey assigned sjplimp and unassigned akohlmey Jun 27, 2018

@akohlmey akohlmey removed the needs_work label Jun 27, 2018

@sjplimp sjplimp merged commit 6bd5a3d into lammps:master Jun 27, 2018

5 checks passed

lammps/pull-requests/build-docs-pr head run ended
lammps/pull-requests/kokkos_omp head run ended
lammps/pull-requests/openmpi-pr head run ended
lammps/pull-requests/serial-pr head run ended
lammps/pull-requests/shlib-pr head run ended
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment