BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IInterferenceFunction.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Aggregate/IInterferenceFunction.h
6 //! @brief Defines and implements the interface class IInterferenceFunction.
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_AGGREGATE_IINTERFERENCEFUNCTION_H
16 #define BORNAGAIN_CORE_AGGREGATE_IINTERFERENCEFUNCTION_H
17 
19 
20 //! Pure virtual base class of interference functions.
21 //! @ingroup distribution_internal
22 
24 {
25 public:
26  IInterferenceFunction(const NodeMeta& meta, const std::vector<double>& PValues);
27  IInterferenceFunction(double position_var);
28 
29  virtual IInterferenceFunction* clone() const = 0;
30 
31  //! Evaluates the interference function for a given wavevector transfer
32  virtual double evaluate(const kvector_t q, double outer_iff = 1.0) const;
33 
34  //! Sets the variance of the position for the calculation of the DW factor
35  //! It is defined as the variance in each relevant dimension
36  void setPositionVariance(double var);
37 
38  //! Returns the position variance
39  double positionVariance() const { return m_position_var; }
40 
41  //! If defined by this interference function's parameters, returns the particle density (per
42  //! area). Otherwise, returns zero or a user-defined value
43  virtual double getParticleDensity() const { return 0.0; }
44 
45  //! Indicates if this interference function can be used with a multilayer (DWBA mode)
46  virtual bool supportsMultilayer() const { return true; }
47 
48  //! Evaluates the Debye-Waller factor for a given wavevector transfer
49  double DWfactor(kvector_t q) const;
50 
51 protected:
53 
54  //! Calculates the structure factor in the absence of extra inner structure
55  double iff_no_inner(const kvector_t q, double outer_iff) const;
56 
57  //! Calculates the structure factor without Debye-Waller factor
58  virtual double iff_without_dw(const kvector_t q) const = 0;
59 };
60 
61 #endif // BORNAGAIN_CORE_AGGREGATE_IINTERFERENCEFUNCTION_H
Defines interface class ISample.
Pure virtual base class of interference functions.
double DWfactor(kvector_t q) const
Evaluates the Debye-Waller factor for a given wavevector transfer.
virtual bool supportsMultilayer() const
Indicates if this interference function can be used with a multilayer (DWBA mode)
void setPositionVariance(double var)
Sets the variance of the position for the calculation of the DW factor It is defined as the variance ...
double iff_no_inner(const kvector_t q, double outer_iff) const
Calculates the structure factor in the absence of extra inner structure.
virtual IInterferenceFunction * clone() const =0
Returns a clone of this ISample object.
double positionVariance() const
Returns the position variance.
virtual double evaluate(const kvector_t q, double outer_iff=1.0) const
Evaluates the interference function for a given wavevector transfer.
virtual double iff_without_dw(const kvector_t q) const =0
Calculates the structure factor without Debye-Waller factor.
virtual double getParticleDensity() const
If defined by this interference function's parameters, returns the particle density (per area).
IInterferenceFunction(const NodeMeta &meta, const std::vector< double > &PValues)
Pure virtual base class for sample components and properties related to scattering.
Definition: ISample.h:28
Metadata of one model node.
Definition: INode.h:37