Loading...
Searching...
No Matches
SaddleSearchJob.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
15#include "HelperFunctions.h"
16#include "Job.h"
17#include "Matter.h"
18#include "MinModeSaddleSearch.h"
19#include "Parameters.h"
20#include "SaddleSearchMethod.h"
21
22namespace eonc {
23
40
44
45class SaddleSearchJob : public Job {
46public:
48
52 SaddleSearchJob(std::unique_ptr<Parameters> parameters, Runtime &rt)
53 : Job(std::move(parameters), rt), fCallsSaddle{0} {}
54 SaddleSearchJob(std::shared_ptr<Potential> potPassed,
55 const Parameters &parameters)
56 : Job(std::move(potPassed), parameters), fCallsSaddle{0} {}
57
58 ~SaddleSearchJob(void) = default;
60 std::vector<std::string> run(void) override;
62 std::shared_ptr<Matter> runFromMatter(std::shared_ptr<Matter> seed);
63
64private:
65 std::shared_ptr<Matter> runPrepared(const AtomMatrix &mode);
67 int doSaddleSearch();
69 void printEndState(int status);
71 void saveData(int status);
75 void runIrc();
76
77 struct IrcSummary {
78 bool ran{false};
80 bool endsRelaxed{false};
81 bool connectsReactant{false};
82 size_t forceCalls{0};
83 size_t forceCallsMin{0};
84 double energies[2]{0.0, 0.0};
85 } irc;
86
88 std::vector<std::string> returnFiles;
89
91 std::unique_ptr<SaddleSearchMethod> saddleSearch;
93 std::shared_ptr<Matter> initial;
95 std::shared_ptr<Matter> saddle;
97 std::shared_ptr<Matter> displacement;
98
103 size_t fCallsImages{0};
104
106};
107
108} // namespace eonc
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
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, Runtime &rt, ExclusivePotential)
Definition Job.h:71
Move-only composition root for process resources (dlopen loaders and the potential registry).
Definition Runtime.h:27
std::unique_ptr< SaddleSearchMethod > saddleSearch
Initializes a ref SaddleSearchMethod (base class for polymorphism).
std::vector< std::string > returnFiles
Container for the results of the run.
std::shared_ptr< Matter > runFromMatter(std::shared_ptr< Matter > seed)
In-process entry: seed reactant Matter, no pos.con.
std::shared_ptr< Matter > saddle
Configuration used during the saddle point search.
SaddleSearchJob(std::shared_ptr< Potential > potPassed, const Parameters &parameters)
eonc::log::Scoped log
SaddleSearchJob(std::unique_ptr< Parameters > parameters, Runtime &rt)
Saddle Search job constructor.
std::vector< std::string > run(void) override
Kicks off the Saddle Search.
int doSaddleSearch()
Runs the correct saddle search; also checks if the run was successful.
int fCallsSaddle
Force calls to find the saddle.
struct eonc::SaddleSearchJob::IrcSummary irc
~SaddleSearchJob(void)=default
Saddle Search Job Deconstructor.
std::shared_ptr< Matter > displacement
Configuration used during the saddle point search.
void saveData(int status)
Writes the results from the run to file.
void printEndState(int status)
Logs the run status and makes sure the run was successful.
std::shared_ptr< Matter > initial
Initial configuration.
std::shared_ptr< Matter > runPrepared(const AtomMatrix &mode)
RAII resource manager for the ARTn C library with global synchronization.
RAII helper for class-scoped logging.
Definition EonLogger.h:238