CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM News & Announcements > OpenFOAM Announcements from Other Sources

pythonFlu - Python wrapping for OpenFOAM C++ API

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 3 Post By alexey2petrov
  • 1 Post By francois
  • 1 Post By alexey2petrov
  • 1 Post By wyldckat
  • 1 Post By alexey2petrov
  • 1 Post By alexey2petrov
  • 1 Post By alexey2petrov

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2011, 09:05
Default pythonFlu - Python wrapping for OpenFOAM C++ API
  #1
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
The next stable release - 8.1-Elvis - is available for downloading.

pythonFlu, briefly, could be described through the following features.
  • Can be treated as a full-featured alternative to the C++ OpenFOAM way of development. Supports:
    • inheritance from base C++ classes
    • the same math like notation
    • templates
  • Actually, needs only core OpenFOAM libraries (libOpenFOAM.so & finiteVolume.so), all other staff could be defined purely in Python
  • The same pythonFlu definition could wrap different versions of OpenFOAM (as Extended ,as OpenCFD one)
  • No performance loss

Actually, the most greatest power of pythonFlu lays not in the things that it can substitute usual OpenFOAM C++ API.
pythonFlu enables completely new prospectives in the way CFD calculations could be interacted with.

To read more follow the link
alexey2petrov is offline   Reply With Quote

Old   June 14, 2011, 08:49
Default
  #2
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
Alexey,

What about the other projects directly related to pythonFlu ?
Is IFoam (now hypridFlu) always is development ?

Cheers
François
alexey2petrov likes this.
francois is offline   Reply With Quote

Old   June 14, 2011, 10:20
Default hybridFlu in pythonFlu
  #3
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
Hi François,
Quote:
Originally Posted by francois View Post
What about the other projects directly related to pythonFlu ?
Yes, we are going to recover the most attractive part of VulaSHAKA project in frame of pythonFlu. Next pythonFlu release will be especially dedicated to this point.
hybridFlu (SALOME to OpenFOAM binding) will be included into pythonFlu distribution and users will be able to lay their hands on this staff.
Nothing new will be actually added to already known functionality, except one important point -
on hybridFlu example the ability to wrap whatever third party functionality will be demonstrated
(in contents of hybridFlu it will be foam2vtk and unv2foam libraries)
What is going to happen next with hybridFlu? Depends on users interest to this functionality; whether they will work with it, trying to adjust to some real-world case, letting us to know in what direction it need to be advanced. Might be someone have some particular ideas on this point (except building another StarCD clone)?

You see, we are not allowed to spend our time on developing the stuff that will do the same as existing grown-up and polished software. You will be first disappointed by its quality and the number of features available.

By the way, I have in mind to start a new project which will allow automatically generate GUI by corresponding solver description. So, once a solver will describe its features in some special Python terms (the core idea for this project) it could provide a generic GUI definition to interact with its users. Just imagine, OpenFOAM solvers, each of them, running under their own specific GUI, where input values would be checked according to predefined range, user could choose only from compatible physical models and integration schemes e.t.c. By defining corresponding solver description - solver developer will help its users to figure out on how it works, how it should be properly initialized, guide them to the better practice and so on. What is your opinion?

This could be integrated further in hybridFlu, where corresponding generic GUI could be embedded into SALOME desktop.

Have I answered on your question?

Best regards,
Alexey
wyldckat likes this.
alexey2petrov is offline   Reply With Quote

Old   June 14, 2011, 11:04
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Alexey,

Quote:
Originally Posted by alexey2petrov View Post
By the way, I have in mind to start a new project which will allow automatically generate GUI by corresponding solver description.
(...)
This could be integrated further in hybridFlu, where corresponding generic GUI could be embedded into SALOME desktop.
I'm almost speechless... but one word does come out: Awesome! Simply Awesome!

By the way, in case you're not familiar yet with pythonOCC:
pythonOCC could afterwords help complement the generic GUI system into creating something more independent from SALOME; it could mainly become one of the best ways for using optimization tools along these existing tools and OpenFOAM!

Keep up the very good work!!!

With my best regards,
Bruno
alexey2petrov likes this.
__________________
wyldckat is offline   Reply With Quote

Old   June 15, 2011, 04:57
Default
  #5
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 17
francois is on a distinguished road
Quote:
Originally Posted by alexey2petrov View Post
Have I answered on your question?
Best regards,
Alexey
Alexey more than you can ever imagine !
As wyldckat I'm almost speechless ...

You are building an awesome bridge between end-users and developers with those excellent ideas !

How the community can help you at present time ?
Best regards and congrats for this amazing work (lucky us ) !
francois is offline   Reply With Quote

