Kicks off the Saddle Search.
27 {
28 std::string reactantFilename("pos.con");
29 std::string displacementFilename("displacement.con");
30 std::string modeFilename("direction.dat");
31
32 if (
params.main_options.checkpoint) {
33 if (std::filesystem::exists("displacement_cp.con") &&
34 std::filesystem::exists("mode_cp.dat")) {
35 displacementFilename = "displacement_cp.con";
36 modeFilename = "mode_cp.dat";
37 QUILL_LOG_DEBUG(
log,
"Resuming from checkpoint");
38 } else {
39 QUILL_LOG_DEBUG(
log,
"No checkpoint files found");
40 }
41 }
42
46
49 throw std::runtime_error("failed to load " + reactantFilename);
50 }
51
52 const bool standaloneARTn =
params.saddle_search_options.method ==
"artn";
53
54 if (!standaloneARTn &&
params.saddle_search_options.displace_type ==
56
59 params.saddle_search_options.displace_magnitude)) {
61 displacementFilename, modeFilename);
62 throw std::runtime_error("missing displacement.con and direction.dat");
63 }
64 } else {
66 }
67
69 const bool canLoadMode =
71 if (canLoadMode && std::filesystem::exists(modeFilename)) {
73 }
74
75 const bool useStandaloneARTn =
params.saddle_search_options.method ==
"artn";
76 const bool useARTnAsMinMode =
77 params.saddle_search_options.method ==
"min_mode" &&
78 params.saddle_search_options.minmode_method ==
"artn";
79
80#ifdef WITH_ARTN
81 if (useStandaloneARTn || useARTnAsMinMode) {
84 } else
85#endif
86 {
87#ifndef WITH_ARTN
88 if (useStandaloneARTn) {
89 throw std::runtime_error(
90 "saddle_search.method=artn requires a build with ARTn support");
91 }
92 if (useARTnAsMinMode) {
93 throw std::runtime_error(
94 "saddle_search.minmode_method=artn requires a build with ARTn "
95 "support");
96 }
97#endif
100 }
101
105
107}
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
#define EONC_LOG_CRITICAL(...)
void saveData(int status)
Writes the results from the run to file.
std::vector< std::string > returnFiles
Container for the results of the run.
std::shared_ptr< Matter > saddle
Configuration used during the saddle point search.
std::shared_ptr< Matter > displacement
Configuration used during the saddle point search.
void printEndState(int status)
Logs the run status and makes sure the run was successful.
int doSaddleSearch()
Runs the correct saddle search; also checks if the run was successful.
std::shared_ptr< Matter > initial
Initial configuration.
bool loadOrSynthesizeDisplacement(Matter &target, const Matter &initial, const std::string &displacementPath, const std::string &modePath, double scale)
AtomMatrix loadMode(FILE *modeFile, int nAtoms)
constexpr bool io_ok(IoStatus s) noexcept