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. 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/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. ** 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 diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index 4871fe0c40..8b47eff624 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -20,12 +20,12 @@ 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. + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "atom_vec_spin.h" #include "comm.h" @@ -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 54818a9b70..b67f62d53d 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -18,11 +18,11 @@ 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. + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #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 97b33197ce..cb34465482 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -18,13 +18,13 @@ 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. + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ #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 d91636af58..b75f03212a 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -18,12 +18,12 @@ 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. + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "atom_vec.h" @@ -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..b908478952 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -18,13 +18,13 @@ 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. + 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 acb7ffe548..398206b26e 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -18,12 +18,12 @@ 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. + 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 07ae684939..b792969c5d 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -18,12 +18,12 @@ 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. + 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 7b05d7337e..1b7b36b6db 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -18,12 +18,12 @@ 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. + 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 e9e7c1fb3f..315b691d17 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -18,12 +18,12 @@ 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. + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "comm.h" @@ -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..0daafad756 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -18,12 +18,12 @@ 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. + and molecular dynamics. Journal of Computational Physics. ------------------------------------------------------------------------- */ -#include -#include -#include +#include +#include +#include #include "atom.h" #include "comm.h" 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;