vpic
vpic copied to clipboard
VPIC crashes if the decomposition leaves the grid size as nx/ny/nz=1
This is obviously not a very likely scenario, as we run on meshes much bigger than this, but it may be a useful case for testing computational intensive modules (and writing unit tests etc).
The crux of the problem seems to come down to a check that, for each dimension, does:
const float px = (nx>1) ? g->rdx : 0;
If n_=1
it will set p_
to be 0. This is then used in a division (alphadt = 0.3888889/( px*px + py*py + pz*pz );
) so inf/nans
propagates throughout anything that touches the fields.
This is because this calculation uses local grid size (nx
) instead of global. Should be an easy fix is the proc has access to global nx size