|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Dispatches analysis workflows to CorrelationEngine, handles cancellation, and exports data. More...
#include <AnalysisDispatcher.hpp>

Public Types | |
| using | ProgressCallback = std::function<void(float, const std::string &)> |
Public Member Functions | |
| AnalysisDispatcher ()=default | |
| ~AnalysisDispatcher () | |
| AnalysisDispatcher (const AnalysisDispatcher &)=delete | |
| AnalysisDispatcher & | operator= (const AnalysisDispatcher &)=delete |
| AnalysisDispatcher (AnalysisDispatcher &&)=delete | |
| AnalysisDispatcher & | operator= (AnalysisDispatcher &&)=delete |
| std::expected< void, std::string > | runAnalysis (correlation::core::Trajectory *trajectory, const ProgramOptions &options) |
| Executes analysis for the given trajectory and options. | |
| std::expected< void, std::string > | runAnalysis (correlation::core::Trajectory &trajectory, const ProgramOptions &options) |
| Executes analysis for the given trajectory reference and options. | |
| std::expected< void, std::string > | runFastPreviewRDF (correlation::core::Trajectory *trajectory, const ProgramOptions &options) |
| Executes a rapid single-frame RDF calculation for fast live calibration preview. | |
| std::expected< void, std::string > | runSelectiveRecalculation (correlation::core::Trajectory *trajectory, const ProgramOptions &options) |
| Selectively recalculates only bond-dependent algorithms when bond cutoffs change. Preserves already calculated distance-based distributions (RDF, S(Q), XRD) and dynamic properties. If no previous results exist, falls back to full analysis. | |
| std::expected< void, std::string > | runSelectiveRecalculation (correlation::core::Trajectory &trajectory, const ProgramOptions &options) |
| Selectively recalculates only bond-dependent algorithms when bond cutoffs change. | |
| std::expected< void, std::string > | writeFiles (const ProgramOptions &options) const |
| Writes analytical results to disk (CSV, HDF5, Parquet). | |
| void | cancelAnalysis () noexcept |
| Signals running analysis to abort at next cancellation checkpoint. | |
| bool | isCancelled () const noexcept |
| Checks if cancellation was requested. | |
| void | setProgressCallback (ProgressCallback callback) |
| Sets progress notification hook. | |
| std::vector< std::string > | getAvailableHistogramNames () const |
| Gets all available histogram names from last completed analysis. | |
| const correlation::analysis::Histogram * | getHistogram (const std::string &name) const |
| Retrieves a specific analytical histogram by name. | |
| const std::map< std::string, correlation::analysis::Histogram > & | getHistograms () const |
| Retrieves all analytical histograms from last run. | |
| std::map< std::string, real_t > | getAshcroftWeights () const |
| Retrieves Ashcroft-Langreth weights for partial structure factors. | |
| const correlation::analysis::DistributionFunctions * | getDistributionFunctions () const noexcept |
| Returns active DistributionFunctions pointer. | |
| void | setDistributionFunctions (std::unique_ptr< correlation::analysis::DistributionFunctions > distribution_functions) noexcept |
| Injects an existing DistributionFunctions container (useful for testing). | |
| void | clear () noexcept |
| Clears current results. | |
| void | bindPerFrameTrajectory (std::shared_ptr< const correlation::core::Trajectory > trajectory) |
| Attaches a shared trajectory to lazily populate out-of-range 1D frame curves on demand. | |
| void | startPerFramePrebake (std::shared_ptr< const correlation::core::Trajectory > trajectory, std::function< void()> on_complete=nullptr) |
| Starts a cancellable background worker to pre-bake remaining 1D per-frame curves. | |
| void | stopPerFramePrebake () noexcept |
| Stops and joins any running per-frame pre-bake worker thread. | |
Static Public Member Functions | |
| static bool | isBondDependentCalculator (std::string_view calc_id) noexcept |
| Queries whether a calculator depends on bond cutoffs. | |
| static std::vector< std::string > | getBondDependentCalculatorNames () |
| Gets all canonical calculator names that depend on bond cutoffs. | |
| static std::expected< void, std::string > | validateOptions (const ProgramOptions &options) |
| Validates analysis configuration before execution. | |
Private Attributes | |
| std::shared_mutex | df_mutex_ |
| std::unique_ptr< correlation::analysis::DistributionFunctions > | df_ |
| correlation::analysis::AnalysisSettings | last_settings_ {} |
| correlation::analysis::BondCutoffMatrix | last_bond_cutoffs_ {} |
| std::atomic< bool > | cancel_flag_ {false} |
| std::atomic< bool > | prebake_cancel_ {false} |
| std::jthread | prebake_thread_ |
| ProgressCallback | progress_callback_ |
Dispatches analysis workflows to CorrelationEngine, handles cancellation, and exports data.
| using correlation::app::AnalysisDispatcher::ProgressCallback = std::function<void(float, const std::string &)> |
|
default |

