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

Compute the product of two dolfin::Function (s)

+1 vote

Hi!
I have given a dolfin::Function , let's name it u.
Now I would like to compute N(u) = u^3. Is this possible and how?

I am programming in c++

I am very thankful for any help.
frieder

asked Jan 5, 2017 by frieder FEniCS Novice (340 points)

1 Answer

0 votes

You can do it by defining a Form in ufl
e.g.

v = TestFunction(FE)
u = Coefficient(FE)
N = TrialFunction(FE)
a = u**3*v*dx
F = N*v*dx

Then you assign your 'u' to 'a' and solve a == F for your function N.

answered Jan 16, 2017 by str FEniCS User (1,600 points)
...