Dear LAMMPS users,
1) Struggling with the following problem - I want to introduce a new
per atom attribute in my fix, this attribute might be the same for
some atoms so I can find a correspondence between some special atoms.
I also should mention that during my simulation atoms are added and
deleted.
Thus, in my fix I implemented necessary methods:
//in constructor
create_attribute = 1;
grow_arrays(atom->nmax);
atom->add_callback(0);
Added methods:
void grow_arrays(int nmax) { myArray.resize(nmax, 0); } // myArray is
std::vector<int>
void copy_arrays(int i, int j, int delflag) {myArray[j] = myArray[i];}
void set_arrays(int indexOfCreatedAtom) { myArray[i] = 0; }
And it works for a while, than for some reason my mapping becomes
invalid. It means that the one of the atoms has wrong attribute (it
should have another). it is difficult to track back where it happens
because of sorting. So it happens only if sorting is on (I tried turn
it off using atom_modify) and on more than one processors (for one it
works).
I wonder - did I miss something? Shall I implement also some other
methods (for sending info to other processors or something)?
2) Another question - are bond indices sort invariant? I mean if I
read a bond with index K, does it mean that it will be K in bondlist
all the execution time? As far as I see it is created only once in
Neighbor::bond_all and never rewritten.