#============================================================* # test create sphere * #============================================================* system echo = off system verbose = false # set units #---------- units units scale name = mass uname = reducedMass value = 10000.0 solid create name = sp1 type = sphere radius = 0.4 center = [ 0.0 0.0 0.0 ] solid create name = sp2 type = sphere radius = 0.4 center = [ 2.0 0.0 0.0 ] solid create name = sp3 type = sphere radius = 0.4 center = [ 4.0 0.0 0.0 ] solid create name = sp4 type = sphere radius = 0.4 center = [ 6.0 0.0 0.0 ] solid create name = sp5 type = sphere radius = 0.4 center = [ 8.0 0.0 0.0 ] solid create name = sp6 type = sphere radius = 0.4 center = [ 10.0 0.0 0.0 ] solid create name = sp7 type = sphere radius = 0.4 center = [ 12.0 0.0 0.0 ] solid create name = sp8 type = sphere radius = 0.4 center = [ 14.0 0.0 0.0 ] solid create name = sp9 type = sphere radius = 0.4 center = [ 16.0 0.0 0.0 ] solid create name = sp10 type = sphere radius = 0.4 center = [ 22.0 0.0 0.0 ] # create bodies #-------------- body create name = ground type = ground body create name = sp1b type = static solid = sp1 #body create name = sp1b type = rigid solid = sp1 body create name = sp2b type = rigid solid = sp2 body create name = sp3b type = rigid solid = sp3 body create name = sp4b type = rigid solid = sp4 body create name = sp5b type = rigid solid = sp5 body create name = sp6b type = rigid solid = sp6 body create name = sp7b type = rigid solid = sp7 body create name = sp8b type = rigid solid = sp8 body create name = sp9b type = rigid solid = sp9 body create name = sp10b type = rigid solid = sp10 body sp2b damping = 0.01 body sp3b damping = 0.01 body sp4b damping = 0.01 body sp5b damping = 0.01 body sp6b damping = 0.01 body sp7b damping = 0.01 body sp8b damping = 0.01 body sp9b damping = 0.01 body sp10b damping = 0.01 #----- ground joint -----# joint create name = groundJnt type = ball solid = sp1 joint groundJnt color = [ 1 1 1 ] msize = 0.08 shading = color show = true joint groundJnt bodies = { ground sp1b } joint create name = groundJnt2 type = weld solid = sp10 joint groundJnt2 color = [ 1 1 1 ] msize = 0.08 shading = color show = true joint groundJnt2 bodies = { ground sp10b } # create a rigid simulation #-------------------------- simulation create name = rsim type = rigid # set solver #----------- simulation rsim solver = ode # add bodies #----------- simulation rsim add bodies = all simulation rsim add joints = all # add potential #-------------- solid sp1 define region = sp1Rgn use_center = true solid sp2 define region = sp2Rgn use_center = true body sp1b add potential = sp1Pot type = spring region = sp1Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 10.0 cutoff = 2.8 show = true body sp2b add potential = sp2Pot type = spring region = sp2Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 10.0 cutoff = 2.8 show = true simulation rsim add interaction = sp1Sp2Pot \ body1 = sp1b potential1 = sp1Pot \ body2 = sp2b potential2 = sp2Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp2 define region = sp2Rgn2 use_center = true solid sp3 define region = sp3Rgn use_center = true body sp2b add potential = sp2Pot2 type = spring region = sp2Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true body sp3b add potential = sp3Pot type = spring region = sp3Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true simulation rsim add interaction = sp2Sp3Pot \ body1 = sp2b potential1 = sp2Pot \ body2 = sp3b potential2 = sp3Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp3 define region = sp3Rgn2 use_center = true solid sp4 define region = sp4Rgn use_center = true body sp3b add potential = sp3Pot2 type = spring region = sp3Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 10.0 cutoff = 2.8 show = true body sp4b add potential = sp4Pot type = spring region = sp4Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 10.0 cutoff = 2.8 show = true simulation rsim add interaction = sp3Sp4Pot \ body1 = sp3b potential1 = sp3Pot \ body2 = sp4b potential2 = sp4Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp4 define region = sp4Rgn2 use_center = true solid sp5 define region = sp5Rgn use_center = true body sp4b add potential = sp4Pot2 type = spring region = sp4Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true body sp5b add potential = sp5Pot type = spring region = sp5Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true simulation rsim add interaction = sp4Sp5Pot \ body1 = sp4b potential1 = sp4Pot \ body2 = sp5b potential2 = sp5Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp5 define region = sp5Rgn2 use_center = true solid sp6 define region = sp6Rgn use_center = true body sp5b add potential = sp5Pot2 type = spring region = sp5Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true body sp6b add potential = sp6Pot type = spring region = sp6Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true simulation rsim add interaction = sp5Sp6Pot \ body1 = sp5b potential1 = sp5Pot \ body2 = sp6b potential2 = sp6Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp6 define region = sp6Rgn2 use_center = true solid sp7 define region = sp7Rgn use_center = true body sp6b add potential = sp6Pot2 type = spring region = sp6Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true body sp7b add potential = sp7Pot type = spring region = sp7Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true simulation rsim add interaction = sp6Sp7Pot \ body1 = sp6b potential1 = sp6Pot \ body2 = sp7b potential2 = sp7Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp7 define region = sp7Rgn2 use_center = true solid sp8 define region = sp8Rgn use_center = true body sp7b add potential = sp7Pot2 type = spring region = sp7Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true body sp8b add potential = sp8Pot type = spring region = sp8Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true simulation rsim add interaction = sp7Sp8Pot \ body1 = sp7b potential1 = sp7Pot \ body2 = sp8b potential2 = sp8Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp7 define region = sp7Rgn2 use_center = true solid sp8 define region = sp8Rgn use_center = true body sp7b add potential = sp7Pot2 type = spring region = sp7Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true body sp8b add potential = sp8Pot type = spring region = sp8Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true simulation rsim add interaction = sp7Sp8Pot \ body1 = sp7b potential1 = sp7Pot \ body2 = sp8b potential2 = sp8Pot \ time = { 0.0 1000.0 } #----------------------------------------------------- solid sp8 define region = sp8Rgn2 use_center = true solid sp9 define region = sp9Rgn use_center = true body sp8b add potential = sp8Pot2 type = spring region = sp8Rgn2 \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true body sp9b add potential = sp9Pot type = spring region = sp9Rgn \ geometry = points color = [ 0 1 0 ] \ force_const = 1.0 cutoff = 2.8 show = true simulation rsim add interaction = sp8Sp9Pot \ body1 = sp8b potential1 = sp8Pot \ body2 = sp9b potential2 = sp9Pot \ time = { 0.0 1000.0 } # add restraint #-------------- solid sp9 define region = sp9Rgn2 use_center = true solid sp10 define region = sp10Rgn use_center = true simulation rsim add restraint = res1 \ body1 = sp9b region1 = sp9Rgn2 \ body2 = sp10b region2 = sp10Rgn \ force_const = 20.0 distance = 0.99 \ time = { 0 1000 } # add forces #----------- force create name = force1 type = explicit point = [ 0 0 0 ] \ direction = [ 0 2 0 ] scale = 1.0 simulation rsim add force = force1 body = sp4b time = { 10 14.1 } #simulation rsim add force = force1 body = sp4b time = { 0 0.1 } force create name = rforce1 type = random explicit point = [ 0 0 0 ] \ sd = 0.1 mean = 0.0 scale = 1.0 #simulation rsim add force = rforce1 body = sp3b time = { 10 100.0 } # initialize simulation #---------------------- simulation rsim initialize simulation rsim time step = 0.005 #simulation rsim time step = 0.01 simulation state save_frequency = 10 simulation rsim momentum = on simulation rsim damping = on # write energy #------------- simulation rsim write energy = true file_name = rsim