BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorDWBA.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Scattering/FormFactorDWBA.h
6 //! @brief Defines class FormFactorDWBA.
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_FORMFACTORDWBA_H
16 #define BORNAGAIN_CORE_MULTILAYER_FORMFACTORDWBA_H
17 
19 #include <memory>
20 
22 
23 //! Evaluates the coherent sum of the four DWBA terms in a scalar IFormFactor.
24 //! @ingroup formfactors_internal
25 
26 class FormFactorDWBA final : public IFormFactor
27 {
28 public:
29  FormFactorDWBA(const IFormFactor& form_factor);
30  ~FormFactorDWBA() override;
31 
32  FormFactorDWBA* clone() const override;
33 
34  void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
35 
36  void setAmbientMaterial(const Material& material) override
37  {
38  mP_form_factor->setAmbientMaterial(material);
39  }
40 
41  //! Calculates and returns a form factor calculation in DWBA
42  complex_t evaluate(const WavevectorInfo& wavevectors) const override;
43 
44  double volume() const override { return mP_form_factor->volume(); }
45 
46  double radialExtension() const override { return mP_form_factor->radialExtension(); }
47 
48  double bottomZ(const IRotation& rotation) const override;
49 
50  double topZ(const IRotation& rotation) const override;
51 
52  void setSpecularInfo(std::unique_ptr<const ILayerRTCoefficients> p_in_coeffs,
53  std::unique_ptr<const ILayerRTCoefficients> p_out_coeffs) override;
54 
55  friend class TestPolarizedDWBATerms;
56 
57 private:
58  //! The form factor for BA
59  std::unique_ptr<IFormFactor> mP_form_factor;
60 
61  std::unique_ptr<const ILayerRTCoefficients> mp_in_coeffs;
62  std::unique_ptr<const ILayerRTCoefficients> mp_out_coeffs;
63 };
64 
65 #endif // BORNAGAIN_CORE_MULTILAYER_FORMFACTORDWBA_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines and implements pure virtual interface IFormFactor.
Evaluates the coherent sum of the four DWBA terms in a scalar IFormFactor.
std::unique_ptr< IFormFactor > mP_form_factor
The form factor for BA.
void setAmbientMaterial(const Material &material) override
Passes the material in which this particle is embedded.
complex_t evaluate(const WavevectorInfo &wavevectors) const override
Calculates and returns a form factor calculation in DWBA.
FormFactorDWBA * clone() const override
Returns a clone of this ISample object.
double topZ(const IRotation &rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
~FormFactorDWBA() override
void setSpecularInfo(std::unique_ptr< const ILayerRTCoefficients > p_in_coeffs, std::unique_ptr< const ILayerRTCoefficients > p_out_coeffs) override
Sets reflection/transmission info.
double volume() const override
Returns the total volume of the particle of this form factor's shape.
double bottomZ(const IRotation &rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
FormFactorDWBA(const IFormFactor &form_factor)
std::unique_ptr< const ILayerRTCoefficients > mp_out_coeffs
void accept(INodeVisitor *visitor) const override
Calls the INodeVisitor's visit method.
friend class TestPolarizedDWBATerms
std::unique_ptr< const ILayerRTCoefficients > mp_in_coeffs
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
Pure virtual base class for all form factors.
Definition: IFormFactor.h:40
Interface to access reflection/transmission coefficients.
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
virtual void visit(const BasicLattice *)
Definition: INodeVisitor.h:154
Pure virtual interface for rotations.
Definition: Rotations.h:27
virtual const Material * material() const
Returns nullptr, unless overwritten to return a specific material.
Definition: ISample.h:37
A wrapper for underlying material implementation.
Definition: Material.h:29
Holds all wavevector information relevant for calculating form factors.