BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
InterferenceFinite2DLattice.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Aggregate/InterferenceFinite2DLattice.h
6 //! @brief Defines class InterferenceFinite2DLattice.
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_INTERFERENCEFINITE2DLATTICE_H
16 #define BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFINITE2DLATTICE_H
17 
20 
21 //! Interference function of a finite 2D lattice.
22 //! @ingroup interference
23 
25 public:
26  InterferenceFinite2DLattice(const Lattice2D& lattice, unsigned N_1, unsigned N_2);
28 
29  InterferenceFinite2DLattice* clone() const override;
30  std::string className() const final { return "InterferenceFinite2DLattice"; }
31 
32  unsigned numberUnitCells1() const { return m_N_1; }
33  unsigned numberUnitCells2() const { return m_N_2; }
34 
35  void setIntegrationOverXi(bool integrate_xi);
36  bool integrationOverXi() const { return m_integrate_xi; }
37 
38  const Lattice2D& lattice() const;
39 
40  //! Returns the particle density associated with this 2d lattice
41  double particleDensity() const override;
42 
43  std::vector<const INode*> nodeChildren() const override;
44 
45 private:
46  double iff_without_dw(R3 q) const override;
47 
48  double interferenceForXi(double xi, double qx, double qy) const;
49 
50  bool m_integrate_xi; //!< Integrate over the orientation xi
51  std::unique_ptr<Lattice2D> m_lattice;
52  unsigned m_N_1, m_N_2; //!< Size of the finite lattice in lattice units
53 };
54 
55 #endif // BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFINITE2DLATTICE_H
Defines and implements the interface class IInterference.
Defines classes of Lattice2D family.
Abstract base class of interference functions.
Definition: IInterference.h:24
Interference function of a finite 2D lattice.
unsigned m_N_2
Size of the finite lattice in lattice units.
bool m_integrate_xi
Integrate over the orientation xi.
~InterferenceFinite2DLattice() override
double particleDensity() const override
Returns the particle density associated with this 2d lattice.
InterferenceFinite2DLattice(const Lattice2D &lattice, unsigned N_1, unsigned N_2)
Constructor of two-dimensional finite lattice interference function.
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
InterferenceFinite2DLattice * clone() const override
std::vector< const INode * > nodeChildren() const override
Returns all children.
double iff_without_dw(R3 q) const override
Calculates the structure factor without Debye-Waller factor.
std::unique_ptr< Lattice2D > m_lattice
double interferenceForXi(double xi, double qx, double qy) const
void setIntegrationOverXi(bool integrate_xi)
A two-dimensional Bravais lattice.
Definition: Lattice2D.h:23