← Back to team overview

yade-users team mailing list archive

Re: [Question #688060]: Extracting micro variables from Triaxial test

 

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

Description changed to:
Hi everyone,

I am using Ubuntu 18.04, and Yade 2019-08-08.git-775ae74
I use the Triaxial code by Bruno Chareyre [1] 
[1] https://gitlab.com/yade-dev/trunk/blob/master/examples/triax-tutorial/script-session1.py

My goal is to get micro variables from Triaxial test and save them in a
text file for the whole specimen (for all contacts). To do so, I just
added the following codes at the end of [1] and made no changes:

# the fabric tensor
utils.fabricTensor()

# inter-particle forces
for i in O.interactions:
   fn = i.phys.normalForce
   fs = i.phys.shearForce

# branch vectors, and contact normals
for i in O.interactions:
   normal = i.geom.normal
   b1,b2 = [O.bodies[id] for id in (i.id1,i.id2)]
   p1,p2 = [b.state.pos for b in (b1,b2)]
   branch = p2 - p1
# Save Data
from pprint import pprint
plot.reset()
plot.addData(fn,fs,normal,brach)
pprint(plot.data)
plot.saveDataTxt('/tmp/MicrodataFile.txt.tar.gz',vars=('fn','fs','normal','branch'))

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

And the output I get is as follows:

ehsan@ehsan:~/Desktop$ /home/ehsan/yade/install/bin/yade-2019-08-08.git-775ae74  netmicro.py
Welcome to Yade 2019-08-08.git-775ae74 
Using python version: 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0]
TCP python prompt on localhost:9000, auth cookie `sdsuay'
XMLRPC info provider on http://localhost:21000
Running script netmicro.py
The constructor with a shareWidget is deprecated, use the regular contructor instead.
 Friction:  28.5  porosity: 1.0
 Friction:  27.075  porosity: 0.908936796623662
 Friction:  25.721249999999998  porosity: 0.8342924618140075
 Friction:  24.435187499999998  porosity: 0.6986014608404307
.
.
.
 Friction:  10.216848788643448  porosity: 0.4341421461248899
 Friction:  9.706006349211275  porosity: 0.4316281950137172
###    Compacted state saved      ###
/home/ehsan/yade/install/lib/x86_64-linux-gnu/yade-2019-08-08.git-775ae74/py/yade/plot.py:444: MatplotlibDeprecationWarning: 
The 'verts' kwarg was deprecated in Matplotlib 3.0 and will be removed in 3.2. Use 'marker' instead.
  scatter=pylab.scatter(scatterPt[0] if not math.isnan(scatterPt[0]) else 0,scatterPt[1] if not math.isnan(scatterPt[1]) else 0,s=scatterSize,color=line.get_color(),**scatterMarkerKw)
Traceback (most recent call last):
  File "/home/ehsan/yade/install/bin/yade-2019-08-08.git-775ae74", line 336, in runScript
    execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 82, in execfile
    exec_(code, myglobals, mylocals)
  File "netmicro.py", line 248, in <module>
    plot.addData(fn,fs,normal,brach)
NameError: name 'brach' is not defined
[[ ^L clears screen, ^U kills line. F12 controller, F11 3D view (press "h" in 3D view for help), F10 both, F9 generator, F8 plot. ]]

In [1]:


Thank you for your help,
Ehsan

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