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

What is the difference of the codes under src and applications?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By betterglobe
  • 3 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2017, 16:52
Default What is the difference of the codes under src and applications?
  #1
New Member
 
Join Date: Aug 2016
Posts: 3
Rep Power: 9
betterglobe is on a distinguished road
Hi there,
I'm starting coding with OpenFOAM and I'm confused that there are some files holding same names and contents under
OpenFOAM-4.1/src
and
OpenFOAM-4.1/applications

For example, we have
/OpenFOAM-4.1/src/mesh/blockMesh/blockMesh/blockMesh.C
and
/OpenFOAM-4.1/applications/utilities/mesh/generation/blockMesh/blockMesh.C

My question is, why do we need the same file in different folders?
ordinary likes this.
betterglobe is offline   Reply With Quote

Old   March 2, 2017, 02:53
Default
  #2
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
If you'd open those files, you'll see that they are not the same.

src:
All OpenFoam libraries' sources. This code doesn't do anything on its own: it needs an executable to require them in order to be executed.

applications:
All executables, like solvers and pre-/postprocessing utilities.
These executables typically use (a lot of) source code from OpenFoam's libraries by linking the libraries (see: Make/options that resides in every solver directory etc.).

In the case of blockMesh,
  • the file in 'applications' only has a main method, it requires the file in 'src'.
  • the file in 'src' does all the hard work
floquation is offline   Reply With Quote

Old   March 2, 2017, 14:30
Default
  #3
New Member
 
Join Date: Aug 2016
Posts: 3
Rep Power: 9
betterglobe is on a distinguished road
Quote:
Originally Posted by floquation View Post
If you'd open those files, you'll see that they are not the same.

src:
All OpenFoam libraries' sources. This code doesn't do anything on its own: it needs an executable to require them in order to be executed.

applications:
All executables, like solvers and pre-/postprocessing utilities.
These executables typically use (a lot of) source code from OpenFoam's libraries by linking the libraries (see: Make/options that resides in every solver directory etc.).

In the case of blockMesh,
  • the file in 'applications' only has a main method, it requires the file in 'src'.
  • the file in 'src' does all the hard work
So both codes are together used when compiling.
Thanks a lot!
betterglobe 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
Is it safe to change owner of src to root? chrisb2244 OpenFOAM Programming & Development 2 February 20, 2014 06:59


All times are GMT -4. The time now is 15:36.