Skip to content
Snippets Groups Projects
Commit bd1c3a85 authored by Beerwerth, Randolf's avatar Beerwerth, Randolf
Browse files

Add Nevot-Croce roughness model

parent fdafa8e2
No related branches found
No related tags found
No related merge requests found
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Multilayer/SpecularMatrix.cpp
//! @brief Implements class SpecularMatrix.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#include "SpecularScalarNCStrategy.h"
#include "KzComputation.h"
#include "Layer.h"
#include "LayerRoughness.h"
#include "MathConstants.h"
#include "MathFunctions.h"
#include "Slice.h"
#include <Eigen/Dense>
#include <stdexcept>
#include <valarray>
Eigen::Vector2cd SpecularScalarNCStrategy::transition(complex_t kzi, complex_t kzi1, double sigma, double thickness,
const Eigen::Vector2cd& t_r1) const
{
complex_t roughness_diff = 1;
complex_t roughness_sum = 1;
if (sigma > 0.0) {
roughness_diff = exp( - (kzi1 - kzi) * (kzi1 - kzi) * sigma * sigma / 2. );
roughness_sum = exp( - (kzi1 + kzi) * (kzi1 + kzi) * sigma * sigma / 2. );
}
const complex_t phase_shift = exp_I(kzi * thickness);
const complex_t kz_ratio = kzi1 / kzi;
const complex_t a00 = 0.5 * ( 1. + kz_ratio ) * roughness_diff;
const complex_t a01 = 0.5 * ( 1. - kz_ratio ) * roughness_sum;
Eigen::Vector2cd result;
result << (a00 * t_r1(0) + a01 * t_r1(1)) / phase_shift,
(a01 * t_r1(0) + a00 * t_r1(1)) * phase_shift;
return result;
}
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Core/Multilayer/SpecularMatrix.h
//! @brief Defines namespace SpecularMatrix.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef SPECULARSCALARNCSTRATEGY_H
#define SPECULARSCALARNCSTRATEGY_H
#include "SpecularScalarStrategy.h"
class Slice;
//! Implements method 'execute' to compute refraction angles and transmission/reflection
//! coefficients for coherent wave propagation in a multilayer.
//! @ingroup algorithms_internal
class SpecularScalarNCStrategy : public SpecularScalarStrategy
{
public:
private:
virtual Eigen::Vector2cd transition(complex_t kzi, complex_t kzi1, double sigma, double thickness,
const Eigen::Vector2cd& t_r1) const override;
};
#endif // SPECULARSCALARNCSTRATEGY_H
......@@ -32,7 +32,7 @@ std::unique_ptr<ISpecularStrategy> SpecularStrategyBuilder::build(const MultiLay
} else if (roughnessModel == "nc" || roughnessModel == "nevot-croce") {
throw std::runtime_error("Nevot-Croce not yet implemented");
return std::make_unique<SpecularScalarNCStrategy>();
} else if (roughnessModel == "tanh") {
return std::make_unique<SpecularScalarTanhStrategy>();
......
......@@ -19,7 +19,7 @@
#include "MultiLayer.h"
#include "MultiLayerUtils.h"
#include "SpecularMagneticStrategy.h"
#include "SpecularScalarStrategy.h"
#include "SpecularScalarNCStrategy.h"
#include "SpecularScalarTanhStrategy.h"
class SpecularStrategyBuilder
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment