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

octreeLine.getIntersections() causes compile error in OF 1.7.x

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2011, 17:03
Default octreeLine.getIntersections() causes compile error in OF 1.7.x
  #1
New Member
 
Ryan Danks
Join Date: Jan 2011
Posts: 20
Rep Power: 15
RDanks is on a distinguished road
Hi Foamers,

I'm trying to do some simple shadowing in openFOAM using ray-casting. Obviously, I'd rather use the built in octree classes to speed this process up rather than doing a brute force check of every patch face against the points I want to get shading data for. To this end I tried to impliment the octreeLine class with it's getIntersections() method, (http://foam.sourceforge.net/doc/Doxy...ctreeLine.html) to get a list of the cells intersected by a given line.

I followed the exact same setup as shown on octreeLine's Doxygen page but whenever I compile I get all kinds of errors that look like they reside in the base OF code. (See attachment for the output)

Has anyone successfully used this method or is this a bug in the code? Thanks!
Attached Files
File Type: txt errorOut.txt (14.2 KB, 6 views)
RDanks is offline   Reply With Quote

Old   June 8, 2011, 09:55
Default Fixed it
  #2
New Member
 
Ryan Danks
Join Date: Jan 2011
Posts: 20
Rep Power: 15
RDanks is on a distinguished road
Hey everyone,

After a night's rest I found the problem.

The pointHitSort class didn't have a " < " operator defined in pointHitSort.H, the std::sort algorithm needs this to sort the intersections the lineSearch finds.

If you add the following to pointHitSort.H everything compiles fine...

Code:
bool operator<(const pointHitSort& rhs) const
{
    return inter_.distance() < rhs.inter().distance();
}
RDanks is offline   Reply With Quote

Old   July 19, 2011, 05:41
Default
  #3
aot
New Member
 
Andreas Otto
Join Date: Sep 2009
Posts: 12
Rep Power: 16
aot is on a distinguished road
Hi,
i also want to include some ray-casting in OF. Up to now I used some brute force searching with findcell. Have you been successful with using getintersections and is it possible to get some more information on your implementation (or at best some code snippets)?
aot is offline   Reply With Quote

Old   July 19, 2011, 08:25
Default
  #4
New Member
 
Ryan Danks
Join Date: Jan 2011
Posts: 20
Rep Power: 15
RDanks is on a distinguished road
Hi Andreas,

Basically my implementation is the same as one outlined on the Doxygen page for the octreeLine class...
Code:
    
octree<octreeDataFace> oc( .. );
octreeLine<octreeDataFace> lineSearch(oc, pStart, pEnd);
while (lineSearch.getIntersection())
{
    const point& pt = lineSearch.hitInfo().hitPoint();
        ..
}
You generate an octree of faces that could block your rays, and another one for the cells. Then you use octreeLine to see if there is an intersection between each cell centre and your ray source.
There's not much more to it than that. The built in octree classes are quite fast and I've had some good results working with it.

Quote:
Originally Posted by aot View Post
Hi,
i also want to include some ray-casting in OF. Up to now I used some brute force searching with findcell. Have you been successful with using getintersections and is it possible to get some more information on your implementation (or at best some code snippets)?
RDanks is offline   Reply With Quote

Old   July 19, 2011, 09:28
Default
  #5
aot
New Member
 
Andreas Otto
Join Date: Sep 2009
Posts: 12
Rep Power: 16
aot is on a distinguished road
Hi Ryan,
thanks for the quick answer. How do you generate those octrees? Up to now I don't have any experience in working with octree-classes and there is merely any discussion on this topic in the forum.

Thanks
Andreas
aot is offline   Reply With Quote

Reply


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
star4ToFoam Segfault on Mac OS X 10.6.5 / OF 1.7.x sushant OpenFOAM Installation 1 December 25, 2010 19:38
PV3FoamReader compile error.... PEM_GUY OpenFOAM Installation 6 April 5, 2010 17:22
Error compile file udf czfluent Fluent UDF and Scheme Programming 24 September 26, 2009 13:24
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 21:51


All times are GMT -4. The time now is 03:25.