Hi,
I am trying to implement a nested loop in the following manner.
label loop
variable a loop 10
#variable level equal 200
label loop
variable b loop 200
variable tar_loading equal ${sigma_3}*${sample_width}*${sample_width} + 0.5*$b*${sample_width}*${sample_width}
# APPLING LOADING
fix_modify twall_servo servo/target_val -${tar_loading}
run ${load_unload_step}
next b
jump SELF loop
label loop
variable c loop 180
variable tar_unloading equal ${sigma_1_max}*${sample_width}*${sample_width} - 0.5*$c*${sample_width}*${sample_width}
# APPLING UNLOADING
fix_modify twall_servo servo/target_val -${tar_unloading}
run ${load_unload_step}
next c
jump SELF loop
run 20*${load_unload_step}
# RELAX SAMPLE
run ${relax_step}
next a
jump SELF loop
But I am getting the following error after unpacking of "tar_loading".
ERROR: Illegal variable command (/build/liggghts-YO7u74/liggghts-3.8.0+repack1/src/variable.cpp:383)
Please let me know what am I missing?
Thanks in advance.
mschramm | Wed, 04/07/2021 - 03:00
labels must be unique
Hello,
I haven't tried to see if it fixes all of your problems, but make sure each of your labels have unique names.
rsharma | Wed, 04/07/2021 - 07:28
Hi,
Hi,
I gave unique labels for each loop, still I am getting the same error.
mschramm | Wed, 04/07/2021 - 20:06
space in variable command
Hello,
You have spaces in your variable command ("+")
Try changing
variable tar_loading equal ${sigma_3}*${sample_width}*${sample_width} + 0.5*$b*${sample_width}*${sample_width}
to
variable tar_loading equal ${sigma_3}*${sample_width}*${sample_width}+0.5*$b*${sample_width}*${sample_width}
rsharma | Thu, 04/08/2021 - 07:40
Thank you Matthew for sorting
Thank you Matthew for sorting this out.