CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Supporting multiple OF versions in library

Register Blogs Members List Search Today's Posts Mark Forums Read

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

I am developing a library for wall-modelled LES in OpenFOAM

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

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

tiam is offline   Reply With Quote


version-specific code

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:09
[Other] Bashrc problem on multiple OpenFOAM versions Rolanzo OpenFOAM Installation 4 March 4, 2018 15:42
[] Install openFOAM 3.0.1 in Ubuntu 16.04 LTS from Deb packs Pier84 OpenFOAM Installation 4 June 18, 2016 16:22
decomposePar is missing a library whk1992 OpenFOAM Pre-Processing 8 March 7, 2015 07:53
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21

All times are GMT -4. The time now is 10:35.