new neigh_modify exclude option, other SNAP changes

This commit is contained in:
Steve Plimpton
2017-03-07 09:31:12 -07:00
parent 49e83b4348
commit efaa4c6710
32 changed files with 108 additions and 44 deletions

View File

@ -217,6 +217,10 @@ This compute is part of the VORONOI package. It is only enabled if
LAMMPS was built with that package. See the "Making LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info. LAMMPS"_Section_start.html#start_3 section for more info.
It also requiers you have a copy of the Voro++ library built and
installed on your system. See instructions on obtaining and
installing the Voro++ software in the src/VORONOI/README file.
[Related commands:] [Related commands:]
"dump custom"_dump.html, "dump local"_dump.html "dump custom"_dump.html, "dump local"_dump.html

View File

@ -34,8 +34,10 @@ keyword = {delay} or {every} or {check} or {once} or {cluster} or {include} or {
M,N = exclude if one atom in pair is type M, other is type N M,N = exclude if one atom in pair is type M, other is type N
group group1-ID group2-ID group group1-ID group2-ID
group1-ID,group2-ID = exclude if one atom is in 1st group, other in 2nd group1-ID,group2-ID = exclude if one atom is in 1st group, other in 2nd
molecule group-ID molecule/intra group-ID
groupname = exclude if both atoms are in the same molecule and in the same group group-ID = exclude if both atoms are in the same molecule and in group
molecule/inter group-ID
group-ID = exclude if both atoms are in different molecules and in group
none none
delete all exclude settings delete all exclude settings
{page} value = N {page} value = N
@ -52,7 +54,7 @@ neigh_modify every 2 delay 10 check yes page 100000
neigh_modify exclude type 2 3 neigh_modify exclude type 2 3
neigh_modify exclude group frozen frozen check no neigh_modify exclude group frozen frozen check no
neigh_modify exclude group residue1 chain3 neigh_modify exclude group residue1 chain3
neigh_modify exclude molecule rigid :pre neigh_modify exclude molecule/intra rigid :pre
[Description:] [Description:]
@ -130,9 +132,11 @@ The {exclude type} option turns off the pairwise interaction if one
atom is of type M and the other of type N. M can equal N. The atom is of type M and the other of type N. M can equal N. The
{exclude group} option turns off the interaction if one atom is in the {exclude group} option turns off the interaction if one atom is in the
first group and the other is the second. Group1-ID can equal first group and the other is the second. Group1-ID can equal
group2-ID. The {exclude molecule} option turns off the interaction if group2-ID. The {exclude molecule/intra} option turns off the
both atoms are in the specified group and in the same molecule, as interaction if both atoms are in the specified group and in the same
determined by their molecule ID. molecule, as determined by their molecule ID. The {exclude
molecule/inter} turns off the interaction between pairs of atoms that
have different molecule IDs and are both in the specified group.
Each of the exclude options can be specified multiple times. The Each of the exclude options can be specified multiple times. The
{exclude type} option is the most efficient option to use; it requires {exclude type} option is the most efficient option to use; it requires
@ -195,8 +199,8 @@ binsize of 1/2 the cutoff.
If the "delay" setting is non-zero, then it must be a multiple of the If the "delay" setting is non-zero, then it must be a multiple of the
"every" setting. "every" setting.
The exclude molecule option can only be used with atom styles that The molecule/intra and molecule/inter exclude options can only be used
define molecule IDs. with atom styles that define molecule IDs.
The value of the {page} setting must be at least 10x larger than the The value of the {page} setting must be at least 10x larger than the
{one} setting. This insures neighbor pages are not mostly empty {one} setting. This insures neighbor pages are not mostly empty

View File

@ -81,7 +81,7 @@ group sds subtract all cions
velocity all create 1. 87287 dist gaussian velocity all create 1. 87287 dist gaussian
neighbor 1.5 multi neighbor 1.5 multi
neigh_modify exclude molecule sds neigh_modify exclude molecule/intra sds
neigh_modify every 5 delay 0 check yes neigh_modify every 5 delay 0 check yes
fix 1 all nve/limit 0.2 fix 1 all nve/limit 0.2

View File

@ -81,7 +81,7 @@ group sds subtract all cions
velocity all create 1. 87287 dist gaussian velocity all create 1. 87287 dist gaussian
neighbor 1.5 multi neighbor 1.5 multi
neigh_modify exclude molecule sds neigh_modify exclude molecule/intra sds
neigh_modify every 5 delay 0 check yes neigh_modify every 5 delay 0 check yes
fix 1 all nve/limit 0.2 fix 1 all nve/limit 0.2

View File

@ -84,7 +84,7 @@ group sds subtract all cions
velocity all create 1. 87287 dist gaussian velocity all create 1. 87287 dist gaussian
neighbor 1.5 multi neighbor 1.5 multi
neigh_modify exclude molecule sds neigh_modify exclude molecule/intra sds
neigh_modify every 5 delay 0 check yes neigh_modify every 5 delay 0 check yes
fix 1 all nve/limit 0.2 fix 1 all nve/limit 0.2

View File

@ -20,7 +20,7 @@ velocity all create 1.4 109345
group rods type 2 group rods type 2
group tethers subtract all rods group tethers subtract all rods
neigh_modify exclude molecule rods delay 0 every 1 neigh_modify exclude molecule/intra rods delay 0 every 1
# Specify the pair potentials # Specify the pair potentials

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# Definition of SNAP+ZBL potential. # Definition of SNAP+ZBL potential.
variable zblcutinner equal 4 variable zblcutinner equal 4

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# LAMMPS SNAP coefficients for W # LAMMPS SNAP coefficients for W

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# required # required
rcutfac 4.73442 rcutfac 4.73442

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# Definition of SNAP+ZBL+Tabulated potential. # Definition of SNAP+ZBL+Tabulated potential.
variable zblcutinner equal 4 variable zblcutinner equal 4

View File

@ -24,7 +24,7 @@ mass 1 180.88
# choose potential # choose potential
include Ta06A_pot.snap include Ta06A.snap
# Setup output # Setup output

View File

@ -24,7 +24,7 @@ mass 1 183.84
# choose potential # choose potential
include W_2940_2017_2.pot.snap include W_2940_2017_2.snap
# Setup output # Setup output

View File

@ -27,7 +27,7 @@ group tungsten type 1
group helium type 2 group helium type 2
# choose potential # choose potential
include W.SNAP_HePair.pot include W_2940_2017_2_He_JW2013.snap
# Setup output # Setup output

View File

@ -9,9 +9,9 @@ variable zblz equal 73
# Specify hybrid with SNAP, ZBL # Specify hybrid with SNAP, ZBL
pair_style hybrid/overlay snap & pair_style hybrid/overlay &
zbl ${zblcutinner} ${zblcutouter} zbl ${zblcutinner} ${zblcutouter} &
snap
pair_coeff 1 1 zbl ${zblz} ${zblz} pair_coeff 1 1 zbl ${zblz} ${zblz}
pair_coeff * * snap Ta06A.snapcoeff Ta Ta06A.snapparam Ta pair_coeff * * snap Ta06A.snapcoeff Ta Ta06A.snapparam Ta

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# Definition of SNAP+ZBL potential. # Definition of SNAP+ZBL potential.
variable zblcutinner equal 4 variable zblcutinner equal 4

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# LAMMPS SNAP coefficients for W # LAMMPS SNAP coefficients for W

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# required # required
rcutfac 4.73442 rcutfac 4.73442

View File

@ -1,4 +1,4 @@
# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 # DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph]
# #
# Definition of SNAP+ZBL+Tabulated potential. # Definition of SNAP+ZBL+Tabulated potential.
variable zblcutinner equal 4 variable zblcutinner equal 4

View File

@ -1,11 +1,16 @@
This package implements GPU optimizations of various LAMMPS styles. This package implements GPU optimizations of various LAMMPS styles.
This package uses an external library in lib/gpu which must be Section 5.3.1 on the manual gives details of what hardware and Cuda
compiled before making LAMMPS. See the lib/gpu/README file and the software is required on your system, and full details on how to build
and use this package. See the KOKKOS package, which also has
GPU-enabled styles.
This package uses an external library provided in lib/gpu which must
be compiled before making LAMMPS. See the lib/gpu/README file and the
LAMMPS manual for information on building LAMMPS with external LAMMPS manual for information on building LAMMPS with external
libraries. The settings in the Makefile.lammps file in that directory libraries. The settings in the Makefile.lammps file in that directory
must be correct for LAMMPS to build correctly with this package must be correct for LAMMPS to build correctly with this package
installed. installed.
The people who created this package are Mike Brown (while at Sandia The GPU package and its associated library was created by Mike Brown
and ORNL) and Trung Nguyen (while at ORNL). while at Sandia and ORNL, and by Trung Nguyen while at ORNL.

View File

@ -1,5 +1,3 @@
-*- fill-column: 70; -*-
This package provides a pair_style kim command which is a wrapper on This package provides a pair_style kim command which is a wrapper on
the Knowledge Base for Interatomic Models (KIM) repository of the Knowledge Base for Interatomic Models (KIM) repository of
interatomic potentials, so that they can be used by LAMMPS scripts. interatomic potentials, so that they can be used by LAMMPS scripts.

View File

@ -64,6 +64,7 @@ NeighborKokkos::~NeighborKokkos()
memory->destroy_kokkos(k_ex1_bit,ex1_bit); memory->destroy_kokkos(k_ex1_bit,ex1_bit);
memory->destroy_kokkos(k_ex2_bit,ex2_bit); memory->destroy_kokkos(k_ex2_bit,ex2_bit);
memory->destroy_kokkos(k_ex_mol_bit,ex_mol_bit); memory->destroy_kokkos(k_ex_mol_bit,ex_mol_bit);
memory->destroy_kokkos(k_ex_mol_intra,ex_mol_intra);
memory->destroy_kokkos(k_bondlist,bondlist); memory->destroy_kokkos(k_bondlist,bondlist);
memory->destroy_kokkos(k_anglelist,anglelist); memory->destroy_kokkos(k_anglelist,anglelist);
@ -133,6 +134,14 @@ void NeighborKokkos::init_ex_mol_bit_kokkos()
k_ex_mol_bit.modify<LMPHostType>(); k_ex_mol_bit.modify<LMPHostType>();
} }
/* ---------------------------------------------------------------------- */
void NeighborKokkos::grow_ex_mol_intra_kokkos()
{
memory->grow_kokkos(k_ex_mol_intra, ex_mol_intra, maxex_mol, "neigh:ex_mol_intra");
k_ex_mol_intra.modify<LMPHostType>();
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
if any atom moved trigger distance (half of neighbor skin) return 1 if any atom moved trigger distance (half of neighbor skin) return 1
shrink trigger distance if box size has changed shrink trigger distance if box size has changed
@ -348,6 +357,12 @@ void NeighborKokkos::modify_mol_group_grow_kokkos(){
k_ex_mol_group.modify<LMPHostType>(); k_ex_mol_group.modify<LMPHostType>();
} }
/* ---------------------------------------------------------------------- */
void NeighborKokkos::modify_mol_intra_grow_kokkos(){
memory->grow_kokkos(k_ex_mol_intra,ex_mol_intra,maxex_mol,"neigh:ex_mol_intra");
k_ex_mol_intra.modify<LMPHostType>();
}
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void NeighborKokkos::init_topology() { void NeighborKokkos::init_topology() {

View File

@ -54,6 +54,7 @@ class NeighborKokkos : public Neighbor {
DAT::tdual_int_1d k_ex1_bit,k_ex2_bit; DAT::tdual_int_1d k_ex1_bit,k_ex2_bit;
DAT::tdual_int_1d k_ex_mol_group; DAT::tdual_int_1d k_ex_mol_group;
DAT::tdual_int_1d k_ex_mol_bit; DAT::tdual_int_1d k_ex_mol_bit;
DAT::tdual_int_1d k_ex_mol_intra;
NeighBondKokkos<LMPHostType> neighbond_host; NeighBondKokkos<LMPHostType> neighbond_host;
NeighBondKokkos<LMPDeviceType> neighbond_device; NeighBondKokkos<LMPDeviceType> neighbond_device;
@ -76,6 +77,7 @@ class NeighborKokkos : public Neighbor {
void init_ex_type_kokkos(int); void init_ex_type_kokkos(int);
void init_ex_bit_kokkos(); void init_ex_bit_kokkos();
void init_ex_mol_bit_kokkos(); void init_ex_mol_bit_kokkos();
void grow_ex_mol_intra_kokkos();
virtual int check_distance(); virtual int check_distance();
template<class DeviceType> int check_distance_kokkos(); template<class DeviceType> int check_distance_kokkos();
virtual void build(int); virtual void build(int);
@ -84,6 +86,7 @@ class NeighborKokkos : public Neighbor {
void modify_ex_type_grow_kokkos(); void modify_ex_type_grow_kokkos();
void modify_ex_group_grow_kokkos(); void modify_ex_group_grow_kokkos();
void modify_mol_group_grow_kokkos(); void modify_mol_group_grow_kokkos();
void modify_mol_intra_grow_kokkos();
}; };
} }

View File

@ -56,6 +56,7 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::copy_neighbor_info()
k_ex2_bit = neighborKK->k_ex2_bit; k_ex2_bit = neighborKK->k_ex2_bit;
k_ex_mol_group = neighborKK->k_ex_mol_group; k_ex_mol_group = neighborKK->k_ex_mol_group;
k_ex_mol_bit = neighborKK->k_ex_mol_bit; k_ex_mol_bit = neighborKK->k_ex_mol_bit;
k_ex_mol_intra = neighborKK->k_ex_mol_intra;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -147,6 +148,7 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
nex_mol, nex_mol,
k_ex_mol_group.view<DeviceType>(), k_ex_mol_group.view<DeviceType>(),
k_ex_mol_bit.view<DeviceType>(), k_ex_mol_bit.view<DeviceType>(),
k_ex_mol_intra.view<DeviceType>(),
bboxhi,bboxlo, bboxhi,bboxlo,
domain->xperiodic,domain->yperiodic,domain->zperiodic, domain->xperiodic,domain->yperiodic,domain->zperiodic,
domain->xprd_half,domain->yprd_half,domain->zprd_half); domain->xprd_half,domain->yprd_half,domain->zprd_half);
@ -161,6 +163,7 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
k_ex2_bit.sync<DeviceType>(); k_ex2_bit.sync<DeviceType>();
k_ex_mol_group.sync<DeviceType>(); k_ex_mol_group.sync<DeviceType>();
k_ex_mol_bit.sync<DeviceType>(); k_ex_mol_bit.sync<DeviceType>();
k_ex_mol_intra.sync<DeviceType>();
k_bincount.sync<DeviceType>(), k_bincount.sync<DeviceType>(),
k_bins.sync<DeviceType>(), k_bins.sync<DeviceType>(),
atomKK->sync(Device,X_MASK|TYPE_MASK|MASK_MASK|MOLECULE_MASK|TAG_MASK|SPECIAL_MASK); atomKK->sync(Device,X_MASK|TYPE_MASK|MASK_MASK|MOLECULE_MASK|TAG_MASK|SPECIAL_MASK);
@ -284,8 +287,12 @@ int NeighborKokkosExecute<DeviceType>::exclusion(const int &i,const int &j,
if (nex_mol) { if (nex_mol) {
for (m = 0; m < nex_mol; m++) for (m = 0; m < nex_mol; m++)
if (mask(i) & ex_mol_bit(m) && mask(j) & ex_mol_bit(m) && if (ex_mol_intra[m]) { // intra-chain: exclude i-j pair if on same molecule
molecule(i) == molecule(j)) return 1; if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] &&
molecule[i] == molecule[j]) return 1;
} else // exclude i-j pair if on different molecules
if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] &&
molecule[i] != molecule[j]) return 1;
} }
return 0; return 0;

