Skip to content
Snippets Groups Projects
Commit 0ecc763d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

new fct SliceStack::bottomRoughness

parent 72f3a9a3
No related branches found
No related tags found
1 merge request!187Minor improvements
......@@ -68,3 +68,10 @@ bool SliceStack::containsMagneticMaterial() const
return slice.material().isMagneticMaterial();
});
}
const LayerRoughness* SliceStack::bottomRoughness(size_t i_slice) const
{
if (i_slice + 1 < size())
return (*this)[i_slice + 1].topRoughness();
return nullptr;
}
......@@ -40,6 +40,7 @@ public:
SliceStack setBField(const kvector_t& externalField);
bool containsMagneticMaterial() const;
const LayerRoughness* bottomRoughness(size_t i_slice) const;
};
#endif // BORNAGAIN_RESAMPLE_SLICE_SLICESTACK_H
......
......@@ -44,13 +44,6 @@ Eigen::Vector2cd checkForUnderflow(const Eigen::Vector2cd& eigenvs)
return {lambda(eigenvs(0)), lambda(eigenvs(1))};
}
const LayerRoughness* GetBottomRoughness(const SliceStack& slices, const size_t slice_index)
{
if (slice_index + 1 < slices.size())
return slices[slice_index + 1].topRoughness();
return nullptr;
}
} // namespace
......@@ -105,7 +98,7 @@ SpecularMagneticStrategy::computeTopLayerR(const SliceStack& slices,
auto c_i = createCoeff(i);
double sigma = 0.;
if (const auto roughness = GetBottomRoughness(slices, i))
if (const auto roughness = slices.bottomRoughness(i))
sigma = roughness->getSigma();
// compute the 2x2 submatrices in the write-up denoted as P+, P- and delta
......@@ -186,7 +179,7 @@ void SpecularMagneticStrategy::calculateUpwards(std::vector<MatrixFlux>& coeff,
for (int i = N - 2; i >= 0; --i) {
double sigma = 0.;
if (const auto roughness = GetBottomRoughness(slices, i))
if (const auto roughness = slices.bottomRoughness(i))
sigma = roughness->getSigma();
// compute the 2x2 submatrices in the write-up denoted as P+, P- and delta
......
......@@ -22,18 +22,6 @@
#include <Eigen/Dense>
#include <stdexcept>
namespace {
const LayerRoughness* GetBottomRoughness(const SliceStack& slices, const size_t slice_index)
{
if (slice_index + 1 < slices.size())
return slices[slice_index + 1].topRoughness();
return nullptr;
}
} // namespace
ISpecularStrategy::coeffs_t SpecularScalarStrategy::Execute(const SliceStack& slices,
const kvector_t& k) const
{
......@@ -71,7 +59,7 @@ SpecularScalarStrategy::computeTopLayerR(const SliceStack& slices,
for (int i = N - 2; i >= 0; i--) {
double sigma = 0.0;
if (const auto roughness = GetBottomRoughness(slices, i))
if (const auto roughness = slices.bottomRoughness(i))
sigma = roughness->getSigma();
const auto [mp, mm] = transition(kz[i], kz[i + 1], sigma);
......@@ -108,7 +96,7 @@ SpecularScalarStrategy::computeTR(const SliceStack& slices, const std::vector<co
std::vector<complex_t> factors(N - 1);
for (int i = N - 2; i >= 0; i--) {
double sigma = 0.0;
if (const auto roughness = GetBottomRoughness(slices, i))
if (const auto roughness = slices.bottomRoughness(i))
sigma = roughness->getSigma();
const auto [mp, mm] = transition(kz[i], kz[i + 1], sigma);
......
......@@ -313,7 +313,7 @@ Calculates the intensity for scalar particles/interactions.
Interface for the Fresnel computations, both in the scalar and magnetic case
Inherited by SpecularScalarStrategy, SpecularMagneticOldStrategy, SpecularMagneticStrategy, SpecularMagneticNewStrategy
Inherited by SpecularScalarStrategy, SpecularMagneticStrategy.
C++ includes: ISpecularStrategy.h
";
......@@ -796,6 +796,9 @@ Adds n times the same slice to the stack.
%feature("docstring") SliceStack::containsMagneticMaterial "bool SliceStack::containsMagneticMaterial() const
";
%feature("docstring") SliceStack::bottomRoughness "const LayerRoughness * SliceStack::bottomRoughness(size_t i_slice) const
";
// File: classSpecularMagneticNCStrategy.xml
%feature("docstring") SpecularMagneticNCStrategy "
......@@ -932,15 +935,6 @@ C++ includes: SSCAStrategy.h
// File: namespace_0d52.xml
// File: namespace_0d54.xml
// File: namespace_0d58.xml
// File: namespace_0d60.xml
// File: namespace_0d8.xml
......
This diff is collapsed.
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.2
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifndef SWIG_libBornAgainResample_WRAP_H_
#define SWIG_libBornAgainResample_WRAP_H_
#include <map>
#include <string>
#endif
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