BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
IInterference.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Aggregate/IInterference.h
6 //! @brief Defines and implements the interface class IInterference.
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_SAMPLE_AGGREGATE_IINTERFERENCE_H
16 #define BORNAGAIN_SAMPLE_AGGREGATE_IINTERFERENCE_H
17 
18 #include "Base/Types/ICloneable.h"
19 #include "Param/Node/INode.h"
20 #include <heinz/Vectors3D.h>
21 
22 //! Abstract base class of interference functions.
23 
24 class IInterference : public ICloneable, public INode {
25 protected:
26  IInterference(const std::vector<double>& PValues);
27  IInterference(double position_var);
28 
29 public:
30  IInterference* clone() const override = 0;
31 
32  //! The interference function for a given wavevector transfer
33  virtual double structureFactor(R3 q, double outer_iff = 1.0) const;
34 
35  //! Sets the variance of the position for the calculation of the DW factor
36  //! It is defined as the variance in each relevant dimension
37  void setPositionVariance(double var);
38 
39  //! Returns the position variance
40  double positionVariance() const { return m_position_var; }
41 
42  //! If defined by this interference function's parameters, returns the particle density (per
43  //! area). Otherwise, returns zero or a user-defined value
44  virtual double particleDensity() const { return 0.0; }
45 
46  //! Indicates if this interference function can be used with a sample (DWBA mode)
47  virtual bool supportsMultilayer() const { return true; }
48 
49  //! structureFactors the Debye-Waller factor for a given wavevector transfer
50  double DWfactor(R3 q) const;
51 
52 protected:
54 
55  //! Calculates the structure factor in the absence of extra inner structure
56  double iff_no_inner(R3 q, double outer_iff) const;
57 
58  //! Calculates the structure factor without Debye-Waller factor
59  virtual double iff_without_dw(R3 q) const = 0;
60 };
61 
62 #endif // BORNAGAIN_SAMPLE_AGGREGATE_IINTERFERENCE_H
Defines and implements the standard mix-in ICloneable.
Defines interface INode.
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Definition: ICloneable.h:23
Abstract base class of interference functions.
Definition: IInterference.h:24
IInterference * clone() const override=0
double DWfactor(R3 q) const
structureFactors the Debye-Waller factor for a given wavevector transfer
double positionVariance() const
Returns the position variance.
Definition: IInterference.h:40
virtual bool supportsMultilayer() const
Indicates if this interference function can be used with a sample (DWBA mode)
Definition: IInterference.h:47
double m_position_var
Definition: IInterference.h:53
virtual double structureFactor(R3 q, double outer_iff=1.0) const
The interference function for a given wavevector transfer.
void setPositionVariance(double var)
Sets the variance of the position for the calculation of the DW factor It is defined as the variance ...
virtual double particleDensity() const
If defined by this interference function's parameters, returns the particle density (per area)....
Definition: IInterference.h:44
double iff_no_inner(R3 q, double outer_iff) const
Calculates the structure factor in the absence of extra inner structure.
virtual double iff_without_dw(R3 q) const =0
Calculates the structure factor without Debye-Waller factor.
IInterference(const std::vector< double > &PValues)
Base class for tree-like structures containing parameterized objects.
Definition: INode.h:40