It might be that CMake does not recognize that you changed the .h files and
hence did not trigger reswigging.
Try
make generate_swig_interface
make && make install
Johan
On Dec 22, 2013 12:37 AM, "Myles English" <[email protected]> wrote:
> Hello,
>
> Can someone please give me hint about where to look to fix this? I am
> trying
> to test matrix A in Python and part of the code is:
>
> A.sum_rows(t)
> A.set_diagonal(t)
>
> but exits with:
>
> "AttributeError: 'Matrix' object has no attribute 'set_diagonal'". Do I
> need
> to add something to a Swig interface file? I don't understand why it does
> not
> fail at the sum_rows line because I added the two functions in all the same
> places:
>
> GenericMatrix.h:
>
> /// Fill vector with row sums of matrix
> virtual void sum_rows(GenericVector& x) const = 0;
>
> /// Set to values of vector the diagonal of a matrix
> virtual void set_diagonal(const GenericVector& x) = 0;
>
> Matrix.h:
>
> virtual void sum_rows(GenericVector& x) const { matrix->sum_rows(x); }
> virtual void set_diagonal(const GenericVector& x) {
> matrix->set_diagonal(x); }
>
> PETScMatrix.h:
>
> virtual void sum_rows(GenericVector& x) const;
> virtual void set_diagonal(const GenericVector& x);
>
> PETScMatrix.cpp
>
> void PETScMatrix::set_diagonal(const GenericVector& x){CODE HERE}
> void PETScMatrix::sum_rows(GenericVector& x) const{CODE HERE}
>
> Thanks.
> _______________________________________________
> fenics mailing list
> [email protected]
> http://fenicsproject.org/mailman/listinfo/fenics
>
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics