← Back to team overview

yade-dev team mailing list archive

Re: Interesting python usage

 

Thanks for answering me on a public holiday.  The reason is, I need the Optimisation library, to be used in the Interaction Geometry functor.  I want to give input and take output from the library to do calculations.  Unfortunately the library is in python.  

 

I found one C and  one C++ libraries, but I have compatibility problems.  One is (NAG), they require gcc-3.2.3 and RedHat for Intel64bit.  The other one (CVXOPT++) has the shared library problem.  I have tried fixing them both seriously before giving them up.  Going for FORTRAN or Matlab would be tougher than python.
 

Since I want to use the python library to perform calculations for my Interaction functor, I will have to connect it to C.  If I can run periodicpythonrunner from C, for my purpose, please explain more to me.  If not, the problem that the python script file, which contains my function, cannot detect yade's syntax/functions like O.bodies[1],etc .  Please help me.     

 

 

Yours,

 

Boon

 
> From: eudoxos@xxxxxxxx
> To: yade-dev@xxxxxxxxxxxxxxxxxxx
> Date: Sat, 3 Apr 2010 00:08:43 +0200
> Subject: Re: [Yade-dev] Interesting python usage
> 
> > Why calling PyRun_SimpleString("print O.bodies[1].state.pos") in my yade C file works, but not calling it through a function defined in another script file:
> "doesn't work" is not error message. Be more precise.
> 
> I still don't understand why you don't use PeriodicPythonRunner with
> commad="execfile('abc.py')"; you could also import your file as module
> (see help for sys.path) and run function from there as
> command="yourmodule.function()". No need to go through C, PPyRunner does
> that for you already.
> 
> 
> 
> _______________________________________________
> 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: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

Follow ups

References