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

making change in some base class

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 13, 2016, 17:02
Default making change in some base class
  #1
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 32
Rep Power: 8
EmadTandis is on a distinguished road
Sponsored Links
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
Sponsored Links

Old   December 13, 2016, 19:37
Default
  #2
Senior Member
 
chegdan's Avatar
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 612
Rep Power: 22
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.
__________________
Dan

Find me on twitter @dancombest and LinkedIn
chegdan is offline   Reply With Quote

Old   December 14, 2016, 17:42
Default
  #3
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 32
Rep Power: 8
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, 04:21
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 241
Rep Power: 12
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, 10:15
Default
  #5
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 32
Rep Power: 8
EmadTandis is on a distinguished road
Thanks floquation
I think i got the point..
EmadTandis is offline   Reply With Quote

Reply

Thread Tools
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 On
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 36 March 29, 2017 08:05
Radiation interface hinca CFX 15 January 26, 2014 18:11
Error bulding swak4Foam sfigato OpenFOAM Installation 18 August 22, 2013 12:41
funkySetFields compilation error tayo OpenFOAM 39 December 3, 2012 06:18
How to change turbulence model in InterFoam Gildeh OpenFOAM Running, Solving & CFD 4 March 28, 2012 12:04

Sponsored Links


All times are GMT -4. The time now is 23:45.