Project vs. Interpolate with Sqrt

Using the elasticity tutorial as an example, available at the link below, I noticed that if you replace ‘project’ with ‘interpolate’, you get the following error when a ‘sqrt’ is present in the expression.

self._cpp_object.interpolate(u)
AttributeError: ‘Sqrt’ object has no attribute ‘_cpp_object’

Is this expected behavior, or have I misunderstood the use of ‘interpolate’?
Edit: The projection/interpolation is applied to the von mises stress, on line 64 of the tutorial script.

Old DOLFIN doesn’t support interpolation of UFL forms. The _cpp_object error is encountered because the interpolate() function is expecting a dolfin.Function, dolfin.Coefficient or dolfin.Expression type. Not a ufl type.

1 Like

Thanks, Nate. Appreciate the clarification

1 Like