25 double damping_length)
27 m_use_damping_length(true), m_kappa(0.0), m_domain_size(0.0)
29 setName(
"InterferenceRadialParaCrystal");
43 ret->setProbabilityDistribution(*
mP_pdf);
71 double amplitude =
mP_pdf->evaluate(qpar);
89 return std::vector<const INode*>() <<
mP_pdf;
96 "evaluate() -> Error! Probability distribution for "
97 "interference function not properly initialized");
101 double qpar = std::sqrt(qxr * qxr + qyr * qyr);
103 double nd =
static_cast<double>(n);
106 if (std::abs(1.0 - fp) < 10. * std::numeric_limits<double>::epsilon()) {
109 result = ((1.0 + fp) / (1.0 - fp)).real();
112 if (std::norm(1.0 - fp) < 10. * std::numeric_limits<double>::epsilon()) {
116 else if (std::abs(1.0 - fp) * nd < 2e-4) {
118 (nd - 1.0) / 2.0 + (nd * nd - 1.0) * (fp - 1.0) / 6.0
119 + (nd * nd * nd - 2.0 * nd * nd - nd + 2.0) * (fp - 1.0) * (fp - 1.0) / 24.0;
120 result = 1.0 + 2.0 * intermediate.real();
123 if (std::abs(fp) == 0.0
124 || std::log(std::abs(fp)) * nd < std::log(std::numeric_limits<double>::min())) {
127 tmp = std::pow(fp, n);
130 fp / (1.0 - fp) - fp * (1.0 - tmp) / nd / (1.0 - fp) / (1.0 - fp);
131 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 many exception classes in namespace Exceptionss.
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
Pure virtual base class of interference functions.
void registerChild(INode *node)
RealParameter & registerParameter(const std::string &name, double *parpointer)
void setName(const std::string &name)
Interference function of radial paracrystal.
InterferenceFunctionRadialParaCrystal(double peak_distance, double damping_length)
Constructor of interference function of radial paracrystal.
std::vector< const INode * > getChildren() const override final
Returns a vector of children (const).
InterferenceFunctionRadialParaCrystal * clone() const override final
Returns a clone of this ISample object.
double m_damping_length
damping length of paracrystal
std::unique_ptr< IFTDistribution1D > mP_pdf
Fourier transformed probability distribution of the nearest particle.
void setDomainSize(double size)
Sets domain size (finite size corrections).
double iff_without_dw(const kvector_t q) const override final
Calculates the structure factor without Debye-Waller factor.
bool m_use_damping_length
void setKappa(double kappa)
Sets size spacing coupling parameter of the Size Spacing Correlation Approximation.
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)