Hi,
I'm trying to use a compute in a variable. I know that a compute doesnt mean that it is calculated, so I want to use fix ave/time for calculation.
compute A thirdgroup reduce max y
fix currentstatus all ave/time 100 1 100 c_A
run 1
variable B equal c_A
print '$B'
this doesnt work. Just when I use the thermo_style it works:
compute A thirdgroup reduce max y
thermo_style custom step atoms ke vol dt etotal c_A
run 1
variable B equal c_A
print '$B'
why doesn't it work using fix ave/time?? Because the compute is calculated but the error with compute is not current occurs
regards
Joshua
ckloss | Fri, 04/03/2015 - 10:39
Hi Joshua,
Hi Joshua,
variables in LIGGGHTS can be annoying at times... A compute is only evaluated if invoked by another command. Fix ave/time will do this at step 100, so you can't use the compute's values before (just referring to the compute in the variable will not invoke evaluation). Adding it to "thermo" will invoke evaluation, so the compute is current when you want to print it
Cheers
Christoph
JoshuaP | Mon, 04/20/2015 - 11:20
Hi Christoph,
thanks for your answer. But is there a way to evaluate a compute just once, without using thermo?
kind regards
Joshua
ckloss | Mon, 05/11/2015 - 12:55
>>But is there a way to
>>But is there a way to evaluate a compute just once, without using thermo?
Computes are always evaluated when they are invoked. What you could do is run a few steps, then change the thrmo_style
Christoph