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

Understanding the basic of Openfoam programming

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

Like Tree1Likes
  • 1 Post By Krapf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2020, 05:43
Default Understanding the basic of Openfoam programming
  #1
New Member
 
Vishal
Join Date: Sep 2020
Posts: 1
Rep Power: 0
vishalgarg474 is on a distinguished road
Hello Everyone,



I am a beginner in Openfoam programming and I am trying to understand these lines of code.



psiReactionThermo& thermo = reaction->thermo();



basicMultiComponentMixture& composition = thermo.composition();


What I can not understand is the usage of & and the -> in the codeline.



1. Does & call some functionality thermo of class psiReactionThermo. Or is it defining some kind of variable named thermo and then initializing it with reaction?


2. Further, what does the -> mean?



Could somebody share what they mean?

Last edited by vishalgarg474; September 25, 2020 at 05:44. Reason: tags
vishalgarg474 is offline   Reply With Quote

Old   September 25, 2020, 06:09
Default
  #2
Member
 
Join Date: Oct 2017
Posts: 59
Rep Power: 5
Krapf is on a distinguished road
These are not special features of OpenFOAM programming. Take a look at this:
https://www.learncpp.com/cpp-tutorial/611-references/
https://www.learncpp.com/cpp-tutoria...nd-references/
vishalgarg474 likes this.
Krapf is offline   Reply With Quote

Reply

Tags
classes, openfoam, openfoam4.1, programming, psireactionthermo

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner: How to bridge the gap between basic C++ knowledge to openFOAM programming bigbang OpenFOAM Programming & Development 14 July 10, 2018 06:34
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 14:36
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 0 January 1, 2014 20:21
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55
looking for a basic tutorial to use openfoam ramaerocfd OpenFOAM 3 December 31, 2010 04:21


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