Reaction Diffusion in 3D

Asked by Doug White on 2011-09-01


I am trying to solve a reaction diffusion equation at steady state. This solution generally becomes the Poisson equation. Normally, f can be a function of the spatial variables f(x,y,z). In my specific case this represents the reaction term in my reaction diffusion equation. How can I specify a f that varies with space? I have tried creating a data object with a rank of three to hold all of these values, however this gives me an error saying that the "Expected shape of coefficient is () but actual shape is (25L, 25L, 25L)". Am I just defining my data-set incorrectly?

Question information

English Edit question
esys-escript Edit question
No assignee Edit question
Solved by:
Doug White
Last query:
Last reply:
Lutz Gross (l-gross) said : #1

I assume that you are trying to define f as numpy array of dimension 25^3 as you use a 25^3. In fact escript reads as a 25^3 array to be used on each mesh point but expecting - as you solve the Poisson equation - a scalar value for each mesh point. hence the error message. How do you populate f? is this through a call of "complex" python at each mesh point? In this case you may want to have look at (I don't really like the option suggested there which is the reason why there is no documentation about this). If this does not solve your problem I need more info about how you set f.

Doug White (dewtennis222) said : #2

I looked at this problem right before attempting this. I think I understand now. f is only set at one point with the call mypde.setValue(f=1)? The other problem suggests that I have to loop through all of the points on the Poisson mesh and set the f value there. I think this answers my question. Thank you.