Old   June 15, 2011, 09:37
Default
  #6
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
Dear Bruno and Francois,

Thank you for your interest in the work we are planning to do.
Quote:
Originally Posted by wyldckat View Post
pythonOCC could afterwords help complement the generic GUI system into creating something more independent from SALOME; it could mainly become one of the best ways for using optimization tools along these existing tools and OpenFOAM!
Ye, Bruno, I got your idea about coupling with pythonOCC, will consider in our design.
Quote:
Originally Posted by francois View Post
How the community can help you at present time?
The idea about generic GUI is a tricky one. And one could say, that everything that is generic is useless by definition (and will be right from many points). So, the proper way for development of a generic is to discover rules that are common, not define them to make life simpler. Therefore, this project will require a lot of comments and insights from OpenFOAM experienced users, to realize what can be generalized, what will be the right way to do it and what had better left up to solver developers.

It would be wonderful if more people will be involved in preliminary discussion of the generic GUI project specification. I am planning to publish this document in one month on this forum. Any remarks and suggestions will be appreciated. The more real-world cases will be discussed and shadow-points discovered the brighter will be the future of this idea.

Cheers,
Alexey
alexey2petrov is offline   Reply With Quote

Old   July 13, 2011, 11:30
Default
  #7
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
Dear Foamers,

The next stable release - 8.2-hybrid - is available for downloading. It represents the following achievements:
  • Name this release after the reinvoked SALOME to OpenFOAM binding - hybridFlu
  • Specific hybridFlu related functionality comes in sources only and was tested with SALOME r5.1.3 and OpenFOAM r1.7.1
  • Advancing pythonFlu make system in the way that any other third-party functionality can use and extend the referenced pythonFlu wrapping definition
  • As an example how to achive this look in the implementation of hybridFlu related packages (foam2vtk and unv2foam)

We are planning to dedicate the next release to the porting on the latest OpenFOAM 2.0.0 version.
Everybody is welcome to share his thoughts on the contest and planning of pythonFlu development in the future.

Best regards,
Alexey & Andrey
elvis likes this.
alexey2petrov is offline   Reply With Quote

Old   July 16, 2011, 06:32
Default
  #8
Member
 
Pierre Castellani
Join Date: Apr 2011
Location: Paris
Posts: 38
Rep Power: 14
pcaste12 is on a distinguished road
Hi Alexey & Andrey,
I would like to try to use your tools, but I have an issue during the installation:

~$ sudo dpkg --force-depends --install /home/pierre/Téléchargements/pythonflu171_8.2-hybrid-1_maverick_amd64.deb
Sélection du paquet pythonflu171 précédemment désélectionné.
(Lecture de la base de données... 314892 fichiers et répertoires déjà installés.)
Préparation du remplacement de pythonflu171 8.2-hybrid-1 (en utilisant .../pythonflu171_8.2-hybrid-1_maverick_amd64.deb) ...
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named Foam
dpkg : avertissement : le sous-processus ancien script pre-removal a retourné une erreur de sortie d'état 1
dpkg - tentative d'exécution du script du nouveau paquet à la place ...
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named Foam
dpkg : erreur de traitement de /home/pierre/Téléchargements/pythonflu171_8.2-hybrid-1_maverick_amd64.deb (--install) :
le sous-processus nouveau script pre-removal a retourné une erreur de sortie d'état 1
running install
install_dir /usr/local/lib/python2.6/dist-packages/
Checking .pth file support in /usr/local/lib/python2.6/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.6/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating Foam.egg-info
writing Foam.egg-info/PKG-INFO
writing top-level names to Foam.egg-info/top_level.txt
writing dependency_links to Foam.egg-info/dependency_links.txt
writing manifest file 'Foam.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Foam.egg-info/SOURCES.txt'
writing manifest file 'Foam.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
.....

Unfortunately I have done a mistake before, trying to install the Natty version on my Maverick then try to uninstall ==> create an error (the same for instance). So I decide to try to reinstall the new one and get, again, the same error.
Do you have any ideas?

Thanks for advance,
Pierre.
pcaste12 is offline   Reply With Quote

Old   July 16, 2011, 07:29
Default
  #9
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
Hi Pierre,
Quote:
Originally Posted by pcaste12 View Post
... I have an issue during the installation ...
We am awfully sorry for the inconvenience. We have overseen this same problem twice -
Quote:
Originally Posted by alexey2petrov View Post
  1. Remove the broken pythonFlu installation
    python_version=`python -c "import sys; print sys.version[:3]"`
    sudo mkdir /usr/local/lib/python${python_version}/dist-packages/Foam
    sudo touch /usr/local/lib/python${python_version}/dist-packages/Foam/__init__.py
    sudo dpkg -r pythonflu171
  2. Install pythonFlu once again
    sudo dpkg -i <path to pythonFlu binary package>.deb
  3. Check that pythonFlu was successfully installed
    python -c "from Foam import finiteVolume; print 'ok'"