View File

@ -98,6 +98,7 @@ class NPairKokkos : public NPair {
DAT::tdual_int_1d k_ex1_bit,k_ex2_bit; DAT::tdual_int_1d k_ex1_bit,k_ex2_bit;
DAT::tdual_int_1d k_ex_mol_group; DAT::tdual_int_1d k_ex_mol_group;
DAT::tdual_int_1d k_ex_mol_bit; DAT::tdual_int_1d k_ex_mol_bit;
DAT::tdual_int_1d k_ex_mol_intra;
// data from NBin class // data from NBin class
@ -139,6 +140,7 @@ class NeighborKokkosExecute
const int nex_mol; const int nex_mol;
const typename AT::t_int_1d_const ex_mol_group; const typename AT::t_int_1d_const ex_mol_group;
const typename AT::t_int_1d_const ex_mol_bit; const typename AT::t_int_1d_const ex_mol_bit;
const typename AT::t_int_1d_const ex_mol_intra;
// data from NBin class // data from NBin class
@ -216,6 +218,7 @@ class NeighborKokkosExecute
const int & _nex_mol, const int & _nex_mol,
const typename AT::t_int_1d_const & _ex_mol_group, const typename AT::t_int_1d_const & _ex_mol_group,
const typename AT::t_int_1d_const & _ex_mol_bit, const typename AT::t_int_1d_const & _ex_mol_bit,
const typename AT::t_int_1d_const & _ex_mol_intra,
const X_FLOAT *_bboxhi, const X_FLOAT* _bboxlo, const X_FLOAT *_bboxhi, const X_FLOAT* _bboxlo,
const int & _xperiodic, const int & _yperiodic, const int & _zperiodic, const int & _xperiodic, const int & _yperiodic, const int & _zperiodic,
const int & _xprd_half, const int & _yprd_half, const int & _zprd_half): const int & _xprd_half, const int & _yprd_half, const int & _zprd_half):
@ -235,6 +238,7 @@ class NeighborKokkosExecute
ex1_group(_ex1_group),ex2_group(_ex2_group), ex1_group(_ex1_group),ex2_group(_ex2_group),
ex1_bit(_ex1_bit),ex2_bit(_ex2_bit),nex_mol(_nex_mol), ex1_bit(_ex1_bit),ex2_bit(_ex2_bit),nex_mol(_nex_mol),
ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit), ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit),
ex_mol_intra(_ex_mol_intra),
xperiodic(_xperiodic),yperiodic(_yperiodic),zperiodic(_zperiodic), xperiodic(_xperiodic),yperiodic(_yperiodic),zperiodic(_zperiodic),
xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half) { xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half) {

View File

@ -7,7 +7,7 @@ SHELL = /bin/sh
# specify flags and libraries needed for your compiler # specify flags and libraries needed for your compiler
CC = mpicxx CC = mpicxx
CCFLAGS = -g -O3 -fopenmp CCFLAGS = -g -O3 -restrict -fopenmp
SHFLAGS = -fPIC SHFLAGS = -fPIC
DEPFLAGS = -M DEPFLAGS = -M

View File

@ -447,7 +447,6 @@ void FixShake::setup(int vflag)
next_output = (ntimestep/output_every)*output_every + output_every; next_output = (ntimestep/output_every)*output_every + output_every;
} else next_output = -1; } else next_output = -1;
// set respa to 0 if verlet is used and to 1 otherwise // set respa to 0 if verlet is used and to 1 otherwise
if (strstr(update->integrate_style,"verlet")) if (strstr(update->integrate_style,"verlet"))
@ -476,7 +475,6 @@ void FixShake::setup(int vflag)
// precalculate constraining forces for first integration step // precalculate constraining forces for first integration step
shake_end_of_step(vflag); shake_end_of_step(vflag);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -592,6 +590,7 @@ void FixShake::post_force(int vflag)
} }
// store vflag for coordinate_constraints_end_of_step() // store vflag for coordinate_constraints_end_of_step()
vflag_post_force = vflag; vflag_post_force = vflag;
} }

