BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Interference2DLattice.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Aggregate/Interference2DLattice.h
6 //! @brief Defines class Interference2DLattice.
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_INTERFERENCE2DLATTICE_H
16 #define BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCE2DLATTICE_H
17 
20 
21 class IProfile2D;
22 //! Interference function of a 2D lattice.
23 //! @ingroup interference
24 
26 public:
29 
30  Interference2DLattice* clone() const override;
31  std::string className() const final { return "Interference2DLattice"; }
32 
33  void setDecayFunction(const IProfile2D& decay);
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  //! Returns interference from a single reciprocal lattice vector
51  double interferenceAtOneRecLatticePoint(double qx, double qy) const;
52 
53  //! Returns reciprocal coordinates in the coordinate system rotated by the angle gamma
54  std::pair<double, double> rotateOrthonormal(double qx, double qy, double gamma) const;
55 
56  //! Returns qx,qy coordinates of q - qint, where qint is a reciprocal lattice vector
57  //! bounding the reciprocal unit cell to which q belongs
58  std::pair<double, double> calculateReciprocalVectorFraction(double qx, double qy,
59  double xi) const;
60 
61  bool m_integrate_xi; //!< Integrate over the orientation xi
62  std::unique_ptr<IProfile2D> m_decay;
63  std::unique_ptr<Lattice2D> m_lattice;
64  Lattice2D::ReciprocalBases m_sbase; //!< reciprocal lattice is stored without xi
65  int m_na, m_nb; //!< determines the number of reciprocal lattice points to use
66 };
67 
68 #endif // BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCE2DLATTICE_H
Defines and implements the interface class IInterference.
Defines classes of Lattice2D family.
Abstract base class of interference functions.
Definition: IInterference.h:24
Interface for two-dimensional distributions in Fourier space.
Definition: Profiles2D.h:29
Interference function of a 2D lattice.
std::unique_ptr< Lattice2D > m_lattice
bool m_integrate_xi
Integrate over the orientation xi.
Interference2DLattice(const Lattice2D &lattice)
void setDecayFunction(const IProfile2D &decay)
Sets two-dimensional decay function.
std::pair< double, double > rotateOrthonormal(double qx, double qy, double gamma) const
Returns reciprocal coordinates in the coordinate system rotated by the angle gamma.
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Interference2DLattice * clone() const override
const Lattice2D & lattice() const
std::vector< const INode * > nodeChildren() const override
Returns all children.
void setIntegrationOverXi(bool integrate_xi)
double iff_without_dw(R3 q) const override
Calculates the structure factor without Debye-Waller factor.
double interferenceForXi(double xi, double qx, double qy) const
Lattice2D::ReciprocalBases m_sbase
reciprocal lattice is stored without xi
std::pair< double, double > calculateReciprocalVectorFraction(double qx, double qy, double xi) const
Returns qx,qy coordinates of q - qint, where qint is a reciprocal lattice vector bounding the recipro...
std::unique_ptr< IProfile2D > m_decay
int m_nb
determines the number of reciprocal lattice points to use
double interferenceAtOneRecLatticePoint(double qx, double qy) const
Returns interference from a single reciprocal lattice vector.
~Interference2DLattice() override
double particleDensity() const override
Returns the particle density associated with this 2d lattice.
A two-dimensional Bravais lattice.
Definition: Lattice2D.h:23
double gamma(double x)