add custom atom property refs to variable syntax

This commit is contained in:
Steve Plimpton
2023-11-22 22:40:58 -07:00
parent 33dcfb5390
commit 961cbfbe10
6 changed files with 268 additions and 69 deletions

View File

@ -2681,7 +2681,6 @@ int Atom::add_custom(const char *name, int flag, int cols)
ianame[index] = utils::strdup(name);
iarray = (int ***) memory->srealloc(iarray,niarray*sizeof(int **),"atom:iarray");
memory->create(iarray[index],nmax,cols,"atom:iarray");
icols = (int *) memory->srealloc(icols,niarray*sizeof(int),"atom:icols");
icols[index] = cols;
@ -2692,10 +2691,10 @@ int Atom::add_custom(const char *name, int flag, int cols)
daname[index] = utils::strdup(name);
darray = (double ***) memory->srealloc(darray,ndarray*sizeof(double **),"atom:darray");
memory->create(darray[index],nmax,cols,"atom:darray");
dcols = (int *) memory->srealloc(dcols,ndarray*sizeof(int),"atom:dcols");
dcols[index] = cols;
}
if (index < 0)
error->all(FLERR,"Invalid call to Atom::add_custom()");
return index;