BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
HorizontalCylinder.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/HorizontalCylinder.h
6 //! @brief Defines class Cylinder.
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_HARDPARTICLE_HORIZONTALCYLINDER_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_HORIZONTALCYLINDER_H
17 
19 
20 //! A circular cylinder.
21 //! @ingroup hardParticle
22 
24 public:
25  HorizontalCylinder(double radius, double length, double slice_bottom, double slice_top);
26  HorizontalCylinder(double radius, double length);
27 #ifndef USER_API
28  HorizontalCylinder(std::vector<double> P);
29 
30  HorizontalCylinder* clone() const override
31  {
33  }
34  std::string className() const final { return "HorizontalCylinder"; }
35  // const auto tooltip = "circular cylinder";
36  std::vector<ParaMeta> parDefs() const final
37  {
38  return {
39  {"Radius", "nm", "radius of base", 0, +INF, 0},
40  {"Length", "nm", "length", 0, +INF, 0},
41  {"Slice_bottom", "nm", "Cut starts here (-R<=slice_bottom<slice_top<=+R)", -INF, +INF,
42  0},
43  {"Slice_top", "nm", "Cut ends here (-R<=slice_bottom<slice_top<=+R)", -INF, +INF, 0}};
44  }
45 
46  double length() const { return m_length; }
47  double radius() const { return m_radius; }
48  double slice_bottom() const { return m_slice_bottom; }
49  double slice_top() const { return m_slice_top; }
50 
51  double radialExtension() const override { return m_radius; }
52 
53  complex_t formfactor_at_bottom(C3 q) const override;
54 
55 private:
56  const double& m_radius;
57  const double& m_length;
58  const double& m_slice_bottom;
59  const double& m_slice_top;
60 #endif // USER_API
61 };
62 
63 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_HORIZONTALCYLINDER_H
Defines interface IDecoratableBorn.
const double INF
Definition: INode.h:26
A circular cylinder.
complex_t formfactor_at_bottom(C3 q) const override
const double & m_slice_top
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
HorizontalCylinder * clone() const override
Returns a clone of this ISampleNode object.
const double & m_radius
const double & m_length
double length() const
double slice_top() const
double radius() const
double slice_bottom() const
const double & m_slice_bottom
HorizontalCylinder(double radius, double length, double slice_bottom, double slice_top)
Abstract base class for Born form factors.
Definition: IFormFactor.h:36