← Back to team overview

dolfin team mailing list archive

Re: Accessing Function data after mesh refinement

 


Anders Logg wrote:
> On Fri, Feb 12, 2010 at 04:57:05PM +0100, Anders Logg wrote:
>> On Fri, Feb 12, 2010 at 04:23:51PM +0100, Marie Rognes wrote:
>>> I'm interesting in accessing the vector of a Function after mesh-refinement.
>>> At the moment, I'm getting:
>>>
>>>    RuntimeError: *** Error: You are attempting to access a non-const
>>>    vector from a sub-Function.
>>>
>>> Is this inevitable, a bug or a trigger-happy error message?
>>>
>>>    from dolfin import *
>>>    mesh = UnitSquare(2,2)
>>>    V = FunctionSpace(mesh, "CG", 1)
>>>    u = Function(V)
>>>    mesh.refine()
>>>    u.vector()
>> Looks like a bug. The function is not being refined but the mesh, the
>> dofmap and the functionspace is refined. Might be related to the
>> recent work on refinement.
> 
> It should be fixed now. Someone had commented out register_object in
> the Function constructor. 

I'm not too keen on all this magic. Harish I and have an adaptive solver
 in which the function spaces are declared inside a loop and it's slowly
leaking memory, but I can't figure out why. 'Magic' makes it really hard
to figure out what's going on.

Garth

> I don't know why. Garth?
> 

I don't remember commenting it out.

Garth

> --
> Anders
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp



Follow ups

References