|
[Sponsors] |
July 3, 2007, 09:07 |
Dear OpenFoam Users
I am ne
|
#1 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Dear OpenFoam Users
I am new to c++ programming. I have been looking the source code of OpenFOAM. I am unable to understand the src/OpenFOAM/primitives/pTraits/pTraits.H I have added my dounts next to the lines i do not understand, please take a look. This is what it contains : ----------------------------------------- #ifndef pTraits_H #define pTraits_H namespace Foam { class Istream; // <-- what does it means here --> Next it defines a template class pTraits with template argument <class>. I am confused about what is class primitive !! as in the definition [: public primitive ] indicates that class pTraits is also inherited from primitive . template<class> class pTraits : public primitive // <--- indicate inheritance ?? { public: pTraits(Istream& is) // <-- is this a constructor : primitive(is) {} }; } // End namespace Foam #endif Can anybody tell what is primitive and from where it comes !!! Thanks alot With Best Regards Jaswinder |
|
July 3, 2007, 09:14 |
You did pick a hard place to s
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
You did pick a hard place to start: this is advanced templating you are looking at and I bet there is VERY few people on the forum who can actually answer this question properly.
So: template<class> class pTraits means a pTraits class is a template, and we will use a primitive as the template keyword. Now it gets tricky, with template specialisation for raw types and the "curiously recurring template pattern". Trust me, right now you don't need to know. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
July 3, 2007, 09:19 |
Thanks Hrv for the answer.
|
#3 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Thanks Hrv for the answer.
I take your word and keep away from that for a while. I sent you an email last week. Please find some time to take a look at that. That was about the Turbulence modelling w.r.t. interface capturing model. With Best Regards Jaswinder |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can someone explain the Y plus value | jeff bennet | Main CFD Forum | 32 | April 8, 2020 06:58 |
Please explain | Abby | CFX | 1 | April 25, 2006 07:18 |
please explain these terms | kiran | Main CFD Forum | 0 | June 28, 2005 18:40 |
can some one explain this to me? | docsri | Main CFD Forum | 2 | December 11, 2002 22:43 |
someone can explain this..... | mazza | Phoenics | 0 | June 4, 2001 12:59 |