24 double damping_length)
26 , m_peak_distance(peak_distance)
27 , m_damping_length(damping_length)
28 , m_use_damping_length(true)
32 setName(
"InterferenceRadialParaCrystal");
46 ret->setProbabilityDistribution(*
m_pdf);
74 double amplitude =
m_pdf->evaluate(qpar);
92 return std::vector<const INode*>() <<
m_pdf;
98 throw std::runtime_error(
"InterferenceFunctionRadialParaCrystal::"
99 "evaluate() -> Error! Probability distribution for "
100 "interference function not properly initialized");
104 double qpar = std::sqrt(qxr * qxr + qyr * qyr);
106 double nd =
static_cast<double>(n);
109 if (std::abs(1.0 - fp) < 10. * std::numeric_limits<double>::epsilon()) {
112 result = ((1.0 + fp) / (1.0 - fp)).real();
115 if (std::norm(1.0 - fp) < 10. * std::numeric_limits<double>::epsilon()) {
119 else if (std::abs(1.0 - fp) * nd < 2e-4) {
121 (nd - 1.0) / 2.0 + (nd * nd - 1.0) * (fp - 1.0) / 6.0
122 + (nd * nd * nd - 2.0 * nd * nd - nd + 2.0) * (fp - 1.0) * (fp - 1.0) / 24.0;
123 result = 1.0 + 2.0 * intermediate.real();
126 if (std::abs(fp) == 0.0
127 || std::log(std::abs(fp)) * nd < std::log(std::numeric_limits<double>::min())) {
130 tmp = std::pow(fp, n);
133 fp / (1.0 - fp) - fp * (1.0 - tmp) / nd / (1.0 - fp) / (1.0 - fp);
134 result = 1.0 + 2.0 * intermediate.real();
std::complex< double > complex_t
complex_t exp_I(complex_t z)
Returns exp(I*z), where I is the imaginary unit.
Defines class InterferenceFunctionRadialParaCrystal.
Defines class ParameterPool.
Defines class RealParameter.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Interface for a one-dimensional distribution, with normalization adjusted so that the Fourier transfo...
virtual IFTDistribution1D * clone() const =0
Abstract base class of interference functions.
void registerChild(INode *node)
void setName(const std::string &name)
RealParameter & registerParameter(const std::string &name, double *parpointer)
Interference function of radial paracrystal.
InterferenceFunctionRadialParaCrystal * clone() const final
Returns a clone of this ISampleNode object.
InterferenceFunctionRadialParaCrystal(double peak_distance, double damping_length)
Constructor of interference function of radial paracrystal.
double m_damping_length
damping length of paracrystal
void setDomainSize(double size)
Sets domain size (finite size corrections).
bool m_use_damping_length
double iff_without_dw(const kvector_t q) const final
Calculates the structure factor without Debye-Waller factor.
std::vector< const INode * > getChildren() const final
Returns a vector of children.
void setKappa(double kappa)
Sets size spacing coupling parameter of the Size Spacing Correlation Approximation.
std::unique_ptr< IFTDistribution1D > m_pdf
Fourier transformed probability distribution of the nearest particle.
complex_t FTPDF(double qpar) const
double m_domain_size
Size of coherence domain.
double m_kappa
Size-spacing coupling parameter.
double m_peak_distance
the distance to the first neighbor peak
void setProbabilityDistribution(const IFTDistribution1D &pdf)
Sets one-dimensional probability distribution.
RealParameter & setNonnegative()
RealParameter & setUnit(const std::string &name)