mabarnes / moment_kinetics

Other
2 stars 4 forks source link

source_terms!(), source_terms_neutral!() use distributed MPI derivatives #144

Closed johnomotani closed 10 months ago

johnomotani commented 10 months ago

Previously source_terms!() and source_terms_neutral!() were using the derivative!() function for z-derivatives. This is an error because derivative!() does not include communication between different shared-memory blocks. Mistake introduced in 1d-2d merge.

Instead, use the already-calculated moment derivatives. This slightly changes the way the derivatives are calculated, e.g. (n*du/dz + u*dn/dz) instead of d(n*u)/dz.