CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   the code difference (http://www.cfd-online.com/Forums/openfoam/118809-code-difference.html)

Yanming Ding June 4, 2013 21:37

the code difference
 
I have get stuck in a problem about a simple code.
for example:
I defined a function

combustion::tmp<volScalarField>sh() const;

when I tried to call the function:
(1)combustion->sh()
(2)combustion->sh()()

what's the difference between the two forms?

Best regards

Auggie

cutter June 5, 2013 03:03

As far as I understand the first one calls operator() on sh. The second one calls operator() on the return value of sh(). What's your intention?

cutter

Yanming Ding June 5, 2013 04:44

the change of version
 
Dear cutter,
Thank you for your reply.

The reason why I was wondering is the change of version.

There is a same solver, chemistry.sh()() in openfoam 1.7, but combustion->sh() in openfoam 2.0,2.1

I was wondering whether the different forms express the same meanings or not.

Auggie


All times are GMT -4. The time now is 00:50.