Hope this will help,
Alexey
alexey2petrov is offline   Reply With Quote

Old   July 16, 2011, 12:02
Default
  #10
Member
 
Pierre Castellani
Join Date: Apr 2011
Location: Paris
Posts: 38
Rep Power: 14
pcaste12 is on a distinguished road
Hi Alexey,

Many thanks for your very quick answer, I have done it and it works well.

Pierre.
pcaste12 is offline   Reply With Quote

Old   December 21, 2012, 02:39
Default New release of pythonFlu r9.1-SWIG is available
  #11
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
Christmas is getting closer, and we are happy to put "one more thing" on our OpenFOAM table.

In compare with the latest official release (r8.2-hybrid) it brings the following new features and improvements:

pythonFlu r9.1-SWIG
  • Name this release after porting on the new generation of SWIG wrapper - 2.X (tested with 2.0.3 - 2.0.6)
  • Porting on the latest OpenCFD version of OpenFoam - 2.1.1
  • The following new solvers were implemented in Python :
    • compressible
      • rhoPorousMRFLTSPimpleFlux
      • rhoPorousMRFSimpleFlux
      • rhoSimplecFlux
    • heatTransfer
      • buoyantBoussinesqPimpleFlux
      • chtMultiRegionSimpleFlux
    • incompressible
      • adjointShapeOptimizationFlux
      • SRFPimpleFlux
      • SRFSimpleFlux
pythonFlu r9.0-porting
  • Name of the release after porting on the latest version of OpenFOAM
  • Porting on the latest version of OpenFoam - 2.1.0, 2.0.1,2.0.0
  • Porting on FreeFoam up to the 0.1.0rc5
  • Porting on MacOS X (thanks to Bernhard Gschaider)
  • Support for multi-fork and multi-version OpenFoam installations
  • Moving installation procedure to launchpad.net (due to increased number of dependencies)
  • Full grown support for writing interactive applications
    • A special managedFlu intermediate C++ layer was designed to provide precise memory management over OpenFoam objects)
  • Advancement of the internal Python related module packaging
  • Support writing pure Python custom functionObjects
For more details look at
Have a marry Christmass!
wyldckat likes this.
alexey2petrov is offline   Reply With Quote

Old   December 21, 2012, 06:48
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by alexey2petrov View Post
Christmas is getting closer, and we are happy to put "one more thing" on our OpenFOAM table.

In compare with the latest official release (r8.2-hybrid) it brings the following new features and improvements:

pythonFlu r9.1-SWIG

....
Have a marry Christmass!
Hello Alexey!

I guess christmas came early this year.

Just two questions:
- does this correspond to the latest commits on github (just asking as the last commits I see there are from the 20th of october)
- Nice way to get all the solvers in one go would be if there was a repository that incorporates all the available solvers in submodules (http://git-scm.com/book/en/Git-Tools-Submodules). That would allow people to get them all in one go and you can still have separate repos for all of them

Anyway: Merry Christmas
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

Last edited by gschaider; December 21, 2012 at 06:58. Reason: Typo
gschaider is offline   Reply With Quote

Old   December 21, 2012, 08:01
Default
  #13
Member
 
alexey2petrov's Avatar
 
Alexey
Join Date: Feb 2010
Posts: 33
Blog Entries: 1
Rep Power: 17
alexey2petrov is on a distinguished road
Hello Bernhard,
Quote:
Originally Posted by gschaider View Post
Just two questions:
- does this correspond to the latest commits on github (just asking as the last commits I see there are from the 20th of october)
Yes, you are right. The basic stuff for the version was ready since 20th of october 2012.

Quote:
Originally Posted by gschaider View Post
- Nice way to get all the solvers in one go would be if there was a repository that incorporates all the available solvers in submodules (http://git-scm.com/book/en/Git-Tools-Submodules). That would allow people to get them all in one go and you can still have separate repos for all of them
Thanks for your idea. We will investigate this option.

Best regards,
Alexey
elvis likes this.
alexey2petrov is offline   Reply With Quote

Old   December 21, 2012, 11:43
Default
  #14
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Hi Alexey,

thank you that you continue to work on pythonflu.
great job you did.

merry x-mas and a happy new year to all of you.

greets

elvis
elvis is offline   Reply With Quote

Reply

Tags
front-end, openfoam, python, pythonflu, wrapping


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 20:00.