|
[Sponsors] |
May 14, 2013, 05:04 |
#include directives?
|
#1 |
Member
Join Date: Feb 2013
Posts: 30
Rep Power: 13 |
Hi!
I'm sorry since this is a basic question, but I'm pretty much confused about finding #include - directives within function bodys in OpenFOAM. What do they do there - I always thought #includes were preprocessor directives? Thanks a lot, Natalie |
|
May 14, 2013, 05:18 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
They are preprocessor directives indeed. You still retain the freedom to place them anywhere you want.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
May 14, 2013, 05:50 |
|
#3 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi Natalie,
Yes, it is a bit confusing at first. In OF you have the standard inclusion of header files, which tells the solver/utility/etc, which methods can be used in the program. These are those placed before "main". Secondly, a considerable amount of source code is used several places throughout different solver, e.g. createMesh.H or createDynamicFvMesh.H. These are not conventional header files, but merely bits of source code, which construct different types of finite volume meshes. These are also included into the solvers/utilities using include statements, and I suppose this approach has been adopted in order to avoid duplicating source code and thereby reducing the risk of bugs. Kind regards Niels |
|
May 14, 2013, 06:09 |
|
#4 |
Member
Join Date: Feb 2013
Posts: 30
Rep Power: 13 |
ah ok. I have had a look at the header files and they actually contain code which is, it seems, pasted by the preprocessor into the source. Thank you!
Natalie |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
cyclic boundary conditions for FSI | kanuk | OpenFOAM Programming & Development | 10 | April 25, 2014 02:52 |
OpenFoam install script Error during paraFoam installation | SePe | OpenFOAM Installation | 10 | June 19, 2010 15:15 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 03:01 |
Problems in compiling paraview in Suse 10.3 platform | chiven | OpenFOAM Installation | 3 | December 1, 2009 07:21 |
OpenFOAM15 paraFoam bug | koen | OpenFOAM Bugs | 19 | June 30, 2009 10:46 |