New issue 61 by and...@astro.lu.se: Bug in shearing boundary conditions?
http://code.google.com/p/pencil-code/issues/detail?id=61
The way I see it there is a bug in the shearing boundary conditions. I
discovered this because the code crashes when shock is initialized to
impossible (i.e. 1e37 and a bit) when using shear-periodic boundary
condition.
The main problem is that when we set shear-periodic boundary conditions we
interpolate the data from only two processors at the other side of the box.
In the example below we want to set the crosses and realise that we need to
match them with data from the dots:
-----------------
| .|
| .|
| .|
-----------------
| .|
| .|
| .|
-----------------
x| |
x| |
x| |
-----------------
| |
| |
| |
-----------------
Unfortunately in general the crosses will need data from three CPUs rather
than two, because of the interpolation. Therefore the current
implementation lets the dots take the y and z boundary conditions along.
However, this is where the problem lies: we set x boundary conditions
*before* y boundary conditions. Therefore the y-boundaries are one
time-step behind when we use them for the shearing x-boundaries. And if we
are at time-step zero and initialize the data to impossible, then the code
crashes.
Anders should add a sample which crashes because of this bug!