BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ParticleLayoutContribution.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sim/Contrib/ParticleLayoutContribution.cpp
6 //! @brief Implements class ParticleLayoutContribution.
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 
21 
22 namespace {
23 
24 std::unique_ptr<IInterparticleStrategy> processedInterference(const reLayout& re_layout,
25  const SimulationOptions& sim_params,
26  bool polarized)
27 {
28  const IInterference* iff = re_layout.interferenceFunction();
29 
30  const std::vector<std::unique_ptr<const CoherentFFSum>>& weighted_formfactors =
31  re_layout.formfactorList();
32 
33  const auto* radial_para = dynamic_cast<const InterferenceRadialParaCrystal*>(iff);
34  if (radial_para)
35  if (double kappa = radial_para->kappa(); kappa > 0.0)
36  return std::make_unique<SSCAStrategy>(weighted_formfactors, radial_para, sim_params,
37  polarized, kappa);
38 
39  return std::make_unique<DecouplingApproximationStrategy>(weighted_formfactors, iff, sim_params,
40  polarized);
41 }
42 
43 } // namespace
44 
45 
47  const SimulationOptions& options,
48  bool polarized)
49  : m_layout(layout)
50  , m_interparticle_strategy(processedInterference(layout, options, polarized))
51 {
52 }
53 
55 
57 {
59 }
Defines class DecouplingApproximationStrategy.
Defines class DiffuseElement.
Defines class InterferenceRadialParaCrystal.
Defines class ParticleLayoutContribution.
Defines class reLayout.
Defines class SSCAStrategy.
Data stucture containing both input and output of a single detector cell.
void addIntensity(double intensity)
Abstract base class of interference functions.
Definition: IInterference.h:24
Interference function of radial paracrystal.
const std::unique_ptr< const IInterparticleStrategy > m_interparticle_strategy
void compute(DiffuseElement &ele) const
ParticleLayoutContribution(const reLayout &re_layout, const SimulationOptions &options, bool polarized)
Collect the different options for simulation.SimulationOptions.
Data structure that contains preprocessed data for a single layout.
Definition: ReLayout.h:36
const IInterference * interferenceFunction() const
Definition: ReLayout.h:50
const std::vector< std::unique_ptr< const CoherentFFSum > > & formfactorList() const
Definition: ReLayout.h:46
double surfaceDensity() const
Definition: ReLayout.h:45