model new model domain extent -10 10 ball create position (1.5,1.5) radius 0.5 group 'mainball' ball create position (1.5,0.5) radius 0.5 group 'ball1' ball create position (0.5,0.5) radius 0.5 group 'mainball' ball create position (0.5,1.5) radius 0.5 group 'ball2' wall create vertices (0.0,0.0) (2.0,0.0) group 'bottomwall' facet wall create vertices (0.0,2.0) (2.0,2.0) group 'topwall' facet wall create vertices (0.0,0.0) (0.0,2.0) group 'leftwall' facet wall create vertices (2.0,0.0) (2.0,2.0) group 'ball1' facet ; ball-ball contacts contact cmat default model linear type ball-ball property kn 8 rgap [math.sqrt(2) - 1] ; add rgap to create diagonal contact contact cmat add 1 model linear property kn 7 rgap [math.sqrt(2) - 1] ... ;add rgap to create diagonal contact range group 'mainball' matches 2 ;contact cmat add 2 model linear property kn 6 ... ;range group "ball1" matches 2 ;contact cmat add 2 model linear property kn 6 ... ; range group 'mainball' matches 1 group 'ball1' matches 1 ; ;contact cmat add 3 model linear property kn 5 ... ; range group 'mainball' matches 1 group 'ball2' matches 1 ; ;; ball-facet contacts ;contact cmat default model linear type ball-facet property kn 4 ; ;contact cmat add 4 model linear property kn 3 ... ; range group 'bottomwall' matches 1 ; ;contact cmat add 5 model linear property kn 2 ... ; range group 'topwall' matches 1 group 'mainball' matches 1 ; ;contact cmat add 6 model linear property kn 1 ... ; range group 'ball2' matches 1 contact type 'ball-facet' model clean all