BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ReParticle.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Resample/Particle/ReParticle.h
6 //! @brief Defines interface class ReParticle.
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H
21 #define BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H
22 
24 #include <heinz/Vectors3D.h>
25 #include <memory>
26 
27 class IFormFactor;
28 class Material;
29 class RotMatrix;
30 
31 //! A reprocessed simple particle, with shape m_ff.
32 
33 class ReParticle : public IReParticle {
34 public:
35  ReParticle(const IFormFactor& ff);
36  ~ReParticle() override;
37 
38  ReParticle* clone() const override;
39 
40  //! Sets the material of the scatterer
41  void setMaterial(const Material& material);
42 
43  //! Sets the ambient material
44  void setAmbientMaterial(const Material& ambient_material) override;
45 
46  void setPosition(const R3& position);
47  void setRotMatrix(const RotMatrix& rotMatrix);
48 
49  complex_t theFF(const WavevectorInfo& wavevectors) const override;
50  SpinMatrix thePolFF(const WavevectorInfo& wavevectors) const override;
51 
52  double volume() const override;
53 
54  double radialExtension() const override;
55 
56  double bottomZ(const IRotation* rotation) const override;
57 
58  double topZ(const IRotation* rotation) const override;
59 
60  const IFormFactor* formfactor_at_bottom() const;
61 
62  virtual complex_t formfactor_at_bottom(C3 q) const;
63 
64  static ReParticle* createTransformedFormFactor(const IFormFactor& formfactor,
65  const IRotation* rot, R3 translation);
66 
67 protected:
68  std::unique_ptr<const IFormFactor> m_ff;
69 
70  // private:
71  ReParticle(IFormFactor* ff, const Material* material, const Material* ambient_material,
72  const R3* position, const RotMatrix* rotMatrix);
73 
74  std::unique_ptr<const Material> m_material;
75  std::unique_ptr<const Material> m_ambient_material;
76  std::unique_ptr<const R3> m_position;
77  std::unique_ptr<const RotMatrix> m_rotMatrix;
78 };
79 
80 #endif // BORNAGAIN_RESAMPLE_PARTICLE_REPARTICLE_H
81 #endif // USER_API
Defines and implements interface IReParticle.
Abstract base class for Born form factors.
Definition: IFormFactor.h:36
Abstract base class for reprocessed particles.
Definition: IReParticle.h:37
Abstract base class for rotations.
Definition: Rotations.h:29
A wrapper for underlying material implementation.
Definition: Material.h:35
A reprocessed simple particle, with shape m_ff.
Definition: ReParticle.h:33
std::unique_ptr< const RotMatrix > m_rotMatrix
Definition: ReParticle.h:77
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
Definition: ReParticle.cpp:85
double topZ(const IRotation *rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
Definition: ReParticle.cpp:146
void setMaterial(const Material &material)
Sets the material of the scatterer.
Definition: ReParticle.cpp:60
const IFormFactor * formfactor_at_bottom() const
Definition: ReParticle.cpp:90
~ReParticle() override
ReParticle(const IFormFactor &ff)
Definition: ReParticle.cpp:33
std::unique_ptr< const Material > m_material
Definition: ReParticle.h:74
void setAmbientMaterial(const Material &ambient_material) override
Sets the ambient material.
Definition: ReParticle.cpp:65
SpinMatrix thePolFF(const WavevectorInfo &wavevectors) const override
Returns scattering amplitude for matrix interactions.
Definition: ReParticle.cpp:114
double bottomZ(const IRotation *rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
Definition: ReParticle.cpp:134
ReParticle * clone() const override
Definition: ReParticle.cpp:40
void setRotMatrix(const RotMatrix &rotMatrix)
Definition: ReParticle.cpp:75
std::unique_ptr< const IFormFactor > m_ff
Definition: ReParticle.h:68
std::unique_ptr< const Material > m_ambient_material
Definition: ReParticle.h:75
void setPosition(const R3 &position)
Definition: ReParticle.cpp:70
static ReParticle * createTransformedFormFactor(const IFormFactor &formfactor, const IRotation *rot, R3 translation)
Definition: ReParticle.cpp:49
double volume() const override
Returns the total volume of the particle of this form factor's shape.
Definition: ReParticle.cpp:80
std::unique_ptr< const R3 > m_position
Definition: ReParticle.h:76
complex_t theFF(const WavevectorInfo &wavevectors) const override
Returns scattering amplitude for complex wavevectors ki, kf.
Definition: ReParticle.cpp:100
Rotation matrix in three dimensions. Represents group SO(3). Internal parameterization based on quate...
Definition: RotMatrix.h:25
Holds all wavevector information relevant for calculating form factors.