CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   What is the meaning of (http://www.cfd-online.com/Forums/openfoam/60866-what-meaning.html)

francesco_b February 1, 2008 13:00

Hi all, I know that maybe
 
Hi all,

I know that maybe it could be a silly question, but I'm a beginner and somewhere I need to start

in the file inletOutletFvPatchField.C there is this expressions:

template<class>
inletOutletFvPatchField<type>::inletOutletFvPatchF ield
(
const fvPatch& p,
const DimensionedField<type,>& iF
)
:
mixedFvPatchField<type>(p, iF),
phiName_("phi")
{
this->refValue() = pTraits<type>::zero;
this->refGrad() = pTraits<type>::zero;
this->valueFraction() = 0.0;
}

What is the meaning of the ":"? Is it only a way to say that the line goes on through next line?

Thanks in advance

Francesco

evan February 1, 2008 16:37

Francesco, This confused me
 
Francesco,

This confused me too. Check here:

http://www.cs.huji.ac.il/labs/parall...e/tic0143.html

with operator overload I think you can also use it with an access specifier.

Evan

deepsterblue February 1, 2008 18:05

It's an initialization list fo
 
It's an initialization list for member data. For classes that don't provide a default null-constructor, this is the only way to go, since the object (in this case: mixedFvPatchField<type>(p, iF),etc ) needs some initial parameters for the constructor.
Other situations in which this happens:
When you have references as member data. Something like - label& myData_;
When the object is created, myData_ MUST have a reference to something, otherwise, it's invalid.

Hope this helps

francesco_b February 4, 2008 05:54

Hi Evan and Sandeep, Thanks
 
Hi Evan and Sandeep,

Thanks for your help, now it is clear http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Regards,

Francesco


All times are GMT -4. The time now is 05:51.