Question #696150 on Yade changed:
https://answers.launchpad.net/yade/+question/696150

    Status: Open => Answered

Karol Brzezinski proposed the following answer:
Hi,

here you have the two approaches compared:

####
centers = []
for x in range(3):
        for y in range(3):
                for z in range(3):
                        centers.append((x,y,z))
                        
O.bodies.append([
        sphere(center=center,radius=1,) for center in centers
])

sp = SpherePack()
sp.fromSimulation()


TW=TesselationWrapper()
TW.triangulate()        
TW.computeVolumes()     

sp.save('sp0.txt')
TW.setState(0)  
        
shiftBodies(list(range(18,27,1)),(0,0,0.5)) # move one layer of spheres without 
engines (I am just being lazy)

sp.fromSimulation()
sp.save('sp1.txt')
TW.defToVtkFromPositions( 'sp0.txt','sp1.txt' , 'strain_from_files.vtk')

TW.setState(1)  
TW.defToVtk("strain_from_memory.vtk")

############

Cheers,
Karol

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to