← Back to team overview

dolfin team mailing list archive

Vector conclusions

 

Hello!

A lot has happened on the Vector/Function/<backend>Vector interface the last weeks. For clarity, I would like to have a little "summing up" thread. That is, I think it would be beneficial to explicitly show how the new interface is intended to be used. Sounds good? Here are some situations, to which I propose solutions. Please correct if these are not in line with the intended interface, or if there are better ones.

How to:
*) Get reference to Vector from a (discrete) Function u
Vector& v = dynamic_cast<Vector&>(u.vector());

*) Get reference to uBlasVector from Vector v:
uBlasVector& uv = dynamic_cast<uBlasVector&>(*v.instance());

*) Get reference to PETScVector from Vector:
???

*) Get reference to uBlasVector from (discrete) Function u
uBlasVector& uv = dynamic_cast<uBlasVector&>(*u.vector().instance());

*) Get reference to PETScVector from (discrete) Function u
???

Please add more situations and suggestions. Thanks!

/Dag


Follow ups