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

operator overloading ==

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 19, 2015, 05:16
Question operator overloading ==
  #1
New Member
 
Join Date: Oct 2014
Posts: 9
Rep Power: 12
xiaofishnus is on a distinguished road
Hi Foamer

For interFoam solver, in pEqn.H, line 62

p == p_rgh + rho*gh

why it use == , but not = ??

can anybody explain this?

thanks a lot!

xiaofishnus
xiaofishnus is offline   Reply With Quote

Old   March 20, 2015, 03:52
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
operator== enforces assignment, even if the path field is of eg. fixedValue type, which is not changed by operator=

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 2, 2023, 15:08
Default ambiguous overload
  #3
New Member
 
Sina
Join Date: Feb 2023
Posts: 1
Rep Power: 0
Sina_ is on a distinguished road
Hello


I need to print a parameter in unsigned long long format. I face overloading error.


I would appreciate it if you could please let me know how I could solve it inside OpenFOAM.


unsigned long long b;
Info<<"after operations inside code b is "<<b<<nl;
p, li { white-space: pre-wrap; }


Best wishes,
Sina
Sina_ is offline   Reply With Quote

Reply

Tags
interfoam, operator overloading, peqn.h


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 15:43.