← Back to team overview

dolfin team mailing list archive

Re: Mesh refinement copying problems

 

On Fri, Feb 26, 2010 at 09:54:49AM +0100, Anders Logg wrote:
> There seems to be a problem with the new approach to mesh refinement
> (return by value).
>
> Try the following simple test (in Python):
>
>   mesh = UnitSquare(3, 3)
>   new_mesh = refine(mesh)
>
> This generates the following output:
>
>   Mesh empty constructor: this = 11fb880
>   Mesh empty constructor: this = c03f63c0
>   Calling uniform refinement free function: mesh = 11fb880
>   Mesh empty constructor: this = c03f6160
>   Mesh assignment operator: this = c03f63c0
>   Mesh destructor: this = c03f6160
>   Mesh copy constructor: this = 21eefb0
>   Mesh assignment operator: this = 21eefb0
>   Mesh destructor: this = c03f63c0
>   Mesh destructor: this = 21eefb0
>   Mesh destructor: this = 11fb880
>
> I would have expected to see two constructors, two destructors and
> zero copy constructors, but one extra mesh seems to be created.

This should be fixed now. The above test now creates the following output:

  Mesh empty constructor: this = 189e0c0
  Mesh empty constructor: this = 1889af0
  Calling uniform refinement free function with output argument: mesh = 189e0c0
  Mesh destructor: this = 1889af0
  Mesh destructor: this = 189e0c0

--
Anders

Attachment: signature.asc
Description: Digital signature


References