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