On Tue, 16 Nov 2010, Cody Permann wrote: >>> Everything seems to be working just fine. There is one more mystery >>> which I cannot figure out. I am forced to clear the point locator >>> class manually in each adaptivity step before I use it or I end up >>> with data corruption and a seg fault in the Point Locator Tree in >>> the middle of the mesh refinement algorithm. I'm not sure if this >>> is an indication that I'm doing something wrong or not. Everything >>> works fine as long as I start with a clear locator each timestep.
I think the root trouble is that we never pictured PointLocatorTree being used on a mesh in mid-flux. That's why it's cleared in MeshBase::prepare_for_use() - because once you start adding elements then the tree will erroneously return their parents instead of them, and once you start removing elements the tree can segfault when it "finds" orphaned pointers to them. I'm actually not sure how this is causing your bug, though - you're just using the point_locator in the flagging stage, right? Where the elements haven't actually been created or deleted yet? > I think we'll still need a "has_topological_neighbor" function in > element too. Yeah; I pictured leaving that function in Elem, just using a simplified inline function in MeshRefinement that dispatches to it after handling the ifdefs and picking out the right Mesh/PeriodicBoundaries parameters. > After we get this all hammered out, we'll have to > think about optimizations. Using that point locator on every single > boundary element all the time has got to be fairly expensive. Not necessarily. With a tree it's a log(N_elem) lookup each time, so O(N_bdyelem*log(N_elem)) in total. A cached std::map would barely be an improvement at O(N_bdyelem*log(N_bdyelem)). I suppose a cached unordered_map would at least be worth trying out. --- Roy ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ Libmesh-devel mailing list Libmesh-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-devel