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

Interpolate function at a point which is not a node or vertix

0 votes

Hello All,

How does one evaluate a function at a particular point that is not a node or a vertix.

For example, after solving for u, I would like to evaluate u(x,y,z) where [x,y,z] is not a node or vertix point.

Thanks,

Victor

asked Aug 6, 2016 by wtpot FEniCS Novice (450 points)

1 Answer

0 votes

It's simple, in the beta document, it shows

Given a Function object u, we can evaluate its values in various ways:
1. u(x) for an arbitrary point x
2. u.vector().array()[i] for degree of freedom number i
3. u.compute_vertex_values()[i] at vertex number i
The first method, though very flexible, is in general expensive while the other two are very efficient (but limited to certain points) .

answered Aug 6, 2016 by sejabs FEniCS Novice (330 points)
...