CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Python bindings and OpenFOAM-1.5-dev

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2009, 09:35
Default Python bindings and OpenFOAM-1.5-dev
  #1
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
Hi all,

Any news on the python bindings for the library (to the level of physics solvers) on the OpenFOAM-1.5-dev branch ?

It could be an awesome feature/enhancement for users and for teaching purpose regarding the readability and easiness of python.

Thanks
Have a nice day.
francois is online now   Reply With Quote

Old   February 5, 2010, 15:24
Default
  #2
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
up ...
Thanks
francois is online now   Reply With Quote

Old   February 5, 2010, 16:09
Default
  #3
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Quote:
Originally Posted by francois View Post
up ...
Thanks
What does this mean? Is this feature available? I am also very interested in this. Thanks.

Regards
bastil is offline   Reply With Quote

Old   February 6, 2010, 06:40
Default
  #4
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
Hrv Jasak has shown some examples/demonstrations where OpenFOAM libraries have been wrapped in SWIG. OF objects can then be loaded from a python shell or script. With ipython/scipy/numpy/OpenFOAMpy, you would have a very cool and powerful tool.

Since we haven't heard anything about it here no the forum, my guess is that it is still in the experimental stage.
egp is offline   Reply With Quote

Old   February 7, 2010, 04:40
Default
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
First, credit to Ivor who did a ton of work on this - much appreciated.

This is actually ready for release, but the delay is due to other related things that should go in. The biggest being, of course the Windows port, CMake and a set of new features.

I know the release of all the lovely new features is now disgracefully late (my fault), but (if it makes you feel better) this is now Priority #1 on my desk. I will keep you posted - python bindings are definitely ready.

If you wish to have a go, there is an experimental repository somewhere about...

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 7, 2010, 05:42
Default
  #6
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello Hrv,

A Good Morning to you! Nice to see you active on the forum again :-)!

Your last post on this thread has made me very curious.... does this imply, that a native Windows port of OpenFOAM-1.xx-dev is basically almost ready for use?

This would be very exciting news for a lot of people including me :-)!

As usual.... if you would like someone to test-ride the port, I would be glad to offer my help!

Have a nice Sunday!

Philippose
philippose is offline   Reply With Quote

Old   February 9, 2010, 10:32
Default
  #7
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
Thanks Hrv.

That's a excellent news.

Congratulations to you and Ivor for your awesome works !
Francois
francois is online now   Reply With Quote

Old   February 10, 2010, 16:51
Default
  #8
New Member
 
Niklas Mohr
Join Date: Feb 2010
Posts: 2
Rep Power: 0
Niklas2 is on a distinguished road
Quote:
Originally Posted by hjasak View Post
First, credit to Ivor who did a ton of work on this - much appreciated.
...
If you wish to have a go, there is an experimental repository somewhere about...

Hrv
Is the experimental repository about the python bindings or about the windows port?
I can't seem to find python bindings in any openfoam-extend branches (only pyfoam).
Can somebody help to find them "somewhere"?

Thanks
Niklas
Niklas2 is offline   Reply With Quote

Old   February 11, 2010, 18:48
Default
  #9
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Python. The Windows work is still restricted.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 13, 2010, 09:18
Default
  #10
New Member
 
Niklas Mohr
Join Date: Feb 2010
Posts: 2
Rep Power: 0
Niklas2 is on a distinguished road
I understand. The python work is so amazing that their download location is kept secret.
Maybe www.fenics.org is the better choice.

Greetingz
Niklas
Niklas2 is offline   Reply With Quote

Old   February 13, 2010, 12:56
Default
  #11
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Cocky boy... but mis-directed.

Yes, I think the python work is amazing and it will have an impact to my work similar to a rutting rhinoceros The work has been going on for more than 2 years now, and I have shown some of it at the Workshop in Milan.

Now, to problems: there is at least 4 people who need to claim credit for this work (including myself). Some of them work for companies which invest heavily into their FOAM capability and it is necessary to encourage them in the best possible way to release the results of their effort (in their own time and their own way). At the end of the day, these people are being paid real money to do this work.

Furthermore, this needs to be done Right: if the release is half-baked or not easy to use, people will just say "garbage" and never look at it again. I wouldn't want that to happen - it would be unfair to us all.

So, while I understand your eagerness and enthusiasm, please allow some leeway for the release to be agreed upon and the details to be worked out properly. In the meantime, you can always try to do your own...

Good weekend,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

Last edited by hjasak; February 13, 2010 at 16:06. Reason: Poor english
hjasak is offline   Reply With Quote

Old   March 29, 2010, 16:41
Default
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Great news. But what is the logic behind choosing cmake? Will it replace wmake?
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   March 30, 2010, 13:19
Default
  #13
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
CMake really is a great build system - helps a lot doing cross-compiles (hence the name). That would be my guess.
kev4573 is offline   Reply With Quote

Old   March 30, 2010, 15:36
Default
  #14
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by kev4573 View Post
CMake really is a great build system - helps a lot doing cross-compiles (hence the name). That would be my guess.
Well, yes. But cmake can be a pain too

I was asking if it will live side by side with wmake, or replace it, because wmake is actually what I think makes OF easy to manage also for unexperienced users.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   March 30, 2010, 17:05
Default
  #15
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
Quote:
Originally Posted by alberto View Post
Well, yes. But cmake can be a pain too

Best,
Hehe, agreed. However, it would be incredibly useful to be able to do development in a real IDE like Eclipse though, so I definitely endorse a switch to cmake.
kev4573 is offline   Reply With Quote

Old   March 30, 2010, 17:17
Default
  #16
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
You can use Eclipse with wmake too. I do that :-)
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   March 31, 2010, 16:20
Default
  #17
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
Well that's cool - I'd be interested to hear how you got that setup. As far as I know eclipse has no plugin support for wmake, so I would guess it was a custom setup. This thread is probably not the right place to discuss this at length, but I'd be interested if you started a thread somewhere on how to get this setup, or can otherwise point me in the right direction. My arguement for cmake is really that it already has targets for many IDEs, and once you're working in a real IDE, I've found it is much easier to learn a code base and develop new code.
kev4573 is offline   Reply With Quote

Old   March 31, 2010, 16:54
Default
  #18
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by kev4573 View Post
Well that's cool - I'd be interested to hear how you got that setup. As far as I know eclipse has no plugin support for wmake, so I would guess it was a custom setup. This thread is probably not the right place to discuss this at length, but I'd be interested if you started a thread somewhere on how to get this setup, or can otherwise point me in the right direction. My arguement for cmake is really that it already has targets for many IDEs, and once you're working in a real IDE, I've found it is much easier to learn a code base and develop new code.
You still have to build your "files" and "options" files by hand in my setup, but you can take advantage of Eclipse editor, code completion, warning/errors, ...

In short, the steps (Credit goes to Holger Marschall, errors are mine, since I'm summarizing ) are:
  • Import your project (point to the solver top directory when in Files -> New -> C++ project, remove the check from "Use default location").
  • Edit the compiler properties so that under C/C++ build you replace the default build command with wmake. Deselect "Generate makefiles automatically" and set the build directory.
  • Deactivate Project -> Automatically build
  • Use "Make target" tab to add two targets, one for wmake and the other for wclean, pointing to the "Make" directory of your code.
Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 15:22.