View File

@ -815,7 +815,7 @@ void SNA::compute_dbidrj()
// for mb1 = 0,...,j1mid // for mb1 = 0,...,j1mid
// for ma1 = 0,...,j1 // for ma1 = 0,...,j1
// zdb += // zdb +=
// Conj(dudr(j1,ma1,mb1))*z(j1,j2,j,ma1,mb1) // Conj(dudr(j1,ma1,mb1))*z(j,j2,j1,ma1,mb1)
// dbdr(j1,j2,j) += 2*zdb*(j+1)/(j1+1) // dbdr(j1,j2,j) += 2*zdb*(j+1)/(j1+1)
// zdb = 0 // zdb = 0
// for mb2 = 0,...,j2mid // for mb2 = 0,...,j2mid

View File

@ -166,7 +166,7 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL)
ex1_group = ex2_group = ex1_bit = ex2_bit = NULL; ex1_group = ex2_group = ex1_bit = ex2_bit = NULL;
nex_mol = maxex_mol = 0; nex_mol = maxex_mol = 0;
ex_mol_group = ex_mol_bit = NULL; ex_mol_group = ex_mol_bit = ex_mol_intra = NULL;
// Kokkos setting // Kokkos setting
@ -234,6 +234,7 @@ Neighbor::~Neighbor()
memory->destroy(ex_mol_group); memory->destroy(ex_mol_group);
delete [] ex_mol_bit; delete [] ex_mol_bit;
memory->destroy(ex_mol_intra);
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -2323,7 +2324,8 @@ void Neighbor::modify_params(int narg, char **arg)
nex_group++; nex_group++;
iarg += 4; iarg += 4;
} else if (strcmp(arg[iarg+1],"molecule") == 0) { } else if (strcmp(arg[iarg+1],"molecule/inter") == 0 ||
strcmp(arg[iarg+1],"molecule/intra") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command"); if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command");
if (atom->molecule_flag == 0) if (atom->molecule_flag == 0)
error->all(FLERR,"Neigh_modify exclude molecule " error->all(FLERR,"Neigh_modify exclude molecule "
@ -2331,10 +2333,18 @@ void Neighbor::modify_params(int narg, char **arg)
if (nex_mol == maxex_mol) { if (nex_mol == maxex_mol) {
maxex_mol += EXDELTA; maxex_mol += EXDELTA;
memory->grow(ex_mol_group,maxex_mol,"neigh:ex_mol_group"); memory->grow(ex_mol_group,maxex_mol,"neigh:ex_mol_group");
if (lmp->kokkos)
grow_ex_mol_intra_kokkos();
else
memory->grow(ex_mol_intra,maxex_mol,"neigh:ex_mol_intra");
} }
ex_mol_group[nex_mol] = group->find(arg[iarg+2]); ex_mol_group[nex_mol] = group->find(arg[iarg+2]);
if (ex_mol_group[nex_mol] == -1) if (ex_mol_group[nex_mol] == -1)
error->all(FLERR,"Invalid group ID in neigh_modify command"); error->all(FLERR,"Invalid group ID in neigh_modify command");
if (strcmp(arg[iarg+1],"molecule/intra") == 0)
ex_mol_intra[nex_mol] = 1;
else
ex_mol_intra[nex_mol] = 0;
nex_mol++; nex_mol++;
iarg += 3; iarg += 3;

View File

@ -71,6 +71,8 @@ class Neighbor : protected Pointers {
int nex_mol; // # of entries in molecule exclusion list int nex_mol; // # of entries in molecule exclusion list
int *ex_mol_group; // molecule group #'s to exclude int *ex_mol_group; // molecule group #'s to exclude
int *ex_mol_bit; // molecule group bits to exclude int *ex_mol_bit; // molecule group bits to exclude
int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter)
// 1 = exclude if in same molecule (intra)
// special info, used by NeighPair // special info, used by NeighPair
@ -229,6 +231,7 @@ class Neighbor : protected Pointers {
virtual void init_ex_type_kokkos(int) {} virtual void init_ex_type_kokkos(int) {}
virtual void init_ex_bit_kokkos() {} virtual void init_ex_bit_kokkos() {}
virtual void init_ex_mol_bit_kokkos() {} virtual void init_ex_mol_bit_kokkos() {}
virtual void grow_ex_mol_intra_kokkos() {}
}; };
namespace NeighConst { namespace NeighConst {

View File

@ -86,6 +86,7 @@ void NPair::copy_neighbor_info()
nex_mol = neighbor->nex_mol; nex_mol = neighbor->nex_mol;
ex_mol_group = neighbor->ex_mol_group; ex_mol_group = neighbor->ex_mol_group;
ex_mol_bit = neighbor->ex_mol_bit; ex_mol_bit = neighbor->ex_mol_bit;
ex_mol_intra = neighbor->ex_mol_intra;
// special info // special info
@ -180,8 +181,17 @@ int NPair::exclusion(int i, int j, int itype, int jtype,
if (nex_mol) { if (nex_mol) {
for (m = 0; m < nex_mol; m++) for (m = 0; m < nex_mol; m++)
if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] &&
molecule[i] == molecule[j]) return 1; // intra-chain: exclude i-j pair if in same molecule
// inter-chain: exclude i-j pair if in different molecules
if (ex_mol_intra[m]) {
if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] &&
molecule[i] == molecule[j]) return 1;
} else {
if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] &&
molecule[i] != molecule[j]) return 1;
}
} }
return 0; return 0;

View File

@ -61,8 +61,10 @@ class NPair : protected Pointers {
int *ex1_bit,*ex2_bit; // pairs of group bits to exclude int *ex1_bit,*ex2_bit; // pairs of group bits to exclude
int nex_mol; // # of entries in molecule exclusion list int nex_mol; // # of entries in molecule exclusion list
int *ex_mol_group; // molecule group #'s to exclude
int *ex_mol_bit; // molecule group bits to exclude int *ex_mol_bit; // molecule group bits to exclude
int *ex_mol_group; // molecule group #'s to exclude
int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter)
// 1 = exclude if in same molecule (intra)
// special data from Neighbor class // special data from Neighbor class