|
[Sponsors] |
August 12, 2013, 17:20 |
operators in openfoam
|
#1 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
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! |
|
August 12, 2013, 21:14 |
|
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18 |
Hi,
If you want to find the cells whose x-coordinates are greater than the value "length", you can use the following: Code:
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 { ...... }} Fumiya |
|
|
|
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 |