tesselationWrapper.py 1.01 KB
Newer Older
1 2
#!/usr/bin/python
# -*- coding: utf-8 -*-
3
#2012 Bruno Chareyre <bruno.chareyre@grenoble-inp.fr>
4
"""Example usage of a TesselationWrapper object for getting microscale quantities."""
Bruno Chareyre's avatar
Bruno Chareyre committed
5
# See Catalano2014a for the definition of micro-strain
6
# (http://dx.doi.org/10.1002/nag.2198 or free-access at arxiv http://arxiv.org/pdf/1304.4895.pdf)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

tt=TriaxialTest()
tt.generate("test.yade")
O.load("test.yade")
O.run(100,True)
TW=TesselationWrapper()
TW.triangulate()	#compute regular Delaunay triangulation, don’t construct tesselation
TW.computeVolumes()	#will silently tesselate the packing, then compute volume of each Voronoi cell
TW.volume(10)		#get volume associated to sphere of id 10
TW.setState(0)		#store current positions internaly for later use as the "0" state
O.run(100,True)		#make particles move a little (let's hope they will!)
TW.setState(1)		#store current positions internaly in the "1" (deformed) state

#Now we can define strain by comparing states 0 and 1, and average them at the particles scale
TW.defToVtk("strain.vtk")