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