BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularStrategyBuilder Class Reference
Collaboration diagram for SpecularStrategyBuilder:

Static Public Member Functions

static std::unique_ptr< ISpecularStrategybuild (const MultiLayer &sample, const bool magnetic)
 

Detailed Description

Definition at line 21 of file SpecularStrategyBuilder.h.

Member Function Documentation

◆ build()

std::unique_ptr< ISpecularStrategy > SpecularStrategyBuilder::build ( const MultiLayer sample,
const bool  magnetic 
)
static

Definition at line 22 of file SpecularStrategyBuilder.cpp.

24 {
25  auto roughnessModel = sample.roughnessModel();
26 
27  if (magnetic) {
28  if (roughnessModel == RoughnessModel::TANH || roughnessModel == RoughnessModel::DEFAULT) {
29 
30  return std::make_unique<SpecularMagneticNewTanhStrategy>();
31 
32  } else if (roughnessModel == RoughnessModel::NEVOT_CROCE) {
33 
34  return std::make_unique<SpecularMagneticNewNCStrategy>();
35 
36  } else
37  throw std::logic_error("Invalid roughness model");
38 
39  } else {
40  if (roughnessModel == RoughnessModel::TANH || roughnessModel == RoughnessModel::DEFAULT) {
41  return std::make_unique<SpecularScalarTanhStrategy>();
42 
43  } else if (roughnessModel == RoughnessModel::NEVOT_CROCE) {
44 
45  return std::make_unique<SpecularScalarNCStrategy>();
46 
47  } else
48  throw std::logic_error("Invalid roughness model");
49  }
50 }
RoughnessModel roughnessModel() const
Definition: MultiLayer.h:83

References MultiLayer::roughnessModel().

Referenced by anonymous_namespace{ProcessedSample.cpp}::CreateFresnelMap(), and SpecularComputation::SpecularComputation().

Here is the call graph for this function:

The documentation for this class was generated from the following files: