This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

So, what would be the C++ equivalent of f1.vector().array()?

0 votes

So, what would be the C++ equivalent of f1.vector().array()? I.e., what C++ statement should I exactly use to obtain the underlying array of values from f1 (in the case of this example), presuming that f1 is a function, that has been used to store the solution from a solve statement?

related to an answer for: How to sum functions?
asked May 26, 2017 by hbinzubair FEniCS Novice (250 points)

1 Answer

0 votes

You want Function::vector() to access the underlying vector, then you'll need to use get_local() on that to obtain the values (if the whole Function is owned by the process you are using these in).

answered May 28, 2017 by mdbenito FEniCS User (4,530 points)
...