Loading...
Searching...
No Matches
ReplicaDynamicsJob.h
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13#include "EonLogger.h"
14#include "Job.h"
15#include "Matter.h"
16
17#include <memory>
18#include <string>
19#include <vector>
20
21namespace eonc {
22
29class ReplicaDynamicsJob : public Job {
30public:
31 using Job::Job;
32 ~ReplicaDynamicsJob() override = default;
33 std::vector<std::string> run() override;
36 std::shared_ptr<Matter> runFromMatter(std::shared_ptr<Matter> initial);
37
38protected:
39 // -- Shared matter objects --
40 std::shared_ptr<Matter> current;
41 std::shared_ptr<Matter> reactant;
42 std::shared_ptr<Matter> saddle;
43 std::shared_ptr<Matter> product;
44 std::shared_ptr<Matter> finalState; // state at transition detection
45 std::shared_ptr<Matter> finalStateTmp; // candidate before confirmation
46
47 // -- Flags --
48 bool metaStateFlag{false};
49 bool newStateFlag{false};
50
51 // -- Force call counters --
52 size_t minimizeFCalls{0};
53 size_t mdFCalls{0};
54 size_t dephaseFCalls{0};
55 size_t refineFCalls{0};
56
57 // -- Dynamics state --
59 double time{0.0};
60 double minCorrectedTime{1.0e200};
61 double transitionTime{0.0};
62
63 std::vector<std::string> returnFiles;
65
66 // -- Shared methods --
67
71
73 long refine(const std::vector<std::shared_ptr<Matter>> &buff,
75
77 void dephase();
78
80 void saveData(int status);
81
82 // -- Template method hooks --
83
85 virtual void initExtra() {}
86
88 virtual int dynamics() = 0;
89
91 virtual void reportResults() {}
92};
93
94} // namespace eonc
95
The job class is used to serve as an abstract class for all jobs, as well as to call a job at runtime...
Job(std::unique_ptr< Parameters > parameters)
Definition Job.h:58
Base class for replica dynamics jobs (TAD, SafeHyper).
void dephase()
Dephase the trajectory to ensure thermal independence.
std::vector< std::string > returnFiles
std::shared_ptr< Matter > saddle
Job(std::unique_ptr< Parameters > parameters)
Definition Job.h:58
std::shared_ptr< Matter > product
std::shared_ptr< Matter > runFromMatter(std::shared_ptr< Matter > initial)
Matter-first entry: seed geometry, skip con2matter load.
long refine(const std::vector< std::shared_ptr< Matter > > &buff, Matter *reactant)
Binary search for the transition frame in a snapshot buffer.
~ReplicaDynamicsJob() override=default
virtual int dynamics()=0
The accelerated dynamics loop. Returns status (1 = transition, 0 = none).
std::shared_ptr< Matter > finalState
virtual void initExtra()
Create any extra matter objects needed by the subclass.
virtual void reportResults()
Post-dynamics logging (override for job-specific messages).
std::shared_ptr< Matter > reactant
std::vector< std::string > run() override
Virtual run; used solely for dynamic dispatch.
void saveData(int status)
Write results.dat and structure con files.
std::shared_ptr< Matter > current
bool checkState(Matter *current, Matter *reactant)
Minimize a copy of current and compare to reactant.
std::shared_ptr< Matter > finalStateTmp
RAII resource manager for the ARTn C library with global synchronization.
RAII helper for class-scoped logging.
Definition EonLogger.h:171