Dear LAMMPS users,
As I commented in previous posts, I am analysing the defect formation during collision cascades in bcc Fe with the compute cna/atom.
If my simulation box is large, most cna calculations will be done for atoms that have not been displaced, eg those that are at their lattice site, far from the cascade zone. Since the cna calculation is costly, I would like to restrict it only to atoms that have a structure different than bcc (3), ie those that are being displaced.
To do this, I am trying to define a dynamic group that only includes atoms with cna != 3 such that cna calculations will only be performed on this dynamic group, which contains much less atoms. However, this implies some redundant problem that I am not able to solve. Here is what I have done and where I am stuck.
compute cnatom all cna/atom 3.45
compute avecna all reduce ave c_cnatom
thermo_style custom step temp c_avecna
run 0
variable cnatom atom “c_cnatom != 3”
group groupcna dynamic all var cnatom every 1
This way, I am able to define a dynamic group containing particles with cna !=3. However, to do this, I must use a compute all cna/atom. This means that each time the dynamic group is updated, the calculation of cna will be performed for all atoms, which is costly.
The solution to this would be to do compute dynamic_group cna/atom. However, I cannot use compute dynamic_group cna/atom at the beginning since the dynamic group is defined after with variable cnatom atom “c_cnatom != 3”.
Like a dog chasing its tail…
Do you think there is a solution to this?
With best regards,
Christophe