BornAgain  1.19.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 reflection and scattering
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_SAMPLE_AGGREGATE_INTERFERENCEFUNCTION2DSUPERLATTICE_H
16 #define BORNAGAIN_SAMPLE_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 public:
27  InterferenceFunction2DSuperLattice(const Lattice2D& lattice, unsigned size_1, unsigned size_2);
28  InterferenceFunction2DSuperLattice(double length_1, double length_2, double alpha, double xi,
29  unsigned size_1, unsigned size_2);
31 
32  InterferenceFunction2DSuperLattice* clone() const override;
33 
34  void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
35 
36  void setSubstructureIFF(const IInterferenceFunction& sub_iff);
38 
39  double evaluate(const kvector_t q, double outer_iff = 1.0) const override;
40  unsigned domainSize1() const { return m_size_1; }
41  unsigned domainSize2() const { return m_size_2; }
42 
43  void setIntegrationOverXi(bool integrate_xi);
44  bool integrationOverXi() const { return m_integrate_xi; }
45 
46  const Lattice2D& lattice() const;
47 
48  std::vector<const INode*> getChildren() const override;
49 
50 private:
51  double iff_without_dw(const kvector_t q) const override;
52 
53  double interferenceForXi(double xi) const;
54 
55  bool m_integrate_xi; //!< Integrate over the orientation xi
56  std::unique_ptr<Lattice2D> m_lattice;
57  std::unique_ptr<IInterferenceFunction> m_substructure; //!< IFF of substructure
58  unsigned m_size_1, m_size_2; //!< Size of the finite lattice in lattice units
59  mutable double m_outer_iff;
60  mutable double m_qx;
61  mutable double m_qy;
62  mutable double m_xi;
63 };
64 
65 #endif // BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCEFUNCTION2DSUPERLATTICE_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 2D superlattice with a configurable interference function for each lattice...
InterferenceFunction2DSuperLattice * clone() const override
Returns a clone of this ISampleNode object.
unsigned m_size_2
Size of the finite lattice in lattice units.
InterferenceFunction2DSuperLattice(const Lattice2D &lattice, unsigned size_1, unsigned size_2)
void setSubstructureIFF(const IInterferenceFunction &sub_iff)
void accept(INodeVisitor *visitor) const override
Calls the INodeVisitor's visit method.
std::vector< const INode * > getChildren() const override
Returns a vector of children.
double evaluate(const kvector_t q, double outer_iff=1.0) const override
Evaluates the interference function for a given wavevector transfer.
std::unique_ptr< IInterferenceFunction > m_substructure
IFF of substructure.
double iff_without_dw(const kvector_t q) const override
Calculates the structure factor without Debye-Waller factor.
bool m_integrate_xi
Integrate over the orientation xi.
const IInterferenceFunction & substructureIFF() const
A two-dimensional Bravais lattice.
Definition: Lattice2D.h:23