BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORMATERIAL_H
21 #define BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORMATERIAL_H
22 
25 #include <memory>
26 
27 //! Decorates a scalar formfactor with the correct factor for the material's
28 //! refractive index and that of its surrounding material.
29 //! @ingroup formfactors_decorations
30 
32 public:
34 
36 
37  FormFactorDecoratorMaterial* clone() const override;
38 
39  void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
40 
41  //! Sets the material of the scatterer
42  void setMaterial(const Material& material);
43 
44  //! Sets the ambient material
45  void setAmbientMaterial(const Material& material) override;
46 
47  complex_t evaluate(const WavevectorInfo& wavevectors) const override;
48 #ifndef SWIG
49  //! Returns scattering amplitude for matrix interactions
50  Eigen::Matrix2cd evaluatePol(const WavevectorInfo& wavevectors) const override;
51 #endif
52 
53 private:
54  complex_t getRefractiveIndexFactor(const WavevectorInfo& wavevectors) const;
55 
58 };
59 
60 #endif // BORNAGAIN_SAMPLE_SCATTERING_FORMFACTORDECORATORMATERIAL_H
61 #endif // USER_API
std::complex< double > complex_t
Definition: Complex.h:20
Defines and implements 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...
FormFactorDecoratorMaterial(const IFormFactor &ff)
void setMaterial(const Material &material)
Sets the material of the scatterer.
void accept(INodeVisitor *visitor) const override
Calls the INodeVisitor's visit method.
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.
~FormFactorDecoratorMaterial() override
FormFactorDecoratorMaterial * clone() const override
Returns a clone of this ISampleNode object.
Eigen::Matrix2cd evaluatePol(const WavevectorInfo &wavevectors) const override
Returns scattering amplitude for matrix interactions.
Encapsulates another formfactor and adds extra functionality (a scalar factor, a position-dependent p...
Abstract base class for all form factors.
Definition: IFormFactor.h:36
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
virtual void visit(const BasicLattice2D *)
Definition: INodeVisitor.h:151
virtual const Material * material() const
Returns nullptr, unless overwritten to return a specific material.
Definition: ISampleNode.h:37
A wrapper for underlying material implementation.
Definition: Material.h:29
Holds all wavevector information relevant for calculating form factors.