![]() |
namespace Foam
namespace Foam
{ namespace radiation { defineTypeNameAndDebug(P1, 0); addToRunTimeSelectionTable ( radiationModel, P1, dictionary ); } } Anyone can explain the above code line by line? |
your within namespace Foam
namespace radiation a typeName is defined the P1 model is added to the runTime selection table What is your question? Can you please clarify what is unclear? Best Kathrin |
The first two lines are namespaces, as kathrin mentioned. If you don't know what those are, they are basic components of C++ created recently to avoid name collisions. If your book is old, it won't mention them - try googling it.
The next two are macros. OpenFOAM is full of macros. Many coding standards forbid all macros (except includes and include guards), but not in OpenFOAM. These make the code more difficult to read for a new-comer... but they also make it easier to work with. Many pros and cons. Anyways... defineTypeNameAndDebug OpenFOAM has a type naming convention to help keep track of the types of classes. These macros are in one of the files in src/OpenFOAM/db/typeInfo. Basically, just holds a word with the name of the class. addToRunTimeSelectionTable This is part of OpenFOAM's runTime selection mechanism. This is described here: http://openfoamwiki.net/index.php/Op...tion_mechanism You probably don't want to go too deep into figuring it out - rather, just know it is part of the underlying machinery that other objects use to call its constructors. Hope that helps. |
Hi David,
thank you for the typeInfo information. This is very helpful. I really searched for them but it was very hard to find! Best Kathrin |
| All times are GMT -4. The time now is 16:52. |