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

Supporting multiple OF versions in library

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2018, 06:53
Default Supporting multiple OF versions in library
  #1
Senior Member
 
Timofey Mukha
Join Date: Mar 2012
Location: Stockholm, Sweden
Posts: 119
Rep Power: 14
tiam is on a distinguished road
Dear all,

I am developing a library for wall-modelled LES in OpenFOAM
https://bitbucket.org/lesituu/libwallmodelledles

Unfortunately, the OF community is split and there are several forks, all with different APIs. Moreover, breaking API changes are continuously introduced within a single fork as well. I work with OpenFOAM 3.0.1 but I would like the code to support multiple versions of OF, to enlarge the user-base. I intended to have separate git branches corresponding to different versions. But I see already now that this is not going to work: propagating changes to several branches will take too long and it will be hard to keep them in sync. Therefore, I would like the code to determine the OF fork that is installed and have appropriate pieces of code compiled.

If I understand correctly, swak4foam manages to do that, using complicated makefiles and #ifdef macros in the code, like this, for example

Code:
#ifdef FOAM_NO_DIMENSIONEDINTERNAL_IN_GEOMETRIC                                 
            << this->internalField().name()                                     
#else                                                                           
            << this->dimensionedInternalField().name()                          
#endif
I am wondering if there is any guide on how to do such things, swak4foam is a bit too huge to untangle everything.

Best,
Timofey
tiam is offline   Reply With Quote

Reply

Tags
version-specific code


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[Other] Bashrc problem on multiple OpenFOAM versions Rolanzo OpenFOAM Installation 4 March 4, 2018 16:42
[OpenFOAM.org] Install openFOAM 3.0.1 in Ubuntu 16.04 LTS from Deb packs Pier84 OpenFOAM Installation 4 June 18, 2016 17:22
decomposePar is missing a library whk1992 OpenFOAM Pre-Processing 8 March 7, 2015 08:53
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21


All times are GMT -4. The time now is 07:33.