Crash when using setIncludeSpecular(True) with magnetic layer
When trying to include the specular beam in a GISAS simulation that includes magnetic layers BornAgain Crashes with the error message:
terminate called after throwing an instance of 'std::runtime_error' what(): Error in runComputations: At least one simulation thread has terminated unexpectedly. Messages: ILayerRTCoefficients::getScalarR(): coefficients are not scalar. Aborted Looks like the specular part of simulation tries to use unpolarized calculations for the optical coefficients.
BornAgain Version 1.19.0 both on Windows and Linux. A minimum example to reproduce: ba_bug_magnetic_specular.py