BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
InterferenceFunctionFinite2DLattice.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Aggregate/InterferenceFunctionFinite2DLattice.h
6 //! @brief Defines class InterferenceFunctionFinite2DLattice.
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_INTERFERENCEFUNCTIONFINITE2DLATTICE_H
16 #define BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTIONFINITE2DLATTICE_H
17 
20 
21 //! Interference function of a finite 2D lattice.
22 //! @ingroup interference
23 
25 public:
26  InterferenceFunctionFinite2DLattice(const Lattice2D& lattice, unsigned N_1, unsigned N_2);
28 
30 
31  void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
32 
33  unsigned numberUnitCells1() const { return m_N_1; }
34  unsigned numberUnitCells2() const { return m_N_2; }
35 
36  void setIntegrationOverXi(bool integrate_xi);
37  bool integrationOverXi() const { return m_integrate_xi; }
38 
39  const Lattice2D& lattice() const;
40 
41  //! Returns the particle density associated with this 2d lattice
42  double getParticleDensity() const override;
43 
44  std::vector<const INode*> getChildren() const override;
45 
46 private:
47  double iff_without_dw(const kvector_t q) const override;
48 
49  double interferenceForXi(double xi) const;
50 
51  bool m_integrate_xi; //!< Integrate over the orientation xi
52  std::unique_ptr<Lattice2D> m_lattice;
53  unsigned m_N_1, m_N_2; //!< Size of the finite lattice in lattice units
54  mutable double m_qx;
55  mutable double m_qy;
56 };
57 
58 #endif // BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTIONFINITE2DLATTICE_H
Defines and implements the interface class IInterferenceFunction.
Defines classes of Lattice2D family.
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 finite 2D lattice.
bool m_integrate_xi
Integrate over the orientation xi.
std::vector< const INode * > getChildren() const override
Returns a vector of children.
void accept(INodeVisitor *visitor) const override
Calls the INodeVisitor's visit method.
unsigned m_N_2
Size of the finite lattice in lattice units.
InterferenceFunctionFinite2DLattice(const Lattice2D &lattice, unsigned N_1, unsigned N_2)
Constructor of two-dimensional finite lattice interference function.
double iff_without_dw(const kvector_t q) const override
Calculates the structure factor without Debye-Waller factor.
double getParticleDensity() const override
Returns the particle density associated with this 2d lattice.
InterferenceFunctionFinite2DLattice * clone() const override
Returns a clone of this ISampleNode object.
A two-dimensional Bravais lattice.
Definition: Lattice2D.h:23