Hi everyone,
I want to create a fix halt
that would trigger when 1st and 2nd biggest clusters in my system are > some N
. I can do this for just the 1st bigger cluster by
# Define clusters based on the proximity of the core atoms:
group coreatoms type 1 2 3
compute cluster coreatoms cluster/atom 1.5
# assigns each atom in the group an ID=cluster_ID
compute cc1 coreatoms chunk/atom c_cluster compress yes
# remove redundant cluster_ID-s
compute clustersize coreatoms property/chunk cc1 count
# count number of atoms in each chunk
variable maxclustersize equal max(c_clustersize)
...
fix halt_maxcl all halt 1000 v_maxclustersize > 500 error continue
I want something like
...
compute clustersize coreatoms property/chunk cc1 count
compute_modify clustersize sort decreasing
...
fix halt_maxcl2 all halt 1000 ((c_clustersize[1] > 500) && (c_clustersize[2] > 500)) error continue
but I did not find anything like this in compute_modify
or any mentions of sorting for property/chunk
computes.
Is there an easy way to do this?
How feasible is it (compared to e.g. implementing a custom bond_style
which I’ve done) to implement a custom function max2nd(c_ID)
to then do
variable cs1 equal max(c_clustersize)
variable cs2 equal max2nd(c_clustersize)
Or maybe I could somehow create a new group without the biggest cluster atoms and find its maximum cluster; Something like:
group coreatoms2 ((type 1 2 3) && (c_cluster != v_maxclustersize))
...
variable maxclustersize2 equal max(c_clustersize2)