I WANT TO SHARE SNIPPET OF MY CODE :
fish def applybonds(pb_kn,pb_ks,pb_ten,pb_coh,pb_rmul)
cluster = cluster_head
loop while cluster # null
loop i(1,bnumber-1)
bp = memory(cluster+i+2)
bp_next=memory(cluster+i+3)
local clist = ball.contactmap(bp)
section
loop foreach local con clist
ok=0
if contact.end1(con) = bp_next
ok=1
else if contact.end2(con) = bp_next
ok=1
endif
if ok=1
local arg = array.create(1,2)
arg(1,1) = ‘gap’
arg(1,2) = 0.0
contact.method(con,“bond”,arg)
contact.prop(con,“pb_kn”)=pb_kn
contact.prop(con,“pb_ks”)=pb_ks
contact.prop(con,“pb_ten”)=pb_ten
contact.prop(con,“pb_coh”)=pb_coh
contact.prop(con,“pb_rmul”)=pb_rmul
exit section
endif
endloop
endsection
endloop
cluster = memory(cluster)
endloop
end
AFTER DEFINING THE applybonds i try to assign value of bonds, for this i use this code:
[pb_kn=1e12]
[pb_ks=1e12]
[pb_ten=1e8]
[pb_coh=1e6]
[pb_rmul=0.8]
[applybonds(pb_kn,pb_ks,pb_ten,pb_coh,pb_rmul)]
while running this second code i get this error massage:
Unrecognized word. You cannot create a new symbol except as part of a direct assignment.
Make certain the variable name is correct.
You can use the GLOBAL statement to explicitly declare a variable if you are certain it will be assigned a value before use.