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

Replacement for Function::Operator[+-*/]?

0 votes

Before the 2017.1.0 release, I could use the following code to quickly take the difference of two functions in the C++ interface:

Function u2(V2), u02(V2), diff2(V2);  
u2.interpolate(u); // interpolate u to V2
u02.interpolate(*u0); // interpolate u0 V2

diff2 = u2-u02; // compute the difference

This is useful, for example, for computing norms of the difference between an exact solution and computed one in a higher-order (or finer mesh) space. This release removed the Function::Operator- routine, and it's not so obvious how to most elegantly replace this line of code. What's the "right" replacement?

asked May 31, 2017 by scottmaclachlan FEniCS Novice (120 points)
...