23 double damping_length)
25 , m_peak_distance(peak_distance)
26 , m_damping_length(damping_length)
27 , m_use_damping_length(true)
45 result->setProbabilityDistribution(*
m_pdf);
73 double amplitude =
m_pdf->standardizedFT(qpar);
74 complex_t result = phase * amplitude;
90 return std::vector<const INode*>() <<
m_pdf;
96 throw std::runtime_error(
"InterferenceRadialParaCrystal::"
97 "evaluate() -> Error! Probability distribution for "
98 "interference function not properly initialized");
102 double qpar = std::sqrt(qxr * qxr + qyr * qyr);
104 auto nd =
static_cast<double>(n);
105 complex_t fp =
FTPDF(qpar);
107 if (std::abs(1.0 - fp) < 10. * std::numeric_limits<double>::epsilon())
110 result = ((1.0 + fp) / (1.0 - fp)).real();
112 if (std::norm(1.0 - fp) < 10. * std::numeric_limits<double>::epsilon())
115 else if (std::abs(1.0 - fp) * nd < 2e-4) {
116 complex_t intermediate =
117 (nd - 1.0) / 2.0 + (nd * nd - 1.0) * (fp - 1.0) / 6.0
118 + (nd * nd * nd - 2.0 * nd * nd - nd + 2.0) * (fp - 1.0) * (fp - 1.0) / 24.0;
119 result = 1.0 + 2.0 * intermediate.real();
122 if (std::abs(fp) == 0.0
123 || std::log(std::abs(fp)) * nd < std::log(std::numeric_limits<double>::min())) {
126 tmp = std::pow(fp, n);
128 complex_t intermediate =
129 fp / (1.0 - fp) - fp * (1.0 - tmp) / nd / (1.0 - fp) / (1.0 - fp);
130 result = 1.0 + 2.0 * intermediate.real();
Defines class InterferenceRadialParaCrystal.
Defines class RealLimits.
Abstract base class of interference functions.
Interface for a one-dimensional distribution, with normalization adjusted so that the Fourier transfo...
IProfile1D * clone() const override=0
Interference function of radial paracrystal.
double iff_without_dw(R3 q) const override
Calculates the structure factor without Debye-Waller factor.
double m_kappa
Size-spacing coupling parameter.
double m_domain_size
Size of coherence domain.
std::vector< const INode * > nodeChildren() const override
Returns all children.
InterferenceRadialParaCrystal * clone() const override
std::unique_ptr< IProfile1D > m_pdf
InterferenceRadialParaCrystal(double peak_distance, double damping_length)
Constructor of interference function of radial paracrystal.
void setKappa(double kappa)
Sets size spacing coupling parameter of the Size Spacing Correlation Approximation.
void setDomainSize(double size)
Sets domain size (finite size corrections).
bool m_use_damping_length
complex_t FTPDF(double qpar) const
void setProbabilityDistribution(const IProfile1D &pdf)
Sets one-dimensional probability distribution.
double m_damping_length
damping length of paracrystal Fourier transformed probability distribution of the nearest particle
double m_peak_distance
the distance to the first neighbor peak
void check(const std::string &name, double value) const
Throws if value is outside limits. Parameter 'name' is for exception message.
static RealLimits nonnegative()
Creates an object which can have only positive values with 0. included.