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

Difference: A.internalField()[celli] and A[celli] ?

Register Blogs Community New Posts Updated Threads Search

Like Tree12Likes
  • 12 Post By hjasak

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 29, 2012, 03:44
Default Difference: A.internalField()[celli] and A[celli] ?
  #1
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi,

When accessing cell values in a volScalarField, it seems that both A.internalField()[celli] and A[celli] does what I want. I can both read values and set values. I've seen that both practices are found in the source code. The thermo libraries usually creates scalarField references to internalField, and then use them, hence they use the first method (A.internalField()[celli]), while other classes use A[celli].

Does anyone know what the difference is? Is there any, and are there any performance related differences?

Regards,
Kalle
kalle is offline   Reply With Quote

 


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



All times are GMT -4. The time now is 10:58.