git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11874 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-05-01 21:10:56 +00:00
parent 7c8c468fbb
commit c8fce1f525
6 changed files with 38 additions and 18 deletions

View File

@ -327,16 +327,24 @@ void FixEfield::post_force(int vflag)
modify->clearstep_compute();
if (xstyle == EQUAL) ex = qe2f * input->variable->compute_equal(xvar);
else if (xstyle == ATOM && efield)
input->variable->compute_atom(xvar,igroup,&efield[0][0],3,0);
else if (xstyle == ATOM) {
if (efield) input->variable->compute_atom(xvar,igroup,&efield[0][0],3,0);
else input->variable->compute_atom(xvar,igroup,NULL,3,0);
}
if (ystyle == EQUAL) ey = qe2f * input->variable->compute_equal(yvar);
else if (ystyle == ATOM && efield)
input->variable->compute_atom(yvar,igroup,&efield[0][1],3,0);
else if (ystyle == ATOM) {
if (efield) input->variable->compute_atom(yvar,igroup,&efield[0][1],3,0);
else input->variable->compute_atom(yvar,igroup,NULL,3,0);
}
if (zstyle == EQUAL) ez = qe2f * input->variable->compute_equal(zvar);
else if (zstyle == ATOM && efield)
input->variable->compute_atom(zvar,igroup,&efield[0][2],3,0);
if (estyle == ATOM && efield)
input->variable->compute_atom(evar,igroup,&efield[0][3],4,0);
else if (zstyle == ATOM) {
if (efield) input->variable->compute_atom(zvar,igroup,&efield[0][2],3,0);
else input->variable->compute_atom(zvar,igroup,NULL,3,0);
}
if (estyle == ATOM) {
if (efield) input->variable->compute_atom(evar,igroup,&efield[0][3],4,0);
else input->variable->compute_atom(evar,igroup,NULL,4,0);
}
modify->addstep_compute(update->ntimestep + 1);

View File

@ -327,9 +327,9 @@ void ComputeAtomMolecule::compute_one(int m)
maxatom = atom->nmax;
memory->destroy(scratch);
memory->create(scratch,maxatom,"atom/molecule:scratch");
peratom = scratch;
}
peratom = scratch;
input->variable->compute_atom(vidx,igroup,peratom,1,0);
nstride = 1;
}

View File

@ -355,8 +355,10 @@ void FixAveAtom::end_of_step()
// evaluate atom-style variable
// final argument = 1 sums result to array
} else if (which[m] == VARIABLE && array)
input->variable->compute_atom(n,igroup,&array[0][m],nvalues,1);
} else if (which[m] == VARIABLE) {
if (array) input->variable->compute_atom(n,igroup,&array[0][m],nvalues,1);
else input->variable->compute_atom(n,igroup,NULL,nvalues,1);
}
}
// done if irepeat < nrepeat

View File

@ -464,6 +464,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
bin_list = NULL;
vector = NULL;
maxatom = 0;
if (ave == WINDOW) {
memory->create(stats_list,nwindow,4,"histo:stats_list");
memory->create(bin_list,nwindow,nbins,"ave/histo:bin_list");

View File

@ -468,7 +468,10 @@ void FixStoreState::end_of_step()
// evaluate atom-style variable
} else if (which[m] == VARIABLE)
input->variable->compute_atom(n,igroup,&values[0][m],nvalues,0);
if (values)
input->variable->compute_atom(n,igroup,&values[0][m],nvalues,0);
else
input->variable->compute_atom(n,igroup,NULL,nvalues,0);
}
}

View File

@ -463,14 +463,20 @@ void Velocity::set(int narg, char **arg)
} else {
if (xstyle == EQUAL) vx = input->variable->compute_equal(xvar);
else if (xstyle == ATOM && vfield)
input->variable->compute_atom(xvar,igroup,&vfield[0][0],3,0);
else if (xstyle == ATOM) {
if (vfield) input->variable->compute_atom(xvar,igroup,&vfield[0][0],3,0);
else input->variable->compute_atom(xvar,igroup,NULL,3,0);
}
if (ystyle == EQUAL) vy = input->variable->compute_equal(yvar);
else if (ystyle == ATOM && vfield)
input->variable->compute_atom(yvar,igroup,&vfield[0][1],3,0);
else if (ystyle == ATOM) {
if (vfield) input->variable->compute_atom(yvar,igroup,&vfield[0][1],3,0);
else input->variable->compute_atom(yvar,igroup,NULL,3,0);
}
if (zstyle == EQUAL) vz = input->variable->compute_equal(zvar);
else if (zstyle == ATOM && vfield)
input->variable->compute_atom(zvar,igroup,&vfield[0][2],3,0);
else if (zstyle == ATOM) {
if (vfield) input->variable->compute_atom(zvar,igroup,&vfield[0][2],3,0);
else input->variable->compute_atom(zvar,igroup,NULL,3,0);
}
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {