BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorDecoratorMaterial.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Scattering/FormFactorDecoratorMaterial.h
6 //! @brief Defines class FormFactorDecoratorMaterial.
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_SCATTERING_FORMFACTORDECORATORMATERIAL_H
16 #define BORNAGAIN_CORE_SCATTERING_FORMFACTORDECORATORMATERIAL_H
17 
20 #include <memory>
21 
22 //! Decorates a scalar formfactor with the correct factor for the material's
23 //! refractive index and that of its surrounding material.
24 //! @ingroup formfactors_decorations
25 
27 {
28 public:
29  FormFactorDecoratorMaterial(const IFormFactor& form_factor);
30 
31  ~FormFactorDecoratorMaterial() override final;
32 
33  FormFactorDecoratorMaterial* clone() const override final;
34 
35  void accept(INodeVisitor* visitor) const override final { visitor->visit(this); }
36 
37  //! Sets the material of the scatterer
38  void setMaterial(const Material& material);
39 
40  //! Sets the ambient material
41  void setAmbientMaterial(const Material& material) override;
42 
43  complex_t evaluate(const WavevectorInfo& wavevectors) const override;
44 #ifndef SWIG
45  //! Returns scattering amplitude for matrix interactions
46  Eigen::Matrix2cd evaluatePol(const WavevectorInfo& wavevectors) const override final;
47 #endif
48 
49 private:
50  complex_t getRefractiveIndexFactor(const WavevectorInfo& wavevectors) const;
51 
54 };
55 
56 #endif // BORNAGAIN_CORE_SCATTERING_FORMFACTORDECORATORMATERIAL_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines and implements pure virtual interface class IFormFactorDecorator.
Defines and implements class Material.
Decorates a scalar formfactor with the correct factor for the material's refractive index and that of...
void setMaterial(const Material &material)
Sets the material of the scatterer.
FormFactorDecoratorMaterial(const IFormFactor &form_factor)
FormFactorDecoratorMaterial * clone() const override final
Returns a clone of this ISample object.
~FormFactorDecoratorMaterial() override final
void setAmbientMaterial(const Material &material) override
Sets the ambient material.
complex_t getRefractiveIndexFactor(const WavevectorInfo &wavevectors) const
complex_t evaluate(const WavevectorInfo &wavevectors) const override
Returns scattering amplitude for complex wavevectors ki, kf.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
Eigen::Matrix2cd evaluatePol(const WavevectorInfo &wavevectors) const override final
Returns scattering amplitude for matrix interactions.
Encapsulates another formfactor and adds extra functionality (a scalar factor, a position-dependent p...
Pure virtual base class for all form factors.
Definition: IFormFactor.h:40
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
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.