CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   What is the meaning of (

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:

inletOutletFvPatchField<type>::inletOutletFvPatchF ield
const fvPatch& p,
const DimensionedField<type,>& iF
mixedFvPatchField<type>(p, iF),
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


evan February 1, 2008 16:37

Francesco, This confused me

This confused me too. Check here:

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


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



All times are GMT -4. The time now is 06:38.