BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
InterferenceFunction2DParaCrystal.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Aggregate/InterferenceFunction2DParaCrystal.h
6 //! @brief Defines class InterferenceFunction2DParaCrystal.
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_INTERFERENCEFUNCTION2DPARACRYSTAL_H
16 #define BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTION2DPARACRYSTAL_H
17 
21 #include <memory>
22 
23 class IFTDistribution2D;
24 
25 //! Interference function of a 2D paracrystal.
26 //! @ingroup interference
27 
29 public:
30  InterferenceFunction2DParaCrystal(const Lattice2D& lattice, double damping_length,
31  double domain_size_1, double domain_size_2);
32 
34 
35  InterferenceFunction2DParaCrystal* clone() const override;
36 
37  void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
38 
39  void setDomainSizes(double size_1, double size_2);
40 
42  const IFTDistribution2D& pdf_2);
43 
44  void setDampingLength(double damping_length);
45 
46  std::vector<double> domainSizes() const;
47 
48  void setIntegrationOverXi(bool integrate_xi);
49  bool integrationOverXi() const { return m_integrate_xi; }
50  double dampingLength() const { return m_damping_length; }
51 
52  const Lattice2D& lattice() const;
53 
54  double getParticleDensity() const override;
55 
56  std::vector<const INode*> getChildren() const override;
57 
58  const IFTDistribution2D* pdf1() const { return m_pdf1.get(); }
59 
60  const IFTDistribution2D* pdf2() const { return m_pdf2.get(); }
61 
62 private:
63  double iff_without_dw(const kvector_t q) const override;
64 
65  double interferenceForXi(double xi) const;
66  double interference1D(double qx, double qy, double xi, size_t index) const;
67  complex_t FTPDF(double qx, double qy, double xi, size_t index) const;
68  void transformToPrincipalAxes(double qx, double qy, double gamma, double delta, double& q_pa_1,
69  double& q_pa_2) const;
70 
71  bool m_integrate_xi; //!< Integrate over the orientation xi
72  std::unique_ptr<IFTDistribution2D> m_pdf1, m_pdf2;
73  std::unique_ptr<Lattice2D> m_lattice; // TODO ASAP name as in other i-fcts
74  double m_damping_length; //!< Damping length for removing delta function singularity at q=0.
75  double m_domain_sizes[2]; //!< Coherence domain sizes
76  mutable double m_qx;
77  mutable double m_qy;
78 };
79 
80 #endif // BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTION2DPARACRYSTAL_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines interface class IFTDistribution2D, and children thereof.
Defines and implements the interface class IInterferenceFunction.
Defines classes of Lattice2D family.
Interface for two-dimensional distributions in Fourier space.
Abstract base class of interference functions.
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
virtual void visit(const BasicLattice2D *)
Definition: INodeVisitor.h:151
Interference function of a 2D paracrystal.
double getParticleDensity() const override
If defined by this interference function's parameters, returns the particle density (per area).
void setProbabilityDistributions(const IFTDistribution2D &pdf_1, const IFTDistribution2D &pdf_2)
Sets the probability distributions (Fourier transformed) for the two lattice directions.
InterferenceFunction2DParaCrystal(const Lattice2D &lattice, double damping_length, double domain_size_1, double domain_size_2)
double iff_without_dw(const kvector_t q) const override
Calculates the structure factor without Debye-Waller factor.
double m_domain_sizes[2]
Coherence domain sizes.
InterferenceFunction2DParaCrystal * clone() const override
Returns a clone of this ISampleNode object.
std::unique_ptr< IFTDistribution2D > m_pdf1
void setIntegrationOverXi(bool integrate_xi)
Enables/disables averaging over the lattice rotation angle.
bool m_integrate_xi
Integrate over the orientation xi.
double m_damping_length
Damping length for removing delta function singularity at q=0.
void setDampingLength(double damping_length)
Sets the damping length.
std::unique_ptr< IFTDistribution2D > m_pdf2
double interferenceForXi(double xi) const
Returns interference function for fixed angle xi.
complex_t FTPDF(double qx, double qy, double xi, size_t index) const
void setDomainSizes(double size_1, double size_2)
Sets the sizes of coherence domains.
void transformToPrincipalAxes(double qx, double qy, double gamma, double delta, double &q_pa_1, double &q_pa_2) const
std::vector< const INode * > getChildren() const override
Returns a vector of children.
void accept(INodeVisitor *visitor) const override
Calls the INodeVisitor's visit method.
double interference1D(double qx, double qy, double xi, size_t index) const
Returns interference function for fixed xi in the dimension determined by the given index.
A two-dimensional Bravais lattice.
Definition: Lattice2D.h:23