forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12151 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
f9e246d0cc
commit
3b1a73c3bd
|
@ -37,11 +37,11 @@ AtomKokkos::AtomKokkos(LAMMPS *lmp) : Atom(lmp)
|
|||
|
||||
AtomKokkos::~AtomKokkos()
|
||||
{
|
||||
k_tag = DAT::tdual_int_1d();
|
||||
k_tag = DAT::tdual_tagint_1d();
|
||||
k_mask = DAT::tdual_int_1d();
|
||||
k_type = DAT::tdual_int_1d();
|
||||
k_image = DAT::tdual_int_1d();
|
||||
k_molecule = DAT::tdual_int_1d();
|
||||
k_image = DAT::tdual_imageint_1d();
|
||||
k_molecule = DAT::tdual_tagint_1d();
|
||||
|
||||
k_x = DAT::tdual_x_array();
|
||||
k_v = DAT::tdual_v_array();
|
||||
|
|
|
@ -21,8 +21,9 @@ namespace LAMMPS_NS {
|
|||
|
||||
class AtomKokkos : public Atom {
|
||||
public:
|
||||
DAT::tdual_int_1d k_tag, k_type, k_mask, k_molecule;
|
||||
DAT::tdual_tagint_1d k_image;
|
||||
DAT::tdual_tagint_1d k_tag, k_molecule;
|
||||
DAT::tdual_imageint_1d k_image;
|
||||
DAT::tdual_int_1d k_type, k_mask;
|
||||
DAT::tdual_x_array k_x;
|
||||
DAT::tdual_v_array k_v;
|
||||
DAT::tdual_f_array k_f;
|
||||
|
|
|
@ -901,13 +901,13 @@ struct AtomVecAtomicKokkos_PackExchangeFunctor {
|
|||
typename AT::t_tagint_1d_randomread _tag;
|
||||
typename AT::t_int_1d_randomread _type;
|
||||
typename AT::t_int_1d_randomread _mask;
|
||||
typename AT::t_int_1d_randomread _image;
|
||||
typename AT::t_imageint_1d_randomread _image;
|
||||
typename AT::t_x_array _xw;
|
||||
typename AT::t_v_array _vw;
|
||||
typename AT::t_tagint_1d _tagw;
|
||||
typename AT::t_int_1d _typew;
|
||||
typename AT::t_int_1d _maskw;
|
||||
typename AT::t_int_1d _imagew;
|
||||
typename AT::t_imageint_1d _imagew;
|
||||
|
||||
typename AT::t_xfloat_2d_um _buf;
|
||||
int _nlocal,_dim;
|
||||
|
@ -1030,7 +1030,7 @@ struct AtomVecAtomicKokkos_UnpackExchangeFunctor {
|
|||
typename AT::t_tagint_1d _tag;
|
||||
typename AT::t_int_1d _type;
|
||||
typename AT::t_int_1d _mask;
|
||||
typename AT::t_int_1d _image;
|
||||
typename AT::t_imageint_1d _image;
|
||||
|
||||
typename AT::t_xfloat_2d_um _buf;
|
||||
int _dim;
|
||||
|
|
|
@ -81,15 +81,17 @@ class AtomVecAtomicKokkos : public AtomVecKokkos {
|
|||
void modified(ExecutionSpace space, unsigned int mask);
|
||||
|
||||
protected:
|
||||
int *tag,*type,*mask;
|
||||
tagint *image;
|
||||
tagint *tag;
|
||||
imageint *image;
|
||||
int *type,*mask;
|
||||
double **x,**v,**f;
|
||||
|
||||
DAT::t_int_1d d_tag, d_type, d_mask;
|
||||
HAT::t_int_1d h_tag, h_type, h_mask;
|
||||
|
||||
DAT::t_tagint_1d d_image;
|
||||
HAT::t_tagint_1d h_image;
|
||||
DAT::t_tagint_1d d_tag;
|
||||
HAT::t_tagint_1d h_tag;
|
||||
DAT::t_imageint_1d d_image;
|
||||
HAT::t_imageint_1d h_image;
|
||||
DAT::t_int_1d d_type, d_mask;
|
||||
HAT::t_int_1d h_type, h_mask;
|
||||
|
||||
DAT::t_x_array d_x;
|
||||
DAT::t_v_array d_v;
|
||||
|
|
|
@ -38,14 +38,14 @@ struct DomainPBCFunctor {
|
|||
typename ArrayTypes<DeviceType>::t_x_array x;
|
||||
typename ArrayTypes<DeviceType>::t_v_array v;
|
||||
typename ArrayTypes<DeviceType>::t_int_1d mask;
|
||||
typename ArrayTypes<DeviceType>::t_int_1d image;
|
||||
typename ArrayTypes<DeviceType>::t_imageint_1d image;
|
||||
int deform_groupbit;
|
||||
double h_rate[6];
|
||||
int xperiodic,yperiodic,zperiodic;
|
||||
|
||||
DomainPBCFunctor(double* _lo, double* _hi, double* _period,
|
||||
DAT::tdual_x_array _x, DAT::tdual_v_array _v,
|
||||
DAT::tdual_int_1d _mask, DAT::tdual_int_1d _image,
|
||||
DAT::tdual_int_1d _mask, DAT::tdual_imageint_1d _image,
|
||||
int _deform_groupbit, double* _h_rate,
|
||||
int _xperiodic, int _yperiodic, int _zperiodic):
|
||||
x(_x.view<DeviceType>()), v(_v.view<DeviceType>()),
|
||||
|
@ -65,7 +65,7 @@ struct DomainPBCFunctor {
|
|||
if (x(i,0) < lo[0]) {
|
||||
x(i,0) += period[0];
|
||||
if (DEFORM_VREMAP && (mask[i] & deform_groupbit)) v(i,0) += h_rate[0];
|
||||
int idim = image[i] & IMGMASK;
|
||||
imageint idim = image[i] & IMGMASK;
|
||||
const int otherdims = image[i] ^ idim;
|
||||
idim--;
|
||||
idim &= IMGMASK;
|
||||
|
@ -75,7 +75,7 @@ struct DomainPBCFunctor {
|
|||
x(i,0) -= period[0];
|
||||
x(i,0) = MAX(x(i,0),lo[0]);
|
||||
if (DEFORM_VREMAP && (mask[i] & deform_groupbit)) v(i,0) -= h_rate[0];
|
||||
int idim = image[i] & IMGMASK;
|
||||
imageint idim = image[i] & IMGMASK;
|
||||
const int otherdims = image[i] ^ idim;
|
||||
idim++;
|
||||
idim &= IMGMASK;
|
||||
|
@ -90,8 +90,8 @@ struct DomainPBCFunctor {
|
|||
v(i,0) += h_rate[5];
|
||||
v(i,1) += h_rate[1];
|
||||
}
|
||||
int idim = (image[i] >> IMGBITS) & IMGMASK;
|
||||
const int otherdims = image[i] ^ (idim << IMGBITS);
|
||||
imageint idim = (image[i] >> IMGBITS) & IMGMASK;
|
||||
const imageint otherdims = image[i] ^ (idim << IMGBITS);
|
||||
idim--;
|
||||
idim &= IMGMASK;
|
||||
image[i] = otherdims | (idim << IMGBITS);
|
||||
|
@ -103,8 +103,8 @@ struct DomainPBCFunctor {
|
|||
v(i,0) -= h_rate[5];
|
||||
v(i,1) -= h_rate[1];
|
||||
}
|
||||
int idim = (image[i] >> IMGBITS) & IMGMASK;
|
||||
const int otherdims = image[i] ^ (idim << IMGBITS);
|
||||
imageint idim = (image[i] >> IMGBITS) & IMGMASK;
|
||||
const imageint otherdims = image[i] ^ (idim << IMGBITS);
|
||||
idim++;
|
||||
idim &= IMGMASK;
|
||||
image[i] = otherdims | (idim << IMGBITS);
|
||||
|
@ -119,8 +119,8 @@ struct DomainPBCFunctor {
|
|||
v(i,1) += h_rate[3];
|
||||
v(i,2) += h_rate[2];
|
||||
}
|
||||
int idim = image[i] >> IMG2BITS;
|
||||
const int otherdims = image[i] ^ (idim << IMG2BITS);
|
||||
imageint idim = image[i] >> IMG2BITS;
|
||||
const imageint otherdims = image[i] ^ (idim << IMG2BITS);
|
||||
idim--;
|
||||
idim &= IMGMASK;
|
||||
image[i] = otherdims | (idim << IMG2BITS);
|
||||
|
@ -133,8 +133,8 @@ struct DomainPBCFunctor {
|
|||
v(i,1) -= h_rate[3];
|
||||
v(i,2) -= h_rate[2];
|
||||
}
|
||||
int idim = image[i] >> IMG2BITS;
|
||||
const int otherdims = image[i] ^ (idim << IMG2BITS);
|
||||
imageint idim = image[i] >> IMG2BITS;
|
||||
const imageint otherdims = image[i] ^ (idim << IMG2BITS);
|
||||
idim++;
|
||||
idim &= IMGMASK;
|
||||
image[i] = otherdims | (idim << IMG2BITS);
|
||||
|
|
|
@ -248,6 +248,15 @@ typedef tdual_tagint_1d::t_dev_um t_tagint_1d_um;
|
|||
typedef tdual_tagint_1d::t_dev_const_um t_tagint_1d_const_um;
|
||||
typedef tdual_tagint_1d::t_dev_const_randomread t_tagint_1d_randomread;
|
||||
|
||||
typedef Kokkos::
|
||||
DualView<LAMMPS_NS::imageint*, LMPDeviceType::array_layout, LMPDeviceType>
|
||||
tdual_imageint_1d;
|
||||
typedef tdual_imageint_1d::t_dev t_imageint_1d;
|
||||
typedef tdual_imageint_1d::t_dev_const t_imageint_1d_const;
|
||||
typedef tdual_imageint_1d::t_dev_um t_imageint_1d_um;
|
||||
typedef tdual_imageint_1d::t_dev_const_um t_imageint_1d_const_um;
|
||||
typedef tdual_imageint_1d::t_dev_const_randomread t_imageint_1d_randomread;
|
||||
|
||||
// 1d float array n
|
||||
|
||||
typedef Kokkos::DualView<LMP_FLOAT*, LMPDeviceType::array_layout, LMPDeviceType> tdual_float_1d;
|
||||
|
@ -437,6 +446,13 @@ typedef tdual_tagint_1d::t_host_um t_tagint_1d_um;
|
|||
typedef tdual_tagint_1d::t_host_const_um t_tagint_1d_const_um;
|
||||
typedef tdual_tagint_1d::t_host_const_randomread t_tagint_1d_randomread;
|
||||
|
||||
typedef Kokkos::DualView<LAMMPS_NS::imageint*, LMPDeviceType::array_layout, LMPDeviceType> tdual_imageint_1d;
|
||||
typedef tdual_imageint_1d::t_host t_imageint_1d;
|
||||
typedef tdual_imageint_1d::t_host_const t_imageint_1d_const;
|
||||
typedef tdual_imageint_1d::t_host_um t_imageint_1d_um;
|
||||
typedef tdual_imageint_1d::t_host_const_um t_imageint_1d_const_um;
|
||||
typedef tdual_imageint_1d::t_host_const_randomread t_imageint_1d_randomread;
|
||||
|
||||
//1d float array n
|
||||
typedef Kokkos::DualView<LMP_FLOAT*, LMPDeviceType::array_layout, LMPDeviceType> tdual_float_1d;
|
||||
typedef tdual_float_1d::t_host t_float_1d;
|
||||
|
|
|
@ -33,7 +33,8 @@ class NeighborKokkosExecute
|
|||
typename AT::t_int_2d bins;
|
||||
typename AT::t_int_2d_const c_bins;
|
||||
const typename AT::t_x_array_randomread x;
|
||||
const typename AT::t_int_1d_const type,mask,molecule;
|
||||
const typename AT::t_int_1d_const type,mask;
|
||||
const typename AT::t_tagint_1d_const molecule;
|
||||
|
||||
const int nbinx,nbiny,nbinz;
|
||||
const int mbinx,mbiny,mbinz;
|
||||
|
@ -57,7 +58,7 @@ class NeighborKokkosExecute
|
|||
const typename AT::t_x_array_randomread &_x,
|
||||
const typename AT::t_int_1d_const &_type,
|
||||
const typename AT::t_int_1d_const &_mask,
|
||||
const typename AT::t_int_1d_const &_molecule,
|
||||
const typename AT::t_tagint_1d_const &_molecule,
|
||||
const int & _nbinx,const int & _nbiny,const int & _nbinz,
|
||||
const int & _mbinx,const int & _mbiny,const int & _mbinz,
|
||||
const int & _mbinxlo,const int & _mbinylo,const int & _mbinzlo,
|
||||
|
|
|
@ -389,7 +389,7 @@ void FixBondBreak::check_ghosts()
|
|||
tagint *slist;
|
||||
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int flag = 0;
|
||||
|
@ -718,7 +718,7 @@ int FixBondBreak::pack_comm(int n, int *list, double *buf,
|
|||
}
|
||||
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
|
||||
m = 0;
|
||||
for (i = 0; i < n; i++) {
|
||||
|
@ -749,7 +749,7 @@ void FixBondBreak::unpack_comm(int n, int first, double *buf)
|
|||
} else {
|
||||
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
|
@ -800,25 +800,25 @@ void FixBondBreak::unpack_reverse_comm(int n, int *list, double *buf)
|
|||
void FixBondBreak::print_bb()
|
||||
{
|
||||
for (int i = 0; i < atom->nlocal; i++) {
|
||||
printf("TAG %i: %d nbonds: ",atom->tag[i],atom->num_bond[i]);
|
||||
printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]);
|
||||
for (int j = 0; j < atom->num_bond[i]; j++) {
|
||||
printf(" %d",atom->bond_atom[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("TAG %i: %d nangles: ",atom->tag[i],atom->num_angle[i]);
|
||||
printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]);
|
||||
for (int j = 0; j < atom->num_angle[i]; j++) {
|
||||
printf(" %d %d %d,",atom->angle_atom1[i][j],
|
||||
atom->angle_atom2[i][j],atom->angle_atom3[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("TAG %i: %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]);
|
||||
printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]);
|
||||
for (int j = 0; j < atom->num_dihedral[i]; j++) {
|
||||
printf(" %d %d %d %d,",atom->dihedral_atom1[i][j],
|
||||
atom->dihedral_atom2[i][j],atom->dihedral_atom3[i][j],
|
||||
atom->dihedral_atom4[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("TAG %i: %d %d %d nspecial: ",atom->tag[i],
|
||||
printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i],
|
||||
atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]);
|
||||
for (int j = 0; j < atom->nspecial[i][2]; j++) {
|
||||
printf(" %d",atom->special[i][j]);
|
||||
|
|
|
@ -592,7 +592,7 @@ void FixBondCreate::check_ghosts()
|
|||
tagint *slist;
|
||||
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
int flag = 0;
|
||||
|
@ -1236,7 +1236,7 @@ int FixBondCreate::pack_comm(int n, int *list, double *buf,
|
|||
}
|
||||
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
|
||||
m = 0;
|
||||
for (i = 0; i < n; i++) {
|
||||
|
@ -1272,7 +1272,7 @@ void FixBondCreate::unpack_comm(int n, int first, double *buf)
|
|||
} else {
|
||||
|
||||
int **nspecial = atom->nspecial;
|
||||
int **special = atom->special;
|
||||
tagint **special = atom->special;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
|
@ -1397,32 +1397,32 @@ double FixBondCreate::memory_usage()
|
|||
void FixBondCreate::print_bb()
|
||||
{
|
||||
for (int i = 0; i < atom->nlocal; i++) {
|
||||
printf("TAG %i: %d nbonds: ",atom->tag[i],atom->num_bond[i]);
|
||||
printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]);
|
||||
for (int j = 0; j < atom->num_bond[i]; j++) {
|
||||
printf(" %d",atom->bond_atom[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("TAG %i: %d nangles: ",atom->tag[i],atom->num_angle[i]);
|
||||
printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]);
|
||||
for (int j = 0; j < atom->num_angle[i]; j++) {
|
||||
printf(" %d %d %d,",atom->angle_atom1[i][j],
|
||||
atom->angle_atom2[i][j],atom->angle_atom3[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("TAG %i: %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]);
|
||||
printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]);
|
||||
for (int j = 0; j < atom->num_dihedral[i]; j++) {
|
||||
printf(" %d %d %d %d,",atom->dihedral_atom1[i][j],
|
||||
atom->dihedral_atom2[i][j],atom->dihedral_atom3[i][j],
|
||||
atom->dihedral_atom4[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("TAG %i: %d nimpropers: ",atom->tag[i],atom->num_improper[i]);
|
||||
printf("TAG " TAGINT_FORMAT ": %d nimpropers: ",atom->tag[i],atom->num_improper[i]);
|
||||
for (int j = 0; j < atom->num_improper[i]; j++) {
|
||||
printf(" %d %d %d %d,",atom->improper_atom1[i][j],
|
||||
atom->improper_atom2[i][j],atom->improper_atom3[i][j],
|
||||
atom->improper_atom4[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("TAG %i: %d %d %d nspecial: ",atom->tag[i],
|
||||
printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i],
|
||||
atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]);
|
||||
for (int j = 0; j < atom->nspecial[i][2]; j++) {
|
||||
printf(" %d",atom->special[i][j]);
|
||||
|
|
|
@ -55,7 +55,8 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
con_mono = NULL;
|
||||
con_poly = NULL;
|
||||
tags = occvec = sendocc = lroot = lnext = NULL;
|
||||
tags = NULL;
|
||||
occvec = sendocc = lroot = lnext = NULL;
|
||||
|
||||
int iarg = 3;
|
||||
while ( iarg<narg ) {
|
||||
|
|
Loading…
Reference in New Issue