Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
FirstMinimumDetector.hpp
Go to the documentation of this file.
1
9
10#pragma once
11
13#include "math/Precision.hpp"
14
15#include <cstdint>
16#include <expected>
17#include <span>
18#include <string_view>
19
20namespace correlation::analysis {
21
34
46
53 static_cast<real_t>(0.5)};
55 static_cast<real_t>(8.0)};
57 1.8)};
59 static_cast<real_t>(0.05)};
61 static_cast<real_t>(0.5)};
62 bool apply_smoothing{true};
63};
64
70public:
78 [[nodiscard]] static std::expected<CutoffResult, DetectionError>
79 detectCutoffs(std::span<const real_t> r_bins, std::span<const real_t> g_r,
80 const DetectionOptions &opts = {});
81
89 [[nodiscard]] static std::expected<CutoffResult, DetectionError>
90 detectCutoffs(const Histogram &hist, std::string_view partial_key,
91 const DetectionOptions &opts = {});
92
98 [[nodiscard]] static std::string_view formatError(DetectionError error) noexcept;
99};
100
101} // namespace correlation::analysis
Manager for distribution function calculations (RDF, PAD, S(Q), etc.).
Floating point precision type definitions for Correlation.
Evaluates radial distribution functions to locate coordination shell boundaries.
Definition FirstMinimumDetector.hpp:69
static std::string_view formatError(DetectionError error) noexcept
Converts a DetectionError to a human-readable diagnostic message.
Definition FirstMinimumDetector.cpp:216
static std::expected< CutoffResult, DetectionError > detectCutoffs(std::span< const real_t > r_bins, std::span< const real_t > g_r, const DetectionOptions &opts={})
Detects first coordination shell cutoffs from raw or smoothed spans.
Definition FirstMinimumDetector.cpp:144
Definition AnalysisTypes.hpp:11
DetectionError
Definition FirstMinimumDetector.hpp:26
@ NoMinimumFound
No inflection point or trough detected following primary peak.
Definition FirstMinimumDetector.hpp:30
@ MismatchedSizes
Bins and intensities spans have different lengths.
Definition FirstMinimumDetector.hpp:28
@ PartialNotFound
Requested partial key was not found in Histogram container.
Definition FirstMinimumDetector.hpp:32
@ InsufficientData
Bins or intensities array has fewer than required points.
Definition FirstMinimumDetector.hpp:27
@ NoPeakFound
No primary coordination peak detected above noise threshold.
Definition FirstMinimumDetector.hpp:29
@ InvalidRange
Minimum distance exceeds maximum distance or window is unphysical.
Definition FirstMinimumDetector.hpp:31
double real_t
Definition Precision.hpp:18
Calculated radial cutoff boundaries and key feature locations.
Definition FirstMinimumDetector.hpp:39
real_t r_min
Lower cutoff bound (onset of first coordination shell) in Å.
Definition FirstMinimumDetector.hpp:40
real_t r_max
Upper cutoff bound (first minimum following primary peak) in Å.
Definition FirstMinimumDetector.hpp:41
real_t r_peak
Radial position of primary peak maximum in Å.
Definition FirstMinimumDetector.hpp:42
real_t peak_height
Intensity at primary peak maximum.
Definition FirstMinimumDetector.hpp:43
real_t min_height
Intensity at detected first minimum.
Definition FirstMinimumDetector.hpp:44
Tuning parameters for first minimum and cutoff detection.
Definition FirstMinimumDetector.hpp:51
real_t core_floor_radius
Hard-core lower bound floor for r_min in Å.
Definition FirstMinimumDetector.hpp:60
real_t min_search_radius
Minimum radius (Å) to start searching for the primary peak.
Definition FirstMinimumDetector.hpp:52
real_t onset_threshold_frac
Fraction of peak height defining peak onset (r_min).
Definition FirstMinimumDetector.hpp:58
real_t search_window
Radial search window (Å) after peak to locate the first minimum.
Definition FirstMinimumDetector.hpp:56
bool apply_smoothing
Whether to apply 3-point filter before derivative analysis.
Definition FirstMinimumDetector.hpp:62
real_t max_search_radius
Maximum radius (Å) to search for the primary peak.
Definition FirstMinimumDetector.hpp:54
Container for a single calculated distribution function.
Definition DistributionFunctions.hpp:226