yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #24661
[Question #694628]: How do I change the Oedometric compression test to tract particle orientation?
New question #694628 on Yade:
https://answers.launchpad.net/yade/+question/694628
I've been trying to adjust the open source (https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/03-oedometric-test.py) test to track Cartesian coordinates of each particle during a uniaxial compression test.
I have already been using a .py program in Yade that simply tracks the Cartesian coordinates of a generated particle cloud that falls into a volume element. What I have been struggling with was implementing the tracking portion of the code I am comfortable with, into the "03-oedometric-test.py" linked above.
The "03-oedometric-test.py" program collects different data than what I want and I have not been successful using the following lines that I see fit:
{
def myaddData():
if (O.iter%8==0):
# open file
fil=open("timeStep."+str(O.iter),"a+")
fil.write ('id \t x \t y \t z \t vz \t radius \t force \n')
for b in O.bodies:
if (type(b.shape)==Sphere):
number,rad=b.id,b.shape.radius
x,y,z=b.state.pos[0],b.state.pos[1],b.state.pos[2]
veloc,force=b.state.vel[2],O.forces.f(b.id)
fil.write("{:d}\t{:.3g}\t{:.3g}\t{:.3g}\t{:.3g}\t{:.3g}\t{}\n".format(number,x,y,z,veloc,rad,force)) # ( .format = % )
}
Using the code above, I've been mainly thinking how I need to replace the following code seen in the linked program:
{
def addPlotData():
if not isinstance(O.bodies[-1].shape,Wall):
plot.addData(); return
Fz=O.forces.f(plate.id)[2]
plot.addData(Fz=Fz,w=plate.state.pos[2]-plate.state.refPos[2],unbalanced=unbalancedForce(),i=O.iter)
# besides unbalanced force evolution, also plot the displacement-force diagram
plot.plots={'i':('unbalanced',),'w':('Fz',)}
plot.plot()
}
I'm generally struggling on the how to add/remove the necessary lines of code to collect the Cartesian coordinates within the "03-oedometric-test.py" program while still conducting the uniaxial compression test.
Any suggestions?
--
You received this question notification because your team yade-users is
an answer contact for Yade.