Latest version of PairGrid
This commit is contained in:
@ -205,8 +205,8 @@ void PairSNAGrid::settings(int narg, char ** arg)
|
||||
|
||||
// process required arguments
|
||||
|
||||
memory->create(radelem,ntypes+1,"sna/grid/local:radelem"); // offset by 1 to match up with types
|
||||
memory->create(wjelem,ntypes+1,"sna/grid/local:wjelem");
|
||||
memory->create(radelem,ntypes+1,"pair:sna/grid:radelem"); // offset by 1 to match up with types
|
||||
memory->create(wjelem,ntypes+1,"pair:sna/grid:wjelem");
|
||||
|
||||
rcutfac = atof(arg[0]);
|
||||
rfac0 = atof(arg[1]);
|
||||
@ -221,7 +221,7 @@ void PairSNAGrid::settings(int narg, char ** arg)
|
||||
|
||||
double cut;
|
||||
cutmax = 0.0;
|
||||
memory->create(cutsq,ntypes+1,ntypes+1,"sna/grid/local:cutsq");
|
||||
memory->create(cutsq,ntypes+1,ntypes+1,"pair:sna/grid:cutsq");
|
||||
for(int i = 1; i <= ntypes; i++) {
|
||||
cut = 2.0*radelem[i]*rcutfac;
|
||||
if (cut > cutmax) cutmax = cut;
|
||||
@ -262,7 +262,7 @@ void PairSNAGrid::settings(int narg, char ** arg)
|
||||
if (iarg+2 > narg)
|
||||
error->all(FLERR,"Illegal pair sna/grid command");
|
||||
chemflag = 1;
|
||||
memory->create(map,ntypes+1,"compute_sna_grid_local:map");
|
||||
memory->create(map,ntypes+1,"pair:sna/grid:map");
|
||||
nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
|
||||
for (int i = 0; i < ntypes; i++) {
|
||||
int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp);
|
||||
|
||||
@ -45,7 +45,6 @@ class PairSNAGrid : public PairGrid {
|
||||
int *map; // map types to [0,nelements)
|
||||
int nelements, chemflag;
|
||||
class SNA *snaptr;
|
||||
double cutmax;
|
||||
int quadraticflag;
|
||||
};
|
||||
|
||||
|
||||
@ -67,6 +67,7 @@ void PairGrid::init()
|
||||
|
||||
void PairGrid::setup()
|
||||
{
|
||||
printf("Hello, world! C\n");
|
||||
deallocate_grid();
|
||||
set_grid_global();
|
||||
set_grid_local();
|
||||
@ -297,9 +298,11 @@ void PairGrid::settings(int narg, char ** arg)
|
||||
void PairGrid::coeff(int narg, char **arg)
|
||||
{
|
||||
if (!allocated) allocate();
|
||||
if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
// if (narg != 2 + atom->ntypes) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
|
||||
map_element2type(narg-4,arg+4);
|
||||
// map_element2type(narg-4,arg+4);
|
||||
// map_element2type(0,nullptr);
|
||||
|
||||
}
|
||||
|
||||
@ -321,13 +324,13 @@ void PairGrid::init_style()
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init for one type pair i,j and corresponding j,i
|
||||
return maximum force cut off distance
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double PairGrid::init_one(int i, int j)
|
||||
{
|
||||
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
|
||||
return 0.0;
|
||||
return cutmax;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -99,6 +99,8 @@ void Verlet::setup(int flag)
|
||||
}
|
||||
}
|
||||
|
||||
printf("Hello, world! A\n");
|
||||
|
||||
if (lmp->kokkos)
|
||||
error->all(FLERR,"KOKKOS package requires run_style verlet/kk");
|
||||
|
||||
@ -126,6 +128,8 @@ void Verlet::setup(int flag)
|
||||
modify->setup_post_neighbor();
|
||||
neighbor->ncalls = 0;
|
||||
|
||||
printf("Hello, world! B\n");
|
||||
|
||||
// compute all forces
|
||||
|
||||
force->setup();
|
||||
@ -133,6 +137,8 @@ void Verlet::setup(int flag)
|
||||
force_clear();
|
||||
modify->setup_pre_force(vflag);
|
||||
|
||||
printf("Hello, world!\n");
|
||||
|
||||
if (pair_compute_flag) force->pair->compute(eflag,vflag);
|
||||
else if (force->pair) force->pair->compute_dummy(eflag,vflag);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user