| correlation::app::AnalysisDispatcher::~AnalysisDispatcher | ( | ) |

|
delete |

|
delete |

| void correlation::app::AnalysisDispatcher::bindPerFrameTrajectory | ( | std::shared_ptr< const correlation::core::Trajectory > | trajectory | ) |
Attaches a shared trajectory to lazily populate out-of-range 1D frame curves on demand.
| [in] | trajectory | Shared pointer to active trajectory. |


|
inlinenoexcept |
Signals running analysis to abort at next cancellation checkpoint.
|
noexcept |
Clears current results.

|
nodiscard |
Retrieves Ashcroft-Langreth weights for partial structure factors.
|
nodiscard |
Gets all available histogram names from last completed analysis.
|
staticnodiscard |
Gets all canonical calculator names that depend on bond cutoffs.
|
inlinenodiscardnoexcept |
Returns active DistributionFunctions pointer.
|
nodiscard |
Retrieves a specific analytical histogram by name.
|
nodiscard |
Retrieves all analytical histograms from last run.
|
staticnodiscardnoexcept |
Queries whether a calculator depends on bond cutoffs.
| [in] | calc_id | Name or abbreviation of calculator. |
|
inlinenodiscardnoexcept |
Checks if cancellation was requested.
|
delete |

|
delete |

| std::expected< void, std::string > correlation::app::AnalysisDispatcher::runAnalysis | ( | correlation::core::Trajectory & | trajectory, |
| const ProgramOptions & | options ) |
Executes analysis for the given trajectory reference and options.
| [in] | trajectory | Source trajectory reference with structures to analyze. |
| [in] | options | Analytical configuration parameters. |

| std::expected< void, std::string > correlation::app::AnalysisDispatcher::runAnalysis | ( | correlation::core::Trajectory * | trajectory, |
| const ProgramOptions & | options ) |
Executes analysis for the given trajectory and options.
| [in] | trajectory | Source trajectory with structures to analyze. |
| [in] | options | Analytical configuration parameters. |


| std::expected< void, std::string > correlation::app::AnalysisDispatcher::runFastPreviewRDF | ( | correlation::core::Trajectory * | trajectory, |
| const ProgramOptions & | options ) |
Executes a rapid single-frame RDF calculation for fast live calibration preview.
| [in] | trajectory | Source trajectory reference with structures to analyze. |
| [in] | options | Analytical configuration parameters. |

| std::expected< void, std::string > correlation::app::AnalysisDispatcher::runSelectiveRecalculation | ( | correlation::core::Trajectory & | trajectory, |
| const ProgramOptions & | options ) |
Selectively recalculates only bond-dependent algorithms when bond cutoffs change.
| [in] | trajectory | Source trajectory reference with structures to analyze. |
| [in] | options | Analytical configuration parameters with updated bond cutoffs. |

| std::expected< void, std::string > correlation::app::AnalysisDispatcher::runSelectiveRecalculation | ( | correlation::core::Trajectory * | trajectory, |
| const ProgramOptions & | options ) |
Selectively recalculates only bond-dependent algorithms when bond cutoffs change. Preserves already calculated distance-based distributions (RDF, S(Q), XRD) and dynamic properties. If no previous results exist, falls back to full analysis.
| [in] | trajectory | Source trajectory with structures to analyze. |
| [in] | options | Analytical configuration parameters with updated bond cutoffs. |


|
inlinenoexcept |
Injects an existing DistributionFunctions container (useful for testing).
| distribution_functions | Container to inject. |
|
inline |
Sets progress notification hook.

| void correlation::app::AnalysisDispatcher::startPerFramePrebake | ( | std::shared_ptr< const correlation::core::Trajectory > | trajectory, |
| std::function< void()> | on_complete = nullptr ) |
Starts a cancellable background worker to pre-bake remaining 1D per-frame curves.
| [in] | trajectory | Shared pointer to active trajectory. |
| [in] | on_complete | Optional completion callback. |

|
noexcept |
Stops and joins any running per-frame pre-bake worker thread.

|
staticnodiscard |
Validates analysis configuration before execution.
| [in] | options | Options to validate. |


| std::expected< void, std::string > correlation::app::AnalysisDispatcher::writeFiles | ( | const ProgramOptions & | options | ) | const |
Writes analytical results to disk (CSV, HDF5, Parquet).
| [in] | options | Configuration specifying output formats and destination. |


|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |