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

Is it possible to add functions which are defined in separate function spaces

0 votes

Hello,

I am currently working on a strategy to iteratively solve two subdomain problems which exchange data at each iteration along the interface between the two subdomains.

At the ith iteration, in subdomain 1, I have a function g1_i and a function that stores the solution from the previous iteration u1_i.

In subdomain 2, I have g2_i and u2_i.

At the interface, I would like to advance the gs by computing

g1_i+1 = -g2_i + 2pu2_i
g2_i+1 = -g2_i + 2pu1_i,

where p is a scalar constant.

Note that I only care about this at the interface since the gs get applied as a surface integral there. If I define g1, g2 over their whole subdomains, I have found out that I cannot simply do for example: project(-g2_i + 2pu2_i, V1), since g2 and u2 were defined in a function space V2. When I try this, I get the error

*** Error: Unable to evaluate function at point.
*** Reason: The point is not inside the domain. Consider calling "Function::set_allow_extrapolation(true)" on this Function to allow extrapolation.

Is there another way to accomplish this?

Thanks,
Ben

asked Oct 8, 2015 by brk888 FEniCS Novice (990 points)
...