BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorBar.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/HardParticle/FormFactorBar.cpp
6 //! @brief Implements classes FormFactorBar*.
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 
17 
18 // ************************************************************************** //
19 // class FormFactorBarGauss
20 // ************************************************************************** //
21 
22 FormFactorBarGauss::FormFactorBarGauss(const std::vector<double> P)
23  : IProfileRectangularRipple({"BarGauss", "class_tooltip", {}}, P)
24 {
25 }
26 
27 FormFactorBarGauss::FormFactorBarGauss(double length, double width, double height)
28  : FormFactorBarGauss(std::vector<double>{length, width, height})
29 {
30 }
31 
33 {
34  return new FormFactorBarGauss(m_length, m_width, m_height);
35 }
36 
38 {
39  visitor->visit(this);
40 }
41 
42 complex_t FormFactorBarGauss::factor_x(complex_t qx) const
43 {
44  return ripples::factor_x_Gauss(qx, m_length);
45 }
46 
47 // ************************************************************************** //
48 // class FormFactorBarLorentz
49 // ************************************************************************** //
50 
51 FormFactorBarLorentz::FormFactorBarLorentz(const std::vector<double> P)
52  : IProfileRectangularRipple({"BarLorentz", "class_tooltip", {}}, P)
53 {
54 }
55 
56 FormFactorBarLorentz::FormFactorBarLorentz(double length, double width, double height)
57  : FormFactorBarLorentz(std::vector<double>{length, width, height})
58 {
59 }
60 
62 {
63  return new FormFactorBarLorentz(m_length, m_width, m_height);
64 }
65 
67 {
68  visitor->visit(this);
69 }
70 
71 complex_t FormFactorBarLorentz::factor_x(complex_t qx) const
72 {
73  return ripples::factor_x_Lorentz(qx, m_length);
74 }
Defines classes FormFactorBar*.
Declares computations in namespace ripples.
The form factor of an elongated bar, with Gaussian profile in elongation direction.
Definition: FormFactorBar.h:23
FormFactorBarGauss * clone() const final
Returns a clone of this ISample object.
void accept(INodeVisitor *visitor) const final
Calls the INodeVisitor's visit method.
The form factor of an elongated, with Lorentz form factor in elongation direction.
Definition: FormFactorBar.h:37
FormFactorBarLorentz * clone() const final
Returns a clone of this ISample object.
void accept(INodeVisitor *visitor) const final
Calls the INodeVisitor's visit method.
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
Base class for form factors with a rectangular ripple (bar) profile in the yz plane.