For correct computation of mean refractive index, no longer allow embedding particles in the semi-infinite top layer
|Status:||Resolved||Start date:||19 Oct 2016|
|Target version:||Sprint 33|
As explained in the new Manual section »Wave propagation and scattering contributions« in chapter »Particle Assemblies«, wave propagation in a decorated layer depends on the mean refractive index, which must be computed as an average over contributions from the matrix and from the embedded particles, weighted with their respective volume fractions. This computation is impossible if particles are embedded in the semi-infinite top layer.
This is an urgent bug because it implies that many computations done with BornAgain are inaccurate.
To work around, we could correct all examples that have particles in the top layer by adding a decorated-air layer and moving the particle layout there.
In perspective, however, we should change the core API to preclude any particle decoration of the semi-infinite top and bottom layers. By the same token, we should simplify the API: multilayer constructors should already set a top and a bottom layer (or a uniform embedding medium for the SAS case). Users should only add finite layers in between.
#1 Updated by herck about 4 years ago
The mean refractive index in the semi-infinite top layer is the refractive index of the top layer (volume fraction of particles is zero). So no issue with the top layer. The same argument applies for the bottom layer.
Furthermore, using the average refractive index as the zeroth order is just a choice, even it is likely to produce better results. This means that our current approximation, using the layer refractive index as the zeroth order background, is not incorrect.
As for the API change, this should be discussed separately.
#6 Updated by herck over 3 years ago
- Status changed from New to Resolved
- Assignee set to herck
- Target version set to Sprint 33
When the user enables the usage of the mean refractive index without explicitly setting the number of slices for a layer, an extra layer will be generated automatically for the semi-infinite layers if needed (if they contain particles).