File: InterferenceRadialParacrystal.h

package info (click to toggle)
bornagain 23.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 103,936 kB
  • sloc: cpp: 423,131; python: 40,997; javascript: 11,167; awk: 630; sh: 318; ruby: 173; xml: 130; makefile: 51; ansic: 24
file content (71 lines) | stat: -rw-r--r-- 2,545 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/Aggregate/InterferenceRadialParacrystal.h
//! @brief     Defines class InterferenceRadialParacrystal.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCERADIALPARACRYSTAL_H
#define BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCERADIALPARACRYSTAL_H

#include "Sample/Aggregate/IInterference.h"
#include "Sample/Correlation/Profiles1D.h"
#include <heinz/Complex.h>
#include <memory>

//! Interference function of radial paracrystal.

class InterferenceRadialParacrystal : public IInterference {
public:
    InterferenceRadialParacrystal(double peak_distance, double damping_length);

#ifndef SWIG
    InterferenceRadialParacrystal* clone() const override;

    std::vector<const INode*> nodeChildren() const override;
#endif // SWIG

    std::string className() const final { return "InterferenceRadialParacrystal"; }
    std::vector<ParaMeta> parDefs() const final
    {
        return {{"PeakDistance", "nm"}, {"DampingLength", "nm"}};
    }

    void setKappa(double kappa);
    double kappa() const { return m_kappa; }

    void setDomainSize(double size);
    double domainSize() const { return m_domain_size; }

    complex_t FTPDF(double qpar) const;

    void setProbabilityDistribution(const IProfile1D& pdf);

    double peakDistance() const { return m_peak_distance; }

    double dampingLength() const { return m_damping_length; }

    double randomSample(int seed) const { return m_pdf->createSampler()->randomSample(seed); }

    std::string validate() const override;

private:
    double iff_without_dw(const R3& q) const override;
    void init_parameters();

    double m_peak_distance;  //!< the distance to the first neighbor peak
    double m_damping_length; //!< damping length of paracrystal
    //! Fourier transformed probability distribution of the nearest particle
    std::unique_ptr<IProfile1D> m_pdf;
    double m_kappa;       //!< Size-spacing coupling parameter
    double m_domain_size; //!< Size of coherence domain
};

#endif // BORNAGAIN_SAMPLE_AGGREGATE_INTERFERENCERADIALPARACRYSTAL_H