From ad4f61a5ce6abdf69c5cff22dec3d563ead95c35 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 10 Jul 2018 09:07:54 -0400 Subject: [PATCH 1/7] update fatbin makefile for libgpu.a to latest additions --- lib/gpu/Nvidia.makefile_multi | 46 +++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/lib/gpu/Nvidia.makefile_multi b/lib/gpu/Nvidia.makefile_multi index 5fb35cce3c..94cfd4af6b 100644 --- a/lib/gpu/Nvidia.makefile_multi +++ b/lib/gpu/Nvidia.makefile_multi @@ -79,7 +79,10 @@ OBJS = $(OBJ_DIR)/lal_atom.o $(OBJ_DIR)/lal_ans.o \ $(OBJ_DIR)/lal_lj_cubic.o $(OBJ_DIR)/lal_lj_cubic_ext.o \ $(OBJ_DIR)/lal_ufm.o $(OBJ_DIR)/lal_ufm_ext.o \ $(OBJ_DIR)/lal_dipole_long_lj.o $(OBJ_DIR)/lal_dipole_long_lj_ext.o \ - $(OBJ_DIR)/lal_lj_expand_coul_long.o $(OBJ_DIR)/lal_lj_expand_coul_long_ext.o + $(OBJ_DIR)/lal_lj_expand_coul_long.o $(OBJ_DIR)/lal_lj_expand_coul_long_ext.o \ + $(OBJ_DIR)/lal_coul_long_cs.o $(OBJ_DIR)/lal_coul_long_cs_ext.o \ + $(OBJ_DIR)/lal_born_coul_long_cs.o $(OBJ_DIR)/lal_born_coul_long_cs_ext.o \ + $(OBJ_DIR)/lal_born_coul_wolf_cs.o $(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \ $(OBJ_DIR)/atom.cubin $(OBJ_DIR)/atom_cubin.h \ @@ -137,7 +140,10 @@ CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \ $(OBJ_DIR)/lj_cubic.cubin $(OBJ_DIR)/lj_cubic_cubin.h \ $(OBJ_DIR)/ufm.cubin $(OBJ_DIR)/ufm_cubin.h \ $(OBJ_DIR)/dipole_long_lj.cubin $(OBJ_DIR)/dipole_long_lj_cubin.h \ - $(OBJ_DIR)/lj_expand_coul_long.cubin $(OBJ_DIR)/lj_expand_coul_long_cubin.h + $(OBJ_DIR)/lj_expand_coul_long.cubin $(OBJ_DIR)/lj_expand_coul_long_cubin.h \ + $(OBJ_DIR)/coul_long_cs.cubin $(OBJ_DIR)/coul_long_cs_cubin.h \ + $(OBJ_DIR)/born_coul_long_cs.cubin $(OBJ_DIR)/born_coul_long_cs_cubin.h \ + $(OBJ_DIR)/born_coul_wolf_cs.cubin $(OBJ_DIR)/born_coul_wolf_cs_cubin.h all: $(OBJ_DIR) $(GPU_LIB) $(EXECS) @@ -837,6 +843,42 @@ $(OBJ_DIR)/lal_lj_expand_coul_long.o: $(ALL_H) lal_lj_expand_coul_long.h lal_lj_ $(OBJ_DIR)/lal_lj_expand_coul_long_ext.o: $(ALL_H) lal_lj_expand_coul_long.h lal_lj_expand_coul_long_ext.cpp lal_base_charge.h $(CUDR) -o $@ -c lal_lj_expand_coul_long_ext.cpp -I$(OBJ_DIR) +$(OBJ_DIR)/coul_long_cs.cubin: lal_coul_long_cs.cu lal_precision.h lal_preprocessor.h + $(CUDA) --fatbin -DNV_KERNEL -o $@ lal_coul_long_cs.cu + +$(OBJ_DIR)/coul_long_cs_cubin.h: $(OBJ_DIR)/coul_long_cs.cubin $(OBJ_DIR)/coul_long_cs.cubin + $(BIN2C) -c -n coul_long_cs $(OBJ_DIR)/coul_long_cs.cubin > $(OBJ_DIR)/coul_long_cs_cubin.h + +$(OBJ_DIR)/lal_coul_long_cs.o: $(ALL_H) lal_coul_long_cs.h lal_coul_long_cs.cpp $(OBJ_DIR)/coul_long_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_coul_long.o + $(CUDR) -o $@ -c lal_coul_long_cs.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_coul_long_cs_ext.o: $(ALL_H) lal_coul_long_cs.h lal_coul_long_cs_ext.cpp lal_coul_long.h + $(CUDR) -o $@ -c lal_coul_long_cs_ext.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/born_coul_long_cs.cubin: lal_born_coul_long_cs.cu lal_precision.h lal_preprocessor.h + $(CUDA) --fatbin -DNV_KERNEL -o $@ lal_born_coul_long_cs.cu + +$(OBJ_DIR)/born_coul_long_cs_cubin.h: $(OBJ_DIR)/born_coul_long_cs.cubin $(OBJ_DIR)/born_coul_long_cs.cubin + $(BIN2C) -c -n born_coul_long_cs $(OBJ_DIR)/born_coul_long_cs.cubin > $(OBJ_DIR)/born_coul_long_cs_cubin.h + +$(OBJ_DIR)/lal_born_coul_long_cs.o: $(ALL_H) lal_born_coul_long_cs.h lal_born_coul_long_cs.cpp $(OBJ_DIR)/born_coul_long_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_born_coul_long.o + $(CUDR) -o $@ -c lal_born_coul_long_cs.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_born_coul_long_cs_ext.o: $(ALL_H) lal_born_coul_long_cs.h lal_born_coul_long_cs_ext.cpp lal_born_coul_long.h + $(CUDR) -o $@ -c lal_born_coul_long_cs_ext.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/born_coul_wolf_cs.cubin: lal_born_coul_wolf_cs.cu lal_precision.h lal_preprocessor.h + $(CUDA) --fatbin -DNV_KERNEL -o $@ lal_born_coul_wolf_cs.cu + +$(OBJ_DIR)/born_coul_wolf_cs_cubin.h: $(OBJ_DIR)/born_coul_wolf_cs.cubin $(OBJ_DIR)/born_coul_wolf_cs.cubin + $(BIN2C) -c -n born_coul_wolf_cs $(OBJ_DIR)/born_coul_wolf_cs.cubin > $(OBJ_DIR)/born_coul_wolf_cs_cubin.h + +$(OBJ_DIR)/lal_born_coul_wolf_cs.o: $(ALL_H) lal_born_coul_wolf_cs.h lal_born_coul_wolf_cs.cpp $(OBJ_DIR)/born_coul_wolf_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_born_coul_wolf.o + $(CUDR) -o $@ -c lal_born_coul_wolf_cs.cpp -I$(OBJ_DIR) + +$(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o: $(ALL_H) lal_born_coul_wolf_cs.h lal_born_coul_wolf_cs_ext.cpp lal_born_coul_wolf.h + $(CUDR) -o $@ -c lal_born_coul_wolf_cs_ext.cpp -I$(OBJ_DIR) + $(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H) $(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda From 199c96f985bae537e7b43dc49b7a41570cf8b905 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 10 Jul 2018 09:22:41 -0400 Subject: [PATCH 2/7] update and clarify the choice of atom ids for angle style dipole (which is not really an angle potential) --- doc/src/angle_dipole.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/src/angle_dipole.txt b/doc/src/angle_dipole.txt index d91f260d51..34cc8c153c 100644 --- a/doc/src/angle_dipole.txt +++ b/doc/src/angle_dipole.txt @@ -96,16 +96,17 @@ USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_2_3 section for more info on packages. NOTE: In the "Angles" section of the data file, the atom ID 'j' -corresponding to the dipole to restrain must come before the atom ID -of the reference atom 'i'. A third atom ID 'k' must also be provided, -although 'k' is just a 'dummy' atom which can be any atom; it may be -useful to choose a convention (e.g., 'k'='i') and adhere to it. For -example, if ID=1 for the dipolar atom to restrain, and ID=2 for the -reference atom, the corresponding line in the "Angles" section of the -data file would read: X X 1 2 2 +defining the direction of the dipole vector to restrain must come +before the atom ID of the reference atom 'i'. A third atom ID 'k' must +also be provided to comply with the requirement of a valid angle +definition. This atom ID k should be chosen to be that of an atom +bonded to atom 'i' to avoid errors with "lost angle atoms" when running +in parallel. Since the LAMMPS code checks for valid angle definitions, +cannot use the same atom ID of either 'i' or 'j' (this was allowed +and recommended with older LAMMPS versions). The "newton" command for intramolecular interactions must be "on" -(which is the default). +(which is the default except when using some accelerator packages). This angle style should not be used with SHAKE. From 9d5dc561ca45967c445f472bca92e253bca3d33d Mon Sep 17 00:00:00 2001 From: julient31 Date: Mon, 9 Jul 2018 10:24:55 -0600 Subject: [PATCH 3/7] Commit1 JT 070918 - created README in examples/SPIN - modified doc/src/set.txt to define 'spin' and 'spin/random' keywords --- doc/src/set.txt | 17 +++++++++++++++++ examples/SPIN/README | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 examples/SPIN/README diff --git a/doc/src/set.txt b/doc/src/set.txt index 4757d1c575..d05660dc42 100644 --- a/doc/src/set.txt +++ b/doc/src/set.txt @@ -17,6 +17,7 @@ ID = atom ID range or type range or mol ID range or group ID or region ID :l one or more keyword/value pairs may be appended :l keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \ {charge} or {dipole} or {dipole/random} or {quat} or \ + {spin} or {spin/random} or {quat} or \ {quat/random} or {diameter} or {shape} or \ {length} or {tri} or {theta} or {theta/random} or \ {angmom} or {omega} or \ @@ -43,6 +44,13 @@ keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \ {dipole/random} value = seed Dlen seed = random # seed (positive integer) for dipole moment orientations Dlen = magnitude of dipole moment (dipole units) + {spin} values = g x y z + g = magnitude of magnetic spin vector (in Bohr magneton's unit) + x,y,z = orientation of magnetic spin vector + any of x,y,z can be an atom-style variable (see below) + {spin/random} value = seed Dlen + seed = random # seed (positive integer) for magnetic spin orientations + Dlen = magnitude of magnetic spin vector (in Bohr magneton's unit) {quat} values = a b c theta a,b,c = unit vector to rotate particle around via right-hand rule theta = rotation angle (degrees) @@ -232,6 +240,15 @@ the orientation of a particular atom is the same, regardless of how many processors are being used. This keyword does not allow use of an atom-style variable. +Keyword {spin} uses the specified g value to set the magnitude of the +magnetic spin vectors, and the x,y,z values as components of a vector +to set as the orientation of the magnetic spin vectors of the selected +atoms. + +Keyword {spin/random} randomizes the orientation of the magnetic spin +vectors for the selected atoms and sets the magnitude of each to the +specified {Dlen} value. + Keyword {quat} uses the specified values to create a quaternion (4-vector) that represents the orientation of the selected atoms. The particles must define a quaternion for their orientation diff --git a/examples/SPIN/README b/examples/SPIN/README new file mode 100644 index 0000000000..5ad252e7f2 --- /dev/null +++ b/examples/SPIN/README @@ -0,0 +1,20 @@ +This directory contains examples and applications of the SPIN package +===================================================================== + +- the iron, cobalt_hcp, cobalt_fcc and nickel directories provide +examples of spin-lattice calculations. + +- the bfo repository provides an example of spin dynamics calculation +performed on a fixed lattice, and applied to the multiferroic +material bismuth-oxide. + +- the read_restart directory provides examples allowing to write or +read data files, and restart magneto-mechanical simulations. + +- vizualization of the dump files can be achieved using Ovito or +VMD. See the vmd repository for help vizualizing results with VMD. + +** Note, the aim of this repository is mainly to provide users with +examples. Better values and tuning of the magnetic and mechanical +interactions can be achieved for more accurate materials +simulations. ** From ade9b7bfc39ede248fc1d81b7ab93a7019e10daf Mon Sep 17 00:00:00 2001 From: julient31 Date: Mon, 9 Jul 2018 18:07:10 -0600 Subject: [PATCH 4/7] Commit2 JT 070918 - modified the citeme reference (replaced by the JCP one) - same modification in doc and src/SPIN --- doc/src/fix_langevin_spin.txt | 4 ++-- doc/src/fix_nve_spin.txt | 2 +- doc/src/pair_spin_dmi.txt | 2 +- doc/src/pair_spin_exchange.txt | 2 +- doc/src/pair_spin_magelec.txt | 2 +- doc/src/pair_spin_neel.txt | 2 +- src/SPIN/atom_vec_spin.cpp | 6 +++--- src/SPIN/compute_spin.cpp | 6 +++--- src/SPIN/fix_langevin_spin.cpp | 6 +++--- src/SPIN/fix_nve_spin.cpp | 11 ++++++----- src/SPIN/fix_precession_spin.cpp | 6 +++--- src/SPIN/pair_spin.cpp | 6 +++--- src/SPIN/pair_spin_dmi.cpp | 6 +++--- src/SPIN/pair_spin_exchange.cpp | 6 +++--- src/SPIN/pair_spin_magelec.cpp | 12 ++++++------ src/SPIN/pair_spin_neel.cpp | 6 +++--- 16 files changed, 43 insertions(+), 42 deletions(-) diff --git a/doc/src/fix_langevin_spin.txt b/doc/src/fix_langevin_spin.txt index 51f085ebdc..b089cd7f58 100644 --- a/doc/src/fix_langevin_spin.txt +++ b/doc/src/fix_langevin_spin.txt @@ -98,5 +98,5 @@ integration fix (e.g. {fix nve/spin}). [(Mayergoyz)] I.D. Mayergoyz, G. Bertotti, C. Serpico (2009). Elsevier (2009) :link(Tranchida2) -[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson, -arXiv preprint arXiv:1801.10233, (2018). +[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson, +Journal of Computational Physics, (2018). diff --git a/doc/src/fix_nve_spin.txt b/doc/src/fix_nve_spin.txt index 6ccebcebf6..f4b38c270b 100644 --- a/doc/src/fix_nve_spin.txt +++ b/doc/src/fix_nve_spin.txt @@ -73,4 +73,4 @@ instead of "array" is also valid. :link(Tranchida1) [(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson, -arXiv preprint arXiv:1801.10233, (2018). +Journal of Computational Physics, (2018). diff --git a/doc/src/pair_spin_dmi.txt b/doc/src/pair_spin_dmi.txt index 9fe53df18a..24877906f3 100644 --- a/doc/src/pair_spin_dmi.txt +++ b/doc/src/pair_spin_dmi.txt @@ -63,4 +63,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info. :link(Tranchida5) [(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson, -arXiv preprint arXiv:1801.10233, (2018). +Journal of Computational Physics, (2018). diff --git a/doc/src/pair_spin_exchange.txt b/doc/src/pair_spin_exchange.txt index 97b6d0b34f..ad3357cb5e 100644 --- a/doc/src/pair_spin_exchange.txt +++ b/doc/src/pair_spin_exchange.txt @@ -79,4 +79,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info. :link(Tranchida3) [(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson, -arXiv preprint arXiv:1801.10233, (2018). +Journal of Computational Physics, (2018). diff --git a/doc/src/pair_spin_magelec.txt b/doc/src/pair_spin_magelec.txt index 0185a5abb2..8ba24c46af 100644 --- a/doc/src/pair_spin_magelec.txt +++ b/doc/src/pair_spin_magelec.txt @@ -70,4 +70,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info. :link(Tranchida4) [(Tranchida)] Tranchida, Plimpton, Thibaudeau, and Thompson, -arXiv preprint arXiv:1801.10233, (2018). +Journal of Computational Physics, (2018). diff --git a/doc/src/pair_spin_neel.txt b/doc/src/pair_spin_neel.txt index f7c9608a93..8551f8d636 100644 --- a/doc/src/pair_spin_neel.txt +++ b/doc/src/pair_spin_neel.txt @@ -78,4 +78,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info. :link(Tranchida6) [(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson, -arXiv preprint arXiv:1801.10233, (2018). +Journal of Computational Physics, (2018). diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index 4871fe0c40..51903e5480 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -18,9 +18,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index 54818a9b70..1d87f4e722 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 97b33197ce..402b934723 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index d91636af58..353f2cbd83 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include @@ -59,8 +59,9 @@ static const char cite_fix_nve_spin[] = "title={Massively parallel symplectic algorithm for coupled magnetic spin " "dynamics and molecular dynamics},\n" "author={Tranchida, J and Plimpton, SJ and Thibaudeau, P and Thompson, AP},\n" - "journal={arXiv preprint arXiv:1801.10233},\n" - "year={2018}\n" + "journal={Journal of Computational Physics},\n" + "year={2018},\n" + "publisher={Elsevier}\n" "}\n\n"; enum{NONE}; diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index eedf0becb7..447139e0ee 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index acb7ffe548..d29f31b70a 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index 07ae684939..0129dec005 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index 7b05d7337e..5aa5a267b9 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index e9e7c1fb3f..79cdc919e8 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include @@ -436,9 +436,9 @@ void PairSpinMagelec::compute_magelec_mech(int i, int j, double fi[3], double sp meiy *= ME_mech[itype][jtype]; meiz *= ME_mech[itype][jtype]; - fi[0] = meiy*vz - meiz*vy; - fi[1] = meiz*vx - meix*vz; - fi[2] = meix*vy - meiy*vx; + fi[0] += meiy*vz - meiz*vy; + fi[1] += meiz*vx - meix*vz; + fi[2] += meix*vy - meiy*vx; } diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index d74db638bd..a8d9fe8ffa 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -16,9 +16,9 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics - and molecular dynamics. arXiv preprint arXiv:1801.10233. + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #include From 792b182cb041dce9c72a7c46ccb473c0c0165a72 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 10 Jul 2018 09:46:08 -0400 Subject: [PATCH 5/7] whitespace cleanup --- src/SPIN/atom_vec_spin.cpp | 6 +++--- src/SPIN/compute_spin.cpp | 4 ++-- src/SPIN/fix_langevin_spin.cpp | 4 ++-- src/SPIN/fix_nve_spin.cpp | 4 ++-- src/SPIN/fix_precession_spin.cpp | 4 ++-- src/SPIN/pair_spin.cpp | 4 ++-- src/SPIN/pair_spin_dmi.cpp | 4 ++-- src/SPIN/pair_spin_exchange.cpp | 4 ++-- src/SPIN/pair_spin_magelec.cpp | 4 ++-- src/SPIN/pair_spin_neel.cpp | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index 51903e5480..276bc34e64 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -18,8 +18,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ AtomVecSpin::AtomVecSpin(LAMMPS *lmp) : AtomVec(lmp) size_data_atom = 9; size_data_vel = 4; xcol_data = 4; - + atom->sp_flag = 1; } diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index 1d87f4e722..b508d0624f 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 402b934723..3650651457 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 353f2cbd83..415c2352d4 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index 447139e0ee..bcdd62413d 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index d29f31b70a..b6cf07e60c 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index 0129dec005..4ea6cfd0cc 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index 5aa5a267b9..cb2d7424cf 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 79cdc919e8..77bf42159a 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index a8d9fe8ffa..05999170eb 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -16,8 +16,8 @@ Aidan Thompson (SNL) Please cite the related publication: - Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). - Massively parallel symplectic algorithm for coupled magnetic spin dynamics + Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018). + Massively parallel symplectic algorithm for coupled magnetic spin dynamics and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ From 1ed25d195be0d32caa75f99172dcda48afab95ed Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 10 Jul 2018 09:48:49 -0400 Subject: [PATCH 6/7] convert c-style includes for c-library calls to c++-style --- src/SPIN/atom_vec_spin.cpp | 6 +++--- src/SPIN/compute_spin.cpp | 2 +- src/SPIN/fix_langevin_spin.cpp | 6 +++--- src/SPIN/fix_nve_spin.cpp | 6 +++--- src/SPIN/fix_precession_spin.cpp | 8 ++++---- src/SPIN/pair_spin.cpp | 6 +++--- src/SPIN/pair_spin_dmi.cpp | 6 +++--- src/SPIN/pair_spin_exchange.cpp | 6 +++--- src/SPIN/pair_spin_magelec.cpp | 6 +++--- src/SPIN/pair_spin_neel.cpp | 6 +++--- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index 276bc34e64..8b47eff624 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -23,9 +23,9 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "atom_vec_spin.h" #include "comm.h" diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index b508d0624f..b67f62d53d 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -22,7 +22,7 @@ ------------------------------------------------------------------------- */ #include -#include +#include #include "atom.h" #include "compute_spin.h" #include "domain.h" diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 3650651457..cb34465482 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -22,9 +22,9 @@ ------------------------------------------------------------------------- */ #include -#include -#include -#include +#include +#include +#include #include "atom.h" #include "atom_vec_ellipsoid.h" diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 415c2352d4..b75f03212a 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -21,9 +21,9 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "atom_vec.h" diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index bcdd62413d..b908478952 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -21,10 +21,10 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include -#include +#include +#include +#include +#include #include "atom.h" #include "domain.h" diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index b6cf07e60c..398206b26e 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -21,9 +21,9 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "comm.h" diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index 4ea6cfd0cc..b792969c5d 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -21,9 +21,9 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "comm.h" diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index cb2d7424cf..1b7b36b6db 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -21,9 +21,9 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "comm.h" diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 77bf42159a..315b691d17 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -21,9 +21,9 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "comm.h" diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 05999170eb..0daafad756 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -21,9 +21,9 @@ and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "comm.h" From 1f1447c3ac3f919d6c4c34d03e2a0df99b39fdad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 11 Jul 2018 07:22:47 -0400 Subject: [PATCH 7/7] need to update exclusions with the new atom IDs in case of molecular systems --- src/reset_ids.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/reset_ids.cpp b/src/reset_ids.cpp index 8a33cd535b..fd898bd3ab 100644 --- a/src/reset_ids.cpp +++ b/src/reset_ids.cpp @@ -16,6 +16,7 @@ #include "atom_vec.h" #include "domain.h" #include "comm.h" +#include "special.h" #include "memory.h" #include "error.h" @@ -44,7 +45,7 @@ void ResetIDs::command(int narg, char **arg) } // create an atom map if one doesn't exist already - + int mapflag = 0; if (atom->map_style == 0) { mapflag = 1; @@ -93,7 +94,7 @@ void ResetIDs::command(int narg, char **arg) // forward_comm_array acquires new IDs for ghost atoms double **newIDs; - memory->create(newIDs,nall,1,"reset_ids:newIDs"); + memory->create(newIDs,nall,1,"reset_ids:newIDs"); for (int i = 0; i < nlocal; i++) { newIDs[i][0] = tag[i]; @@ -105,7 +106,7 @@ void ResetIDs::command(int narg, char **arg) // loop over bonds, angles, etc and reset IDs in stored topology arrays // only necessary for molecular = 1, not molecular = 2 // badcount = atom IDs that could not be found - + int badcount = 0; if (atom->molecular == 1) { @@ -232,8 +233,15 @@ void ResetIDs::command(int narg, char **arg) atom->map_init(); atom->map_set(); + // need to update exclusions with new atom IDs + + if (atom->molecular == 1) { + Special special(lmp); + special.build(); + } + // delete temporary atom map - + if (mapflag) { atom->map_delete(); atom->map_style = 0;