On Nov 17, 2010, at 3:09 PM, Roy Stogner wrote:

> 
> 
> On Wed, 17 Nov 2010, Cody Permann wrote:
> 
>> On Nov 17, 2010, at 2:24 PM, Roy Stogner wrote:
>> 
>>> And because
>>> PointLocatorTree only operates on active elements, it shouldn't care
>>> whether or not we delete subactive elements after it's constructed.
>> 
>> Sounds good, but are you completely sure?  Check out the find_element() 
>> routine
>> on line 501 inside of tree_node.C which is where the seg fault occurs.  That 
>> method
>> is using an internal data structure of pointers to elements.  That data 
>> structure would
>> be out of date after the call to mesh::contract() because contract() calls
>> renumber_nodes_and_elements() which changes pointers around.
> 
> I don't think it's supposed to change pointers around (other than by
> deleting the subactive elements and unused nodes), at least in the
> existing Mesh implementations.  ParallelMesh uses a mapvector<Elem*>
> as a container; SerialMesh uses a vector<Elem*>.  We move Elem* from
> place to place within at least the latter data structure, but the Elem
> itself should never change addresses.

OK fair enough.  Here is my latest observation.  I would assume that the calls
to coarsen_elements() and refine_elements() in EquationSystems::reinit() would
both return false having just completed the refine_and_coarsen_elements() 
routine
right before hand.  However this is not the case.  There are additional elements
coarsened or refined in the reinit() routine - further changing the mesh and 
invalidating
the point_locator...

> 
>> I propose we add a call to clear_point_locator() right after the
>> call to contract() inside of EquationSystems.reinit().  I already
>> made this change in my local copy and everything seems to be working
>> correctly without the explicit call to clear the point locator in
>> user code anymore.
> 
> Sounds like the best place for an additional clear_point_locator() is
> at the end of UnstructuredMesh::contract(), then.  That method is
> supposed to be callable in more contexts, even if we never do so and I
> doubt any of our users do either.
> 
> Once that's done, your patch is probably safe to commit - I still want
> to better understand this bug but it appears we've at least fixed it.
> ---
> 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

Reply via email to