yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #05048
Re: [Branch ~yade-dev/yade/trunk] Rev 2314: making TriaxialStressController more python friendly.
-
To:
yade-dev@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Mon, 5 Jul 2010 12:02:43 +0200
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
-
In-reply-to:
<4C319D88.9000802@hmg.inpg.fr>
Bruno Chareyre said: (by the date of Mon, 05 Jul 2010 10:53:28 +0200)
> Try r2318. :)
Thanks, but how can I read strain? Python gives following error:
return triaxialStressController.strain[1]
TypeError: No to_python (by-value) converter found for C++ type:
double [3]
Did I miss something?
Currently to get this to work I must
change line 38 in TriaxialStressController.hpp from his:
Real strain [3];
into this:
Vector3r strain;
And then the attached script works very good.
--
Janek Kozicki http://janek.kozicki.pl/ |
#!/usr/local/bin/yade-trunk -j3
# -*- coding: utf-8 -*-
# -*- encoding=utf-8 -*-
TriaxialTest(numberOfGrains=200).load()
O.engines += [PeriodicPythonRunner(iterPeriod=10,command='plot1()')]
triaxialStressController=O.engines[5]
def sigma_1():
return triaxialStressController.stress(triaxialStressController.wall_top_id)
def epsilon_1():
return triaxialStressController.strain[1]
from yade import qt
qt.View()
qt.Controller()
# plot some results
from math import *
from yade import plot
plot.plots={'epsilon_1':'sigma_1'}
def plot1():
plot.addData(sigma_1=sigma_1(),
epsilon_1=epsilon_1())
O.run(10000,True)
plot.plot()
Follow ups
References