### Interpolate solution in a point that is not a vertex

212

views

0

I have compute the solution of the elastic acoustic wave equation in a 2D domain using P1 basis. I would like to get the (interpolated) value of the solution in a point x_p that does not coincide with a vertex. How can I do that? I don't know if there exist some authomatized options to (1) find to which triangle to point x_p belongs to, (2) find the 3 vertices that belong to that triangle, (3) interpolate the solutions at those vertices to get the solution in x_p.

Thank you for your help!

Thank you for your help!

Community: FEniCS Project

### 1 Answer

4

Can you simply try

Yes, thank you. I thought it was much more complicated than this!! Especially because I am solving the system for a variable (acceleration), but I am interested in another value (displacement) that I derive from it (see below). I thought that because of this projection I had to do some tricky workaround... even better like this :)

```
P = Point(np.array((0.0, 1.0))
value = MySolution(P)
print value
```

Let me know if it doesn't work.

written
10 months ago by
caterinabig

Please login to add an answer/comment or follow this question.