BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularScalarStrategy.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Specular/SpecularScalarStrategy.h
6 //! @brief Defines class SpecularScalarStrategy.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_CORE_MULTILAYER_SPECULARSCALARSTRATEGY_H
16 #define BORNAGAIN_CORE_MULTILAYER_SPECULARSCALARSTRATEGY_H
17 
20 #include <memory>
21 #include <vector>
22 
23 class Slice;
24 
25 //! Implements the scalar Fresnel computation
26 //!
27 //! Implements method 'execute' to compute refraction angles and transmission/reflection
28 //! coefficients for coherent wave propagation in a multilayer.
29 //!
30 //! Inherited by SpecularScalarNCStrategy, SpecularScalarTanhStrategy
31 //!
32 //! @ingroup algorithms_internal
34 {
35 public:
36  //! Computes refraction angles and transmission/reflection coefficients
37  //! for given coherent wave propagation in a multilayer.
38  virtual ISpecularStrategy::coeffs_t Execute(const std::vector<Slice>& slices,
39  const kvector_t& k) const override;
40 
41  virtual ISpecularStrategy::coeffs_t Execute(const std::vector<Slice>& slices,
42  const std::vector<complex_t>& kz) const override;
43 
44 private:
45  virtual std::pair<complex_t, complex_t> transition(complex_t kzi, complex_t kzi1,
46  double sigma) const = 0;
47 
48  std::vector<ScalarRTCoefficients> computeTR(const std::vector<Slice>& slices,
49  const std::vector<complex_t>& kz) const;
50 
51  static void setZeroBelow(std::vector<ScalarRTCoefficients>& coeff, size_t current_layer);
52 
53  void calculateUpFromLayer(std::vector<ScalarRTCoefficients>& coeff,
54  const std::vector<Slice>& slices,
55  const std::vector<complex_t>& kz) const;
56 };
57 
58 #endif // BORNAGAIN_CORE_MULTILAYER_SPECULARSCALARSTRATEGY_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines and implements class ISpecularStrategy.
Defines class ScalarRTCoefficients.
Interface for the Fresnel computations, both in the scalar and magnetic case.
std::vector< std::unique_ptr< const ILayerRTCoefficients > > coeffs_t
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:28
Implements the scalar Fresnel computation.
virtual ISpecularStrategy::coeffs_t Execute(const std::vector< Slice > &slices, const kvector_t &k) const override
Computes refraction angles and transmission/reflection coefficients for given coherent wave propagati...
std::vector< ScalarRTCoefficients > computeTR(const std::vector< Slice > &slices, const std::vector< complex_t > &kz) const
virtual std::pair< complex_t, complex_t > transition(complex_t kzi, complex_t kzi1, double sigma) const =0
void calculateUpFromLayer(std::vector< ScalarRTCoefficients > &coeff, const std::vector< Slice > &slices, const std::vector< complex_t > &kz) const
static void setZeroBelow(std::vector< ScalarRTCoefficients > &coeff, size_t current_layer)