← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Reorder mesh if it was odered before topology computation.

 



Anders Logg wrote:
On Sun, Nov 02, 2008 at 04:13:36PM +0000, Garth N. Wells wrote:
I spent some time tracking down a nasty bug related to cont_cast in Mesh::init. The flag Mesh::_ordered was being reset despite the mesh being const. Can we avoid this const_cast, or at least move the const_cast up from the internals of Mesh so it is somewhat clearer that const-ness is being cast away?

Garth

The init() function is the only place where we should have a
const_cast in the Mesh.

It should not reset the _ordered flag. The init() function may
potentially compute new connectivity (which existed before but was not
computed) but the new connectivity should always be ordered. I'm not
sure it is but we should make sure it is.


It wasn't and the ordered flag was reset. I've changed it now so if the mesh is ordered before init(), Mehsh::order() is called at the end of the init call.

Garth



------------------------------------------------------------------------

_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev




References