vpic icon indicating copy to clipboard operation
vpic copied to clipboard

VPIC crashes if the decomposition leaves the grid size as nx/ny/nz=1

Open rfbird opened this issue 5 years ago • 1 comments

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.

rfbird avatar Sep 05 '18 18:09 rfbird

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

rfbird avatar Sep 24 '18 15:09 rfbird