Eliminated several undefined variables
This commit is contained in:
@ -1,7 +1,4 @@
|
|||||||
# Demonstrate bispectrum computes
|
# Demonstrate pair style base on sna/grid
|
||||||
|
|
||||||
# CORRECTNESS: thermo output for c_mygrid[*][1] and c_mygrid[*][8] should
|
|
||||||
# match the values in dump_b: 108.173 3.21778 0.712238 7.06634 1.04273
|
|
||||||
|
|
||||||
# Initialize simulation
|
# Initialize simulation
|
||||||
|
|
||||||
@ -58,6 +55,7 @@ pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} &
|
|||||||
quadraticflag ${quad} switchflag ${switch}
|
quadraticflag ${quad} switchflag ${switch}
|
||||||
pair_coeff * * Al
|
pair_coeff * * Al
|
||||||
|
|
||||||
|
thermo_style custom step temp epair emol etotal press
|
||||||
neighbor 0.0 nsq
|
neighbor 0.0 nsq
|
||||||
|
|
||||||
run 0
|
run 10
|
||||||
|
|||||||
@ -68,8 +68,8 @@ void PairSNAGrid::init_style()
|
|||||||
snaptr = new SNA(lmp, rfac0, twojmax,
|
snaptr = new SNA(lmp, rfac0, twojmax,
|
||||||
rmin0, switchflag, bzeroflag,
|
rmin0, switchflag, bzeroflag,
|
||||||
chemflag, bnormflag, wselfallflag, nelements);
|
chemflag, bnormflag, wselfallflag, nelements);
|
||||||
ndesc = ndesc_base + snaptr->ncoeff;
|
ncoeff = snaptr->ncoeff;
|
||||||
printf("ndesc = %d\n", ndesc);
|
ndesc = ndesc_base + ncoeff;
|
||||||
snaptr->init();
|
snaptr->init();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -85,6 +85,7 @@ void PairSNAGrid::init_list(int /*id*/, NeighList *ptr)
|
|||||||
|
|
||||||
void PairSNAGrid::compute(int eflag, int vflag)
|
void PairSNAGrid::compute(int eflag, int vflag)
|
||||||
{
|
{
|
||||||
|
ev_init(eflag,vflag);
|
||||||
|
|
||||||
// compute sna for each gridpoint
|
// compute sna for each gridpoint
|
||||||
|
|
||||||
@ -165,6 +166,8 @@ void PairSNAGrid::compute(int eflag, int vflag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vflag_fdotr) virial_fdotr_compute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -231,14 +234,11 @@ void PairSNAGrid::settings(int narg, char ** arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("settings cutmax = %g \n",cutmax);
|
|
||||||
|
|
||||||
// process optional args
|
// process optional args
|
||||||
|
|
||||||
int iarg = nargmin;
|
int iarg = nargmin;
|
||||||
|
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
printf("%d %d %d %s\n",iarg,narg,nargbase,arg[iarg]);
|
|
||||||
if (strcmp(arg[iarg],"rmin0") == 0) {
|
if (strcmp(arg[iarg],"rmin0") == 0) {
|
||||||
if (iarg+2 > narg)
|
if (iarg+2 > narg)
|
||||||
error->all(FLERR,"Illegal pair sna/grid command");
|
error->all(FLERR,"Illegal pair sna/grid command");
|
||||||
|
|||||||
@ -60,18 +60,11 @@ PairGrid::~PairGrid()
|
|||||||
|
|
||||||
void PairGrid::setup()
|
void PairGrid::setup()
|
||||||
{
|
{
|
||||||
printf("Inside PairGrid::setup()\n");
|
deallocate_grid();
|
||||||
printf("Hello, world! C\n");
|
|
||||||
// deallocate_grid();
|
|
||||||
printf("Hello, world! D\n");
|
|
||||||
set_grid_global();
|
set_grid_global();
|
||||||
printf("Hello, world! E\n");
|
|
||||||
set_grid_local();
|
set_grid_local();
|
||||||
printf("Hello, world! F\n");
|
|
||||||
allocate_grid();
|
allocate_grid();
|
||||||
printf("Hello, world! G\n");
|
assign_coords();
|
||||||
// assign_coords();
|
|
||||||
printf("Hello, world! H\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -95,7 +88,6 @@ void PairGrid::allocate_grid()
|
|||||||
{
|
{
|
||||||
if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) {
|
if (nxlo <= nxhi && nylo <= nyhi && nzlo <= nzhi) {
|
||||||
gridlocal_allocated = 1;
|
gridlocal_allocated = 1;
|
||||||
printf("ngridlocal = %d ndesc = %d\n",ngridlocal, ndesc);
|
|
||||||
memory->create4d_offset(gridlocal,ndesc,nzlo,nzhi,nylo,nyhi,
|
memory->create4d_offset(gridlocal,ndesc,nzlo,nzhi,nylo,nyhi,
|
||||||
nxlo,nxhi,"pair/grid:gridlocal");
|
nxlo,nxhi,"pair/grid:gridlocal");
|
||||||
memory->create(alocal, ngridlocal, ndesc, "pair/grid:alocal");
|
memory->create(alocal, ngridlocal, ndesc, "pair/grid:alocal");
|
||||||
@ -209,7 +201,6 @@ void PairGrid::set_grid_local()
|
|||||||
|
|
||||||
void PairGrid::assign_coords()
|
void PairGrid::assign_coords()
|
||||||
{
|
{
|
||||||
printf("nxhi/lo = %d %d nyhi/lo = %d %d nzhi/lo = %d %d\n",nxlo,nxhi,nylo,nyhi,nzlo,nzhi);
|
|
||||||
int igrid = 0;
|
int igrid = 0;
|
||||||
for (int iz = nzlo; iz <= nzhi; iz++)
|
for (int iz = nzlo; iz <= nzhi; iz++)
|
||||||
for (int iy = nylo; iy <= nyhi; iy++)
|
for (int iy = nylo; iy <= nyhi; iy++)
|
||||||
@ -273,7 +264,6 @@ void PairGrid::allocate()
|
|||||||
|
|
||||||
memory->create(cutsq,n+1,n+1,"pair:cutsq");
|
memory->create(cutsq,n+1,n+1,"pair:cutsq");
|
||||||
map = new int[n+1];
|
map = new int[n+1];
|
||||||
printf("Allocated!\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -318,10 +308,7 @@ void PairGrid::coeff(int narg, char **arg)
|
|||||||
|
|
||||||
double PairGrid::init_one(int i, int j)
|
double PairGrid::init_one(int i, int j)
|
||||||
{
|
{
|
||||||
printf("Inside PairGrid::init_one()\n");
|
|
||||||
printf("i = %d j = %d setflag = %d\n", i, j, setflag[i][j]);
|
|
||||||
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
|
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
|
||||||
printf("PairGrid cutmax = %g\n",cutmax);
|
|
||||||
return cutmax;
|
return cutmax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,8 +99,6 @@ void Verlet::setup(int flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Hello, world! A\n");
|
|
||||||
|
|
||||||
if (lmp->kokkos)
|
if (lmp->kokkos)
|
||||||
error->all(FLERR,"KOKKOS package requires run_style verlet/kk");
|
error->all(FLERR,"KOKKOS package requires run_style verlet/kk");
|
||||||
|
|
||||||
@ -128,8 +126,6 @@ void Verlet::setup(int flag)
|
|||||||
modify->setup_post_neighbor();
|
modify->setup_post_neighbor();
|
||||||
neighbor->ncalls = 0;
|
neighbor->ncalls = 0;
|
||||||
|
|
||||||
printf("Hello, world! B\n");
|
|
||||||
|
|
||||||
// compute all forces
|
// compute all forces
|
||||||
|
|
||||||
force->setup();
|
force->setup();
|
||||||
@ -137,8 +133,6 @@ void Verlet::setup(int flag)
|
|||||||
force_clear();
|
force_clear();
|
||||||
modify->setup_pre_force(vflag);
|
modify->setup_pre_force(vflag);
|
||||||
|
|
||||||
printf("Hello, world!\n");
|
|
||||||
|
|
||||||
if (pair_compute_flag) force->pair->compute(eflag,vflag);
|
if (pair_compute_flag) force->pair->compute(eflag,vflag);
|
||||||
else if (force->pair) force->pair->compute_dummy(eflag,vflag);
|
else if (force->pair) force->pair->compute_dummy(eflag,vflag);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user