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

making change in some base class

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2016, 16:02
Default making change in some base class
  #1
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 15
EmadTandis is on a distinguished road
Hello
I am new to openFoam programming and want to make some change in some class like gaussLapacianScheme.C located in $WM_PROJECT/src/finiteVolume/finiteVolume/lapalcianScheme/
to the extent that I understood form "Make" directory, the option file in almost all application usually access to this calss using -lfiniteVolme in "option" file. for example the "option" file of one solver is something like below:
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
-lfiniteVolume \
-lmeshTools

My question are:
1- Do the " -I$(LIB_SRC)/finiteVolume/lnInclude " and "-lfiniteVolume " say same thing? also "-I$(LIB_SRC)/meshTools/lnInclude" and "-lmeshTools"?
2- I removed "-lfiniteVolume " and instead of using that dynamic library, copied all files in in $WM_PROJECT/src/finiteVolume to "lnInclude" located in application folder. but I received Error. Why I have to use dynamic library?

I think I have got quite confused with the dependencies and be glad to receive some notes.
Thanks in advance
EmadTandis is offline   Reply With Quote

Old   December 13, 2016, 18:37
Default
  #2
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
To answer your questions:
  1. no and no.
  2. you shouldn't need to copy files around, you need to just include files and libs to provide enough for the code to compile.

In the options file, there are two sections. The *_INC section will tell the compiler where to look for *.H and *.C files that the code you are compiling needs. The *_LIBS section is a list of all the libraries (e.g. libfiniteVolume.so) within OpenFOAM that are needed. Wmake then puts it all together and helps your compiler ... compile things.
chegdan is offline   Reply With Quote

Old   December 14, 2016, 16:42
Default
  #3
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 15
EmadTandis is on a distinguished road
Thanks chegdan for reply
1- If I want to compile finite volume classes and my newApp.C at the same time, and not using -lfiniteVolume, Do you think it is doable? ( I tried but received error)
2- I did the method that you've mentioned (using option file), but it was of no use. So I copied all finite volume classes to my slover's directory to make sure that they are available for newApp.C . As I said the compiler show error while compiling classes file.
Then tried to compile finite volume classes separately (using >>wmake libso command, like what openFoam did), it works.
I just want to know why I can not compile them with the newApp.C at the same time?
EmadTandis is offline   Reply With Quote

Old   December 15, 2016, 03:21
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Quote:
Originally Posted by EmadTandis View Post
So I copied all finite volume classes to my slover's directory to make sure that they are available for newApp.C .
As chegdan said, you shouldn't have to do that.

Quote:
Originally Posted by EmadTandis View Post
1- If I want to compile finite volume classes and my newApp.C at the same time, and not using -lfiniteVolume, Do you think it is doable? ( I tried but received error)
By definition, yes it is possible... But it might be a hassle, as I don't think it will be trivial to use "wmake".
Why would you want to do that in the first place? Your executable will become huge, and your solver will suddenly have openfoam hard-coded, which means that you need to do a lot of changes to your solver if the finite volume library is updated, as opposed to requiring zero changes.


Quote:
Originally Posted by EmadTandis View Post
As I said the compiler show error while compiling classes file.
No one is going to give you a sensible answer if you tell us nothing. For all we know, the compiler might complain about something unrelated to the linking process.
Read this first.
floquation is offline   Reply With Quote

Old   December 15, 2016, 09:15
Default
  #5
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 15
EmadTandis is on a distinguished road
Thanks floquation
I think i got the point..
EmadTandis 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
GPU Linear Solvers for OpenFOAM gocarts OpenFOAM Announcements from Other Sources 37 August 17, 2022 14:22
Radiation interface hinca CFX 15 January 26, 2014 17:11
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 12:41
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 05:18
How to change turbulence model in InterFoam Gildeh OpenFOAM Running, Solving & CFD 4 March 28, 2012 12:04


All times are GMT -4. The time now is 19:48.