On Saturday 14 February 2009 13:48:05 A Navaei wrote:
It seems that the error can be re-produced even without sub-classing
and using existing dolfin classes in pure c++. Based on the
itk-dolfin interface code, the below minimal code should generate the
error (note that I use the binary distribution which uses std::tr1,
replacing it with boost shared pointer should not have any effect).
Not in c++ but swig only support std::tr1::shared_ptr from version
1.3.37. But if you intend to use shared_ptr only internally there
whould not be any problems.
After wrapping in python:
(1) Calling FunctionTest.CreateFunction(), which returns by value,
results this error:
RuntimeError: *** Error: Unable to assign to function, missing
coefficients (user-defined function).
You cannot assign another user-defined function to another Function.
It must be a discrete function, which has an initialized _vector. This
is probably a feature that other developers should answer for.
However this means that you cannot copy a userdefined function, with
the side effect of not beeing able to return a user-defined Function
by value.
Since dolfin::Function does come with the required copy ctors, the
problem cannot be stemmed from this.
This use the assignment operator which requires the Function to be a
discrete and not a user-defined Function.
I consider this to be a bug in the library. Any other comments from
the C++ DOLFIN developers (I am mostly dealing with the python
interface)?