CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Compiling part of srcOpenFOAM (

maka March 7, 2006 06:13

I needed to modify Time.C and
I needed to modify Time.C and Time.H but when I compile with Allwmake in the src/ it takes lots of time. Is it possibel that I make a local Make folder in src/OpenFOAM/db/Time and compile it a shared object .so?

I will copy the Make file from OpenFOAM and modify it. Do I have to write any thing before:
wmake libso Time.

I guess I need to compile OpenFOAM folder once only after that and then any modifications in Time.C and Time.H will only need recompiling the Time folder to .so file. Am I right?

best Regards,

hjasak March 7, 2006 11:24

Time is one of the basic class
Time is one of the basic classes and if you change its header (Time.H), most of OpenFOAM will need to recompile. However, if you only wish to change the implementation of some functions, you could make a local copy of Time.C and link it directly with your executable. The local version will take precedence over the shared object library and all will be well (I'd add some print statements into your functions if I were you). However, you will not be able to add new member functions or new member data into Time without recompiling the whole lot. Is there any chance of creating a new class derived from Time and adding your functionality that way (without disturbing the whole of FOAM)?


maka March 13, 2006 07:29

Thanks for your help. ĒThe mod
Thanks for your help. ĒThe modification is about adding two memeber functions (writeInterval() and outputTime(label n) which are useful for processing existing instaneous data) so, the local version will not work. Unfotunately, the added functionality fits into the existing Time class so, if I derived a new class I wouldn't even know what to call it. You have not commented on the effect of separting the .so file of Time. Is there a reason the all to be on file? I read in the user guide that is loaded by default, is that the only reason. Anyway, thanks for your helpful comments

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