132
134
/* ---------------------------------------------------------------------- */
136
void AtomVecMeso::force_clear(int n, size_t nbytes)
138
memset(&de[n],0,nbytes);
139
memset(&drho[n],0,nbytes);
142
/* ---------------------------------------------------------------------- */
134
144
int AtomVecMeso::pack_comm_hybrid(int n, int *list, double *buf) {
135
145
//printf("in AtomVecMeso::pack_comm_hybrid\n");
936
946
/* ----------------------------------------------------------------------
947
assign an index to named atom property and return index
948
return -1 if name is unknown to this atom style
949
------------------------------------------------------------------------- */
951
int AtomVecMeso::property_atom(char *name)
953
if (strcmp(name,"rho") == 0) return 0;
954
if (strcmp(name,"drho") == 0) return 1;
955
if (strcmp(name,"e") == 0) return 2;
956
if (strcmp(name,"de") == 0) return 3;
957
if (strcmp(name,"cv") == 0) return 4;
961
/* ----------------------------------------------------------------------
962
pack per-atom data into buf for ComputePropertyAtom
963
index maps to data specific to this atom style
964
------------------------------------------------------------------------- */
966
void AtomVecMeso::pack_property_atom(int index, double *buf,
967
int nvalues, int groupbit)
969
int *mask = atom->mask;
970
int nlocal = atom->nlocal;
974
for (int i = 0; i < nlocal; i++) {
975
if (mask[i] & groupbit) buf[n] = rho[i];
979
} else if (index == 1) {
980
for (int i = 0; i < nlocal; i++) {
981
if (mask[i] & groupbit) buf[n] = drho[i];
985
} else if (index == 2) {
986
for (int i = 0; i < nlocal; i++) {
987
if (mask[i] & groupbit) buf[n] = e[i];
991
} else if (index == 3) {
992
for (int i = 0; i < nlocal; i++) {
993
if (mask[i] & groupbit) buf[n] = de[i];
997
} else if (index == 4) {
998
for (int i = 0; i < nlocal; i++) {
999
if (mask[i] & groupbit) buf[n] = cv[i];
1006
/* ----------------------------------------------------------------------
937
1007
return # of bytes of allocated memory
938
1008
------------------------------------------------------------------------- */