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

Can someone please explain this

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 3, 2007, 08:07
Default Dear OpenFoam Users I am ne
  #1
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
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
jaswi is offline   Reply With Quote

Old   July 3, 2007, 08:14
Default You did pick a hard place to s
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   July 3, 2007, 08:19
Default Thanks Hrv for the answer.
  #3
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
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
jaswi 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
Can someone explain the Y plus value jeff bennet Main CFD Forum 32 April 8, 2020 05:58
Please explain Abby CFX 1 April 25, 2006 06:18
please explain these terms kiran Main CFD Forum 0 June 28, 2005 17:40
can some one explain this to me? docsri Main CFD Forum 2 December 11, 2002 21:43
someone can explain this..... mazza Phoenics 0 June 4, 2001 11:59


All times are GMT -4. The time now is 07:59.