dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #18027
[Blueprint stl-vectors-la] Use std::vector in la interface in place of pointers
Blueprint changed by Garth Wells:
Whiteboard changed:
+ Summary (GNW): Use std::vector or dolfin::Array in la interface,
+ depending on which is appropriate.
+
+
Implications for PyDOLFIN:
Using std::vectors instead of double* in exchanging data will force us to copy data in the python interface. Sometimes this is OK but sometimes we loose functionality, for example copying Mesh::coordinates does not make sense.
When do we copy Mesh::coordinates into a Vector?
JH: Never(?) I misinterpreted the design suggestion to change all
argument handling from double * to std::vector. (Mesh::coordinates might
still be a bad example for this :P)
GNW: I suggest that we use dolfin::Array. This provides safety and a
simple interface to Python.
Logg: Yes. I think we should just change to Array everywhere. (comment
grabbed from email list)
The only problem is it requires some work since we have used std::vector
in quite a few places. I count ca 150 occurences of std::vector in the
C++ interface.
JH: I agree with Garth. The Blueprint is about using std::vector in the
LA interface, not the whole DOLFIN interface. I think that discussion
should be taken in the Array typemap blueprint. As pointed out in that
blueprint, we have not yet solved the issue when an std::vector (Array)
need to be resized. For this situation std::vector suites us quite well
at the moment.
--
Use std::vector in la interface in place of pointers
https://blueprints.launchpad.net/dolfin/+spec/stl-vectors-la