← Back to team overview

yade-users team mailing list archive

Re: Scripting


Hi, (please don't reply to mails in different threads, threading is based on 
message IDs, not on subject)

 > I am Andrea and I am working with Bruno in Grenoble, on the coupling of
 > Yade with a commercial FEM code.
 > Bruno told me that you are working on some kind of scripting in Python,
 > and I was wondering if you were willing to share those thoughts. My idea
 > was to look for some kind of XML parser to translate a scene.xml into a
 > Matlab structure for the purpose of  postprocessing and/or parameters
 > changes. Is this what you had in mind?

The functionality is very limited as of now and there are 2 implmentations 
of those binding, that are however more or less orthogonal.

The chronologically first one is in extra/clump/pyade.py (example is at the 
very end) and it lest you access some body parameters (based on their ID) 
like position, velocity and some of the simulation. The parameters you can 
access are defined in extra/clump/pyade.cpp (that is the python module in c++).

The second one is in gui/cmd/yadeControl.cpp and wraps some parts of Omega 
(simulation), preprocessors and the GL display. It is much more flexible, 
since it uses already existing serialization to access all attributes. So in 
theory, once the wrapper is written, you could be able to traverse the data 
and process them arbitrarily. If you have recent trunk with python compiled, 
you can try this one out by running

  $ yade-trunk -N cmdGui -- -s examples/cmdGui1.py

You could also write a class deriving from IOFormatManager (handles XML and 
binary output now) that would output in Matlab-suitable format, but that is 
perhaps an overkill.

Maybe if you give me an example what data and in what format you want to see 
as output, I would be able to give more advice or implement missing bits in 
the python wrapper, that is quite easy (for me now). I could be on the IRC 
as well, but I may be away next week.

Regards, Vaclav
Yade-users mailing list

Follow ups