git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14379 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -355,12 +355,12 @@ struct PairComputeFunctor<PairStyle,FULLCLUSTER,STACKPARAMS,Specialisation> {
|
|||||||
EV_FLOAT compute_item(const typename Kokkos::TeamPolicy<device_type>::member_type& dev,
|
EV_FLOAT compute_item(const typename Kokkos::TeamPolicy<device_type>::member_type& dev,
|
||||||
const NeighListKokkos<device_type> &list, const NoCoulTag& ) const {
|
const NeighListKokkos<device_type> &list, const NoCoulTag& ) const {
|
||||||
EV_FLOAT ev;
|
EV_FLOAT ev;
|
||||||
const int i = dev.league_rank()*dev.team_size() + dev.team_rank();
|
int i = dev.league_rank()*dev.team_size() + dev.team_rank();
|
||||||
|
|
||||||
const X_FLOAT xtmp = c.c_x(i,0);
|
const X_FLOAT xtmp = c.c_x(i,0);
|
||||||
const X_FLOAT ytmp = c.c_x(i,1);
|
const X_FLOAT ytmp = c.c_x(i,1);
|
||||||
const X_FLOAT ztmp = c.c_x(i,2);
|
const X_FLOAT ztmp = c.c_x(i,2);
|
||||||
const int itype = c.type(i);
|
int itype = c.type(i);
|
||||||
|
|
||||||
const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i);
|
const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i);
|
||||||
const int jnum = list.d_numneigh[i];
|
const int jnum = list.d_numneigh[i];
|
||||||
@ -368,7 +368,7 @@ struct PairComputeFunctor<PairStyle,FULLCLUSTER,STACKPARAMS,Specialisation> {
|
|||||||
F_FLOAT3 ftmp;
|
F_FLOAT3 ftmp;
|
||||||
|
|
||||||
for (int jj = 0; jj < jnum; jj++) {
|
for (int jj = 0; jj < jnum; jj++) {
|
||||||
const int jjj = neighbors_i(jj);
|
int jjj = neighbors_i(jj);
|
||||||
|
|
||||||
Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(dev,NeighClusterSize),[&] (const int& k, F_FLOAT3& fftmp) {
|
Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(dev,NeighClusterSize),[&] (const int& k, F_FLOAT3& fftmp) {
|
||||||
const F_FLOAT factor_lj = c.special_lj[sbmask(jjj+k)];
|
const F_FLOAT factor_lj = c.special_lj[sbmask(jjj+k)];
|
||||||
|
|||||||
@ -458,7 +458,7 @@ void VerletKokkos::force_clear()
|
|||||||
size_t nbytes = sizeof(double) * nall;
|
size_t nbytes = sizeof(double) * nall;
|
||||||
|
|
||||||
if (nbytes) {
|
if (nbytes) {
|
||||||
if (atomKK->k_f.modified_host > atomKK->k_f.modified_device) {
|
if (atomKK->k_f.modified_host() > atomKK->k_f.modified_device()) {
|
||||||
memset_kokkos(atomKK->k_f.view<LMPHostType>());
|
memset_kokkos(atomKK->k_f.view<LMPHostType>());
|
||||||
atomKK->modified(Host,F_MASK);
|
atomKK->modified(Host,F_MASK);
|
||||||
} else {
|
} else {
|
||||||
@ -475,7 +475,7 @@ void VerletKokkos::force_clear()
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
int nall = atomKK->nfirst;
|
int nall = atomKK->nfirst;
|
||||||
if (atomKK->k_f.modified_host > atomKK->k_f.modified_device) {
|
if (atomKK->k_f.modified_host() > atomKK->k_f.modified_device()) {
|
||||||
memset_kokkos(atomKK->k_f.view<LMPHostType>());
|
memset_kokkos(atomKK->k_f.view<LMPHostType>());
|
||||||
atomKK->modified(Host,F_MASK);
|
atomKK->modified(Host,F_MASK);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -604,7 +604,7 @@ void PairComb3::read_file(char *file)
|
|||||||
|
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
fp = fopen(file,"r");
|
fp = force->open_potential(file);
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
char str[128];
|
char str[128];
|
||||||
sprintf(str,"Cannot open COMB3 potential file %s",file);
|
sprintf(str,"Cannot open COMB3 potential file %s",file);
|
||||||
|
|||||||
@ -104,6 +104,16 @@ void FixSRP::init()
|
|||||||
if ((bptype < 1) || (bptype > atom->ntypes))
|
if ((bptype < 1) || (bptype > atom->ntypes))
|
||||||
error->all(FLERR,"Illegal bond particle type");
|
error->all(FLERR,"Illegal bond particle type");
|
||||||
|
|
||||||
|
// fix SRP should be the first fix running at the PRE_EXCHANGE step.
|
||||||
|
// Otherwise it might conflict with, e.g. fix deform
|
||||||
|
|
||||||
|
if (modify->n_pre_exchange > 1) {
|
||||||
|
char *first = modify->fix[modify->list_pre_exchange[0]]->id;
|
||||||
|
if ((comm->me == 0) && (strcmp(id,first) != 0))
|
||||||
|
error->warning(FLERR,"Internal fix for pair srp defined too late."
|
||||||
|
" May lead to incorrect behavior.");
|
||||||
|
}
|
||||||
|
|
||||||
// setup neigh exclusions for diff atom types
|
// setup neigh exclusions for diff atom types
|
||||||
// bond particles do not interact with other types
|
// bond particles do not interact with other types
|
||||||
// type bptype only interacts with itself
|
// type bptype only interacts with itself
|
||||||
|
|||||||
@ -23,8 +23,11 @@
|
|||||||
konglt@sjtu.edu.cn; konglt@gmail.com
|
konglt@sjtu.edu.cn; konglt@gmail.com
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "fix_phonon.h"
|
#include "fix_phonon.h"
|
||||||
|
#include "fft3d_wrap.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "compute.h"
|
#include "compute.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
|||||||
@ -43,10 +43,6 @@ typedef double FFT_SCALAR;
|
|||||||
#include <complex>
|
#include <complex>
|
||||||
#include "fix.h"
|
#include "fix.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "fft3d_wrap.h"
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@ namespace LAMMPS_NS {
|
|||||||
|
|
||||||
class Modify : protected Pointers {
|
class Modify : protected Pointers {
|
||||||
friend class Info;
|
friend class Info;
|
||||||
|
friend class FixSRP;
|
||||||
public:
|
public:
|
||||||
int nfix,maxfix;
|
int nfix,maxfix;
|
||||||
int n_initial_integrate,n_post_integrate,n_pre_exchange,n_pre_neighbor;
|
int n_initial_integrate,n_post_integrate,n_pre_exchange,n_pre_neighbor;
|
||||||
|
|||||||
Reference in New Issue
Block a user