BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
InterferenceFunction2DSuperLattice.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Aggregate/InterferenceFunction2DSuperLattice.h
6 //! @brief Defines class InterferenceFunction2DSuperLattice.
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_CORE_AGGREGATE_INTERFERENCEFUNCTION2DSUPERLATTICE_H
16 #define BORNAGAIN_CORE_AGGREGATE_INTERFERENCEFUNCTION2DSUPERLATTICE_H
17 
20 
21 //! Interference function of a 2D superlattice with a configurable interference function for
22 //! each lattice site.
23 //! @ingroup interference
24 
26 {
27 public:
28  InterferenceFunction2DSuperLattice(const Lattice2D& lattice, unsigned size_1, unsigned size_2);
29  InterferenceFunction2DSuperLattice(double length_1, double length_2, double alpha, double xi,
30  unsigned size_1, unsigned size_2);
32 
33  InterferenceFunction2DSuperLattice* clone() const override final;
34 
35  void accept(INodeVisitor* visitor) const override final { visitor->visit(this); }
36 
37  void setSubstructureIFF(const IInterferenceFunction& sub_iff);
39 
40  static InterferenceFunction2DSuperLattice* createSquare(double lattice_length, double xi,
41  unsigned size_1, unsigned size_2);
42  static InterferenceFunction2DSuperLattice* createHexagonal(double lattice_length, double xi,
43  unsigned size_1, unsigned size_2);
44 
45  double evaluate(const kvector_t q, double outer_iff = 1.0) const override final;
46  unsigned domainSize1() const { return m_size_1; }
47  unsigned domainSize2() const { return m_size_2; }
48 
49  void setIntegrationOverXi(bool integrate_xi);
50  bool integrationOverXi() const { return m_integrate_xi; }
51 
52  const Lattice2D& lattice() const;
53 
54  std::vector<const INode*> getChildren() const override final;
55 
56 private:
57  double iff_without_dw(const kvector_t q) const override final;
58  void setLattice(const Lattice2D& lattice);
59 
60  double interferenceForXi(double xi) const;
61 
62  bool m_integrate_xi; //!< Integrate over the orientation xi
63  std::unique_ptr<Lattice2D> mP_lattice;
64  std::unique_ptr<IInterferenceFunction> mP_substructure; //!< IFF of substructure
65  unsigned m_size_1, m_size_2; //!< Size of the finite lattice in lattice units
66  mutable double m_outer_iff;
67  mutable double m_qx;
68  mutable double m_qy;
69  mutable double m_xi;
70 };
71 
72 #endif // BORNAGAIN_CORE_AGGREGATE_INTERFERENCEFUNCTION2DSUPERLATTICE_H
Defines and implements the interface class IInterferenceFunction.
Defines classes of Lattice2D family.
Pure virtual base class of interference functions.
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
Interference function of a 2D superlattice with a configurable interference function for each lattice...
unsigned m_size_2
Size of the finite lattice in lattice units.
InterferenceFunction2DSuperLattice(const Lattice2D &lattice, unsigned size_1, unsigned size_2)
std::unique_ptr< IInterferenceFunction > mP_substructure
IFF of substructure.
void setSubstructureIFF(const IInterferenceFunction &sub_iff)
double evaluate(const kvector_t q, double outer_iff=1.0) const override final
Evaluates the interference function for a given wavevector transfer.
static InterferenceFunction2DSuperLattice * createHexagonal(double lattice_length, double xi, unsigned size_1, unsigned size_2)
Creates hexagonal lattice.
static InterferenceFunction2DSuperLattice * createSquare(double lattice_length, double xi, unsigned size_1, unsigned size_2)
Creates square lattice.
bool m_integrate_xi
Integrate over the orientation xi.
double iff_without_dw(const kvector_t q) const override final
Calculates the structure factor without Debye-Waller factor.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
InterferenceFunction2DSuperLattice * clone() const override final
Returns a clone of this ISample object.
const IInterferenceFunction & substructureIFF() const
std::vector< const INode * > getChildren() const override final
Returns a vector of children (const).