CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM

operators in openfoam

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

Like Tree1Likes
  • 1 Post By fumiya

LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2013, 17:20
Question operators in openfoam
Senior Member
Join Date: Jan 2013
Posts: 371
Rep Power: 11
openfoammaofnepo is on a distinguished road
Hi All,

When I add the following lines in fireFoam.C:

if(x > length)

I failed to compiled it successfully. The error message is:

mo match for 'operator>' in x > length

If I indeed would like this condition in if statements, how can modify the source file fireFoam.C? Can anybody help me ? My C++ skill is a little low.

Thank you in advance!
openfoammaofnepo is offline   Reply With Quote

Old   August 12, 2013, 21:14
Senior Member
fumiya's Avatar
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 15
fumiya is on a distinguished road

If you want to find the cells whose x-coordinates are greater than the value "length", you can use the following:

forAll(mesh.cells(), cellI) //Loop over the cells
if(mesh.C()[cellI].x() > length) //Compare the x-coordinate of the cellI's center with the scalar length { ...... }
Hope this helps,
immortality likes this.
fumiya is offline   Reply With Quote


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
Problem installing OpenFOAM 1.5 installation on RHEL 4. vwsj84 OpenFOAM Installation 4 April 23, 2009 04:48
2009 OpenFOAM Summer School in Zagreb, Croatia hjasak OpenFOAM Announcements from Other Sources 0 March 27, 2009 12:08
Summer School on Numerical Modelling and OpenFOAM hjasak OpenFOAM 5 October 12, 2008 13:14
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
OpenFOAM Training and Workshop Zagreb 2628Jan2006 hjasak OpenFOAM 1 February 2, 2006 21:07

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