- #1
Heimdall
- 42
- 0
Hi,
I have a random grid, meaning that each cell consists of a random number. I need to evaluate the gradient.
I've tried to apply a basic Euler formula (u_(i+1) - u_(i-1))/2dx but since the values can fluctuate a lot, fluctuations are even stronger for the gradient...
I'm thinking about using a "smoother" method like a five point stencil, which could be better to avoid strong fluctuations... but then I can't find out how to deal with grid boundaries (for Euler method I use (u_(i+1)-u(i))/dx or (u_(i)-u_(i-1))/dx )
How would you do, is there a specific method for this kind of problem ?
Thanks a lot
I have a random grid, meaning that each cell consists of a random number. I need to evaluate the gradient.
I've tried to apply a basic Euler formula (u_(i+1) - u_(i-1))/2dx but since the values can fluctuate a lot, fluctuations are even stronger for the gradient...
I'm thinking about using a "smoother" method like a five point stencil, which could be better to avoid strong fluctuations... but then I can't find out how to deal with grid boundaries (for Euler method I use (u_(i+1)-u(i))/dx or (u_(i)-u_(i-1))/dx )
How would you do, is there a specific method for this kind of problem ?
Thanks a lot