dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #20883
Re: GenericTensor and shared_ptr
-
To:
dolfin@xxxxxxxxxxxxxxxxxxx
-
From:
"Garth N. Wells" <gnw20@xxxxxxxxx>
-
Date:
Fri, 21 Jan 2011 09:15:41 +0000
-
In-reply-to:
<20110121091242.GB362@eowyn>
-
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7
On 21/01/11 09:12, Anders Logg wrote:
> On Thu, Jan 20, 2011 at 03:36:09PM -0800, Johan Hake wrote:
>> On Thursday January 20 2011 15:23:07 Anders Logg wrote:
>>> B1;2600;0cOn Thu, Jan 20, 2011 at 09:56:39AM -0800, Johan Hake wrote:
>>>> It turns out that SWIG has introduced a regression wrt shared ptr
>>>> handling in its 2.0.0 release. The bug causes things like
>>>> GenericMatrix.data() to not work, as it expects a GenericMatrix but gets
>>>> a subclass. So basically the swig handled upcast algorithm is screwed.
>>>> See buildbots for error message...
>>>>
>>>> I have to file a bug for this and try to fix it upstream. Possible
>>>> solutions
>>>>
>>>> are:
>>>> 1) Force people to downgrade SWIG to 1.3.40 until a fix excist
>>>> 2) Remove shared_ptr handling of GenericTensors until fix excist
>>>> 3) Trye to hack a fix fox this for the moment (I tried once and it did
>>>> not
>>>>
>>>> work...)
>>>>
>>>> I reluctantly vote for 2.
>>>
>>> I vote for (2) too.
>>>
>>> (1) sounds problematic and if you didn't manage to do (3), there's
>>> little chance someone else will. :-)
>>
>> The fourth option might also work. As the error only turns up when a matrix is
>> down_casted. This does not happen very often (if ever?) in user code.
>>
>> So:
>>
>> data = A.data()
>>
>> works, but:
>>
>> A = down_cast(A)
>> data = A.data()
>>
>> does not. We test this in the la unit test. We can just turn that test off?
>
> Sounds good. We can add a comment on why the test is commented out.
>
Sounds good to me.
Garth
> --
> Anders
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help : https://help.launchpad.net/ListHelp
References