diff --git a/CHANGELOG b/CHANGELOG index 468daf27908183e2387b825bc2397aed03305f10..cfef3f883f358f3e4e4b0818efe937544e670d00 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,12 +12,14 @@ BornAgain-21.0, in preparation * Reorganize GUI/Model subdirectories, break cyclic dependence of GrazingScanItem on InstrumentItem (#566) -BornAgain-20.1, released 2023.04.28 +BornAgain-20.1, released 2023.05.02 > Hotfix: * Correct polarized specular computation without user provided pol matrices (#549) * Correct prefactor for scattering from rough interfaces (k^4, not k^2, #553) + * Show SLD units in GUI (#558) * Throw error if rough interfaces are combined with polarized simulation (#564) * Repair GUI support for angular grazing scans (#574) + * Consistently mention K-correlation model which is really used for roughness (#581) > Dependencies * Adapt to libheinz-1.1.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 75ee8b7e4fc09bf2d2c7e7c88b5101961977d294..e29bdbce01bfb58a1e884d241b3df18f443f9670 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ include(commons/PreventInSourceBuilds) ### Project settings project(BornAgain - VERSION 20.0 + VERSION 20.1 DESCRIPTION "BornAgain: simulate and fit reflectometry and grazing-incidence scattering." HOMEPAGE_URL https://www.bornagainproject.org LANGUAGES CXX) diff --git a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp index aff2b452a78638f3e75e1bae95bf340a9649a334..b6190564657b5399681b0ead823615fd76e64395 100644 --- a/GUI/View/SampleDesigner/MaterialInplaceForm.cpp +++ b/GUI/View/SampleDesigner/MaterialInplaceForm.cpp @@ -24,6 +24,7 @@ #include "GUI/View/Numeric/DoubleSpinBox.h" #include "GUI/View/SampleDesigner/LayerEditorUtil.h" #include "GUI/View/SampleDesigner/SampleEditorController.h" +#include "GUI/View/SampleDesigner/SampleForm.h" #include "GUI/View/Tool/Globals.h" #include "GUI/View/Tool/LayoutUtil.h" #include <QGridLayout> @@ -74,6 +75,7 @@ void MaterialInplaceForm::selectMaterial() createWidgets(); connect(itemWithMaterial()->materialItem(), &MaterialItem::dataChanged, this, &MaterialInplaceForm::onMaterialChanged); + m_ec->sampleForm()->updateUnits(); // necessary on switch from refractive index to SLD } else { updateValues(); // necessary, since in the material editor the values could have been // changed without selecting a different material diff --git a/Sample/Interface/LayerRoughness.cpp b/Sample/Interface/LayerRoughness.cpp index eb66aec285abb4d7e91ed29df48728f9eb8a42ac..42e026d21d76906c16d49b771611f58806d4437c 100644 --- a/Sample/Interface/LayerRoughness.cpp +++ b/Sample/Interface/LayerRoughness.cpp @@ -16,6 +16,7 @@ #include "Base/Math/Constants.h" #include "Base/Py/PyFmt.h" #include "Base/Util/Assert.h" +#include <boost/math/special_functions/bessel.hpp> //! Constructor of layer roughness. //! @param sigma: rms of the roughness in nanometers @@ -40,8 +41,7 @@ LayerRoughness::LayerRoughness() //! Fourier transform of the correlation function of the roughness profile. //! //! Based on the article -//! D.K.G. de Boer, Physical review B, Volume 51, Number 8, 15 February 1995 -//! "X-ray reflection and transmission by rough surfaces" +//! Palasantzas, Phys Rev B, 48, 14472 (1993) /* ************************************************************************* */ double LayerRoughness::spectralFunction(const R3 kvec) const { @@ -54,14 +54,14 @@ double LayerRoughness::spectralFunction(const R3 kvec) const } //! Correlation function of the roughness profile - double LayerRoughness::corrFunction(const R3 k) const { ASSERT(m_validated); double H = m_hurstParameter; double clength = m_lateralCorrLength; double R = sqrt(k.x() * k.x() + k.y() * k.y()); - return m_sigma * m_sigma * std::exp(-1.0 * std::pow(R / clength, 2. * H)); + return m_sigma * m_sigma * std::pow(2., 1. - H) / tgamma(H) * std::pow(R / clength, H) + * boost::math::cyl_bessel_k(H, R / clength); } std::string LayerRoughness::pythonConstructor() const diff --git a/hugo/content/ref/sample/roughness/scattering/index.md b/hugo/content/ref/sample/roughness/scattering/index.md index 38512c46288ef079bf962c2d8b540c3eb850358d..bde0d2c0d1b5bfbc8ad24b0f407772c759fd4599 100644 --- a/hugo/content/ref/sample/roughness/scattering/index.md +++ b/hugo/content/ref/sample/roughness/scattering/index.md @@ -21,7 +21,7 @@ Scattering from a multilayered sample with correlated roughness. **Note:** -The roughness profile is described by a normally-distributed random function. The roughness correlation function at the jth interface is expressed as: $$ < U\_j (x, y) U\_j (x', y')> = \sigma^2 e^{-\frac{\tau}{ξ}2H}, \tau=[(x-x')^2+(y-y')^2]^{\frac{1}{2}}$$ +The roughness profile is described by a normally-distributed random function. The roughness correlation function at the jth interface is expressed as: $$ < U\_j (x, y) U\_j (x', y')> = \sigma^2 \frac{2^{1-H}}{\Gamma(H)} \left( \frac{\tau}{ξ} \right)^H K_H \left( \frac{\tau}{ξ} \right), \tau=[(x-x')^2+(y-y')^2]^{\frac{1}{2}}$$ * $U\_j(x, y)$ is the height deviation of the jth interface at position $(x, y)$. * $\sigma$ gives the rms roughness of the interface. The Hurst parameter $H$, comprised between $0$ and $1$ is connected to the fractal dimension $D=3-H$ of the interface. The smaller $H$ is, the more serrate the surface profile looks. If $H = 1$, the interface has a non fractal nature.