← Back to team overview

yade-users team mailing list archive

Re: Scripting

 

Thanks Vaclav,

I will try your suggestions as soon as I get back to Berkeley next
week. In fact, manipulating the data in Matlab was an idea related to
the coupling we are doing with Bruno, but Python could be indeed a
better choice for various reasons.

I have found in internet examples of XML parsing by Python ... maybe
this will be sufficient for me to manipulate the XML files, (even if
it is not at run time) and create new simulations. We will see ...

ciao

Andrea


On 7/20/07, Václav Šmilauer <eudoxos@xxxxxxxx> wrote:
> 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
> Yade-users@xxxxxxxxxxxxxxxx
> https://lists.berlios.de/mailman/listinfo/yade-users
>


-- 
------------------------------------------
Andrea Cortis, PhD

Scientist

Earth Sciences Division, 90-1116
Lawrence Berkeley National Laboratory
1 Cyclotron Road Berkeley,
CA  94720 USA
phone: 1-510-495-2507
fax: 1-510-486-5686
email: acortis@xxxxxxx
http://esd.lbl.gov/ESD_staff/cortis/index.html
------------------------------------------
_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-users



References