← Back to team overview

yade-dev team mailing list archive

Re: Another python software

 

Thanks, Vaclav for this pointing out.  In this case, I'd like to call PeriodicPythonRunner in my .cpp file.  But the function/command to give as input to PeriodicPython runner would have to be in python, e.g. 'AddPlotData'.   Could you tell me how to do that please?

PeriodicPythonRunner(virtPeriod=3e-5/strainRateTension,realLim=5,command='addPlotData()',label='plotDataCollector'),

Also, since I want to use my CvxOpt when 'required' and not governed by time, what do I give as input to virtPeriod?


Yours,

Boon


> From: eudoxos@xxxxxxxx
> To: yade-dev@xxxxxxxxxxxxxxxxxxx
> Date: Thu, 25 Mar 2010 22:52:59 +0100
> Subject: Re: [Yade-dev] Another python software
> 
> 
> > Although the FORTRAN code/software/library is my first choice, I am
> > also planning to try this python opensource code:
> > 
> > http://abel.ee.ucla.edu/cvxopt/examples/other/embed_cvxopt.html
> > 
> > There are examples how to link python to C.  But how do I do it for
> > YADE?
> 
> The simplest is to install python-cvxopt package and use it from your
> python scripts.
> 
> Calling python code from c++ is (in yade's context) discouraged, as you
> want to have only computationally demanding parts in c++, where calling
> python would harm performance (except for various hooks, which are
> called only rarely). There are still several options:
> 
> 1. use PeriodicPythonRunner engine to call any python function you
> define, which will do what you need in pure python.
> 
> 2. use pure python/c API (whic his shown in the example you referenced)
> or boost::python to run python code. Have a look at PeriodicPythonRunner
> how it does that for simple case, where you don't need to pass c++
> objects to the function called.
> 
> HTH, Vaclav
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

Follow ups

References