Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
XRDCalculator.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
12
14#include "math/Precision.hpp"
15
16#include <map>
17#include <string>
18
20
24struct Wavelength {
26};
27
31struct MinTheta {
33};
34
38struct MaxTheta {
40};
41
45struct BinWidth {
47};
48
54public:
55 [[nodiscard]] std::string_view getName() const override { return "X-Ray Diffraction"; }
56 [[nodiscard]] std::string_view getShortName() const override { return "XRD"; }
57 [[nodiscard]] std::string_view getGroup() const override { return "Scattering"; }
58 [[nodiscard]] std::string_view getDescription() const override {
59 return "Computes the X-Ray Diffraction Pattern (XRD).";
60 }
61
62 [[nodiscard]] bool isFrameCalculator() const override { return true; }
63 [[nodiscard]] bool isTrajectoryCalculator() const override { return false; }
64
71 const correlation::analysis::AnalysisSettings &settings) const override;
72
87 const std::map<std::string, real_t> &ashcroft_weights, Wavelength lambda,
88 MinTheta theta_min, MaxTheta theta_max, BinWidth bin_width);
89
104 const correlation::core::Cell &cell,
105 const std::map<std::string, real_t> &ashcroft_weights, Wavelength lambda,
106 MinTheta theta_min, MaxTheta theta_max, BinWidth bin_width);
107
115 [[nodiscard]] static real_t getAtomicFormFactor(const std::string &symbol, real_t q_value);
116
117private:
118 static std::map<std::string, real_t> calculateConcentrations(const correlation::core::Cell &cell);
119
120 static std::map<std::string, std::vector<real_t>>
122 const std::map<std::string, real_t> &ashcroft_weights, real_t delta_r);
123};
124
125} // namespace correlation::calculators
Abstract base class for all analysis calculators.
Manager for distribution function calculations (RDF, PAD, S(Q), etc.).
Floating point precision type definitions for Correlation.
Manages the calculation and storage of various distribution functions.
Definition DistributionFunctions.hpp:259
Computes the X-Ray Diffraction (XRD) pattern from g(r).
Definition XRDCalculator.hpp:53
static std::map< std::string, real_t > calculateConcentrations(const correlation::core::Cell &cell)
Definition XRDCalculator.cpp:373
void calculateFrame(correlation::analysis::DistributionFunctions &dists, const correlation::analysis::AnalysisSettings &settings) const override
Computes the X-ray diffraction pattern for a single frame.
Definition XRDCalculator.cpp:190
static correlation::analysis::Histogram calculateFromSq(const correlation::analysis::Histogram &s_q_hist, const correlation::core::Cell &cell, const std::map< std::string, real_t > &ashcroft_weights, Wavelength lambda, MinTheta theta_min, MaxTheta theta_max, BinWidth bin_width)
Direct reciprocal-space calculation of XRD pattern from partial structure factors S(Q).
Definition XRDCalculator.cpp:391
std::string_view getDescription() const override
Returns a brief description of the calculator's purpose.
Definition XRDCalculator.hpp:58
std::string_view getGroup() const override
Returns the UI group this calculator belongs to (e.g., "Radial", "Angular", "Dynamic",...
Definition XRDCalculator.hpp:57
bool isTrajectoryCalculator() const override
Check if this calculator runs on the whole trajectory (e.g. VACF).
Definition XRDCalculator.hpp:63
static real_t getAtomicFormFactor(const std::string &symbol, real_t q_value)
Calculate the atomic form factor f(Q) for a given element symbol and scattering vector Q.
Definition XRDCalculator.cpp:360
bool isFrameCalculator() const override
Check if this calculator runs per-frame (e.g. RDF, PAD).
Definition XRDCalculator.hpp:62
std::string_view getName() const override
Returns the unique identifier/name of the calculator.
Definition XRDCalculator.hpp:55
static std::map< std::string, std::vector< real_t > > calculatePartialIntegrands(const correlation::analysis::Histogram &g_r_hist, const std::map< std::string, real_t > &ashcroft_weights, real_t delta_r)
Definition XRDCalculator.cpp:453
std::string_view getShortName() const override
Returns a short, UI-friendly name of the calculator (e.g. "g_r", "S_q").
Definition XRDCalculator.hpp:56
static correlation::analysis::Histogram calculate(const correlation::analysis::Histogram &g_r_hist, const correlation::core::Cell &cell, const std::map< std::string, real_t > &ashcroft_weights, Wavelength lambda, MinTheta theta_min, MaxTheta theta_max, BinWidth bin_width)
High-performance computation of the X-Ray Diffraction (XRD) pattern from g(r).
Definition XRDCalculator.cpp:245
Represents the simulation cell (periodic box).
Definition Cell.hpp:30
Definition OptionsSyncService.hpp:18
double real_t
Definition Precision.hpp:18
Configuration settings for distribution function analysis.
Definition DistributionFunctions.hpp:106
Container for a single calculated distribution function.
Definition DistributionFunctions.hpp:226
Strong type wrapper for angular bin width in degrees.
Definition XRDCalculator.hpp:45
real_t value
Angular bin resolution in degrees.
Definition XRDCalculator.hpp:46
Strong type wrapper for maximum 2-theta angle in degrees.
Definition XRDCalculator.hpp:38
real_t value
Maximum 2-theta scattering angle in degrees.
Definition XRDCalculator.hpp:39
Strong type wrapper for minimum 2-theta angle in degrees.
Definition XRDCalculator.hpp:31
real_t value
Minimum 2-theta scattering angle in degrees.
Definition XRDCalculator.hpp:32
Strong type wrapper for X-ray incident radiation wavelength in Angstroms.
Definition XRDCalculator.hpp:24
real_t value
Wavelength value in Angstroms (e.g. 1.5406 for Cu K-alpha).
Definition XRDCalculator.hpp:25