compute per-atom as global and multiple run

Dear Community, is it possible to access globally to the computed
per-atom variables? In my case I would like to compute the
cluster/atom regularly, then obtaining the maximum, ie taking the
cluster that has the biggest index (alternativly just want the number
of clusters found) and use this value in a loop in the input scrip as
break condition. So for example if i got two clusters than the
simulation stops.

Also is there a huge performance loss with the setup

run 1000
run 1000
... repeated 50 times ...
run 1000

instead of

run 50000

?

thanks,
David

You can access the per-atom computes in
variables or with other fixes and computes,
e.g. compute reduce. You'll have to figure out
if you can write an atom-style or equal-style
variable that calculates what you want
for a break condition. You could then use
it in a loop to "jump" out of the loop.

It is not inefficient to do 50 1000-step runs
especially if you use the "pre no" and "post no"
options on the run command to turn off
pre- and post- output and computation in the loop.

You can easily experiment with that by timing
a looip versus non-loop yourself.

Steve

Dear Steve, thanks your reply, I would like to do what you say:

compute 1 all cluster/atom 4.0
compute 2 all reduce max c_1
variable maxclu equal c_2
run 100
print ${maxclu}

gives ERROR: Compute used in variable between runs is not current
(variable.cpp:771)
what am I doing wrong?

thanks
David

do run 0 before variable command

That should work and the variable doc page explains
why. You have to use the compute during your run
so that it is current when the run is over. Doing a "run 0"
is one way to force that to happen.

Steve

thanks the replies, but still having the same error. To be more clear
this is the whole input:

units metal
atom_style atomic
region bbox block 0 20 0 20 0 20 units box
create_box 1 bbox
region wire cylinder z 10 10 6 0 10 units box
lattice fcc 4.08
create_atoms 1 region wire
#mass 1 197.0
pair_style eam/alloy
pair_coeff * * Au.lammps.eam Au

fix 1 all nvt temp 1.0 30.0 100.0

dump 1 all xyz 10 ani.xyz

compute 1 all cluster/atom 4.0
compute 2 all reduce max c_1
run 0
variable maxclu equal c_2
run 100
print ${maxclu}

thanks
David

thanks the replies, but still having the same error. To be more clear
this is the whole input:

you still need to trigger the compute.
this can be done to make c_2 an output
of a custom thermo style.

axel.