Why do we have separate kernels for “with gravity,” and “without gravity”? Can we just default the value for gravityField[dim-1] as equal to zero, and have it changed if so desired?
Or rather default all values in the gravityField Array to zero, and only set the final one to 9.80665 m/s**2 or whatever is so defined by the user when requested?
The kernels are associated with the values in the auxiliary field. The integration routines are not designed to just pass in zero values when auxiliary fields aren’t present (it wouldn’t know where to put the zeros). Carrying around extra values in the auxiliary field (gravity field, body force, reference stress/strain) will generally significantly increase the storage requirements. It is much more efficient to just not have the gravity field present and skip those kernels when a gravity field is not used.