### How to interpolate product of functions using LagrangeInterpolate?

37

views

0

For some reason I have to use LagrangeInterpolate.interpolate() for function interpolation (possible in parallel), and I have some problems with interpolating functions. Everything is OK if I interpolate functions from one function space to another but the problems occurs if I try to interpolate some operations on functions. For example:

At the same time

```
V = FunctionSpace(mesh, 'P', 2)
V2 = FunctionSpace(mesh, 'P', 1)
u is a solution of some problem
u_int = Function(V2)
LagrangeInterpolator.interpolate(u_int, u)
```

works perfectly, but```
V = FunctionSpace(mesh, 'P', 2)
V2 = FunctionSpace(mesh, 'P', 1)
u is a solution of some problem and then we make some operations on u like
c = u * u
c_int = Function(V2)
LagrangeInterpolator.interpolate(c_int, c)
```

doesnt work.At the same time

```
V = FunctionSpace(mesh, 'P', 2)
V2 = FunctionSpace(mesh, 'P', 1)
u is a solution of some problem and then we make some operations on u:
c = u * u
c_project = project(c, V2)
```

works normaly.
Community: FEniCS Project

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