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

the code difference

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 4, 2013, 21:37
Default the code difference
  #1
New Member
 
Auggie
Join Date: Oct 2012
Posts: 5
Rep Power: 4
Yanming Ding is on a distinguished road
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
Yanming Ding is offline   Reply With Quote

Old   June 5, 2013, 03:03
Default
  #2
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 117
Rep Power: 7
cutter is on a distinguished road
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
cutter is offline   Reply With Quote

Old   June 5, 2013, 04:44
Default the change of version
  #3
New Member
 
Auggie
Join Date: Oct 2012
Posts: 5
Rep Power: 4
Yanming Ding is on a distinguished road
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
Yanming Ding is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding code of inletOutlet / outletInlet fredo490 OpenFOAM Programming & Development 10 June 13, 2013 12:45
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 13:30
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10
own Code vs. commercial code Bernhard Mueck Main CFD Forum 10 February 16, 2000 11:07


All times are GMT -4. The time now is 11:49.