# Reaction Diffusion in 3D

Hi,

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

- Language:
- English Edit question

- Status:
- Solved

- Assignee:
- No assignee Edit question

- Solved by:
- Doug White

- Solved:
- 2011-09-02

- Last query:
- 2011-09-02

- Last reply:
- 2011-09-02

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 https:/

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(