Skip to content

fix bvector += bindings

Right now for the += and -= operators of the Python bindings of the block vectors fail for me with the message:

TypeError: Unregistered type : Dune::Imp::block_vector_unmanaged<Dune::FieldVector<double, 1>, unsigned long>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/duneci/modules/dune-istl/dune/python/test/bcrsmatrix.py", line 149, in <module>
    q+=q
TypeError: Unable to convert function return value to a Python type! The signature was
        (self: dune.istl._istl.BlockVector, arg0: dune.istl._istl.BlockVector) -> Dune::Imp::block_vector_unmanaged<Dune::FieldVector<double, 1>, unsigned long>

This MR adds a test and fixes the bindings. @andreas.dedner hopefully this will be a fast MR? I don't know why the cls.def( pybind11::self += pybind11::self ); did not do the right thing :/

Edited by Alexander Müller

Merge request reports