Kicks off the Process Search.
39 {
41 std::string displacementFilename("displacement.con");
42 std::string modeFilename("direction.dat");
43 size_t fctmp{0};
45 if (
params.saddle_search_options().method ==
"min_mode" ||
46 params.saddle_search_options().method ==
"basin_hopping" ||
47 params.saddle_search_options().method ==
"bgsd") {
49 }
else if (
params.saddle_search_options().method ==
"dynamics") {
51 }
53
54
55
56 std::shared_ptr<Potential> min2Pot =
pot;
57 if (
pot->needsPerImageInstance() &&
params.main_options().parallel) {
58 auto cloned =
pot->clonePotential();
60 }
62 min2 = std::make_shared<Matter>(min2Pot,
params);
63
66 throw std::runtime_error("failed to load " + reactantFilename);
67 }
68
69 if (
params.process_search_options().minimize_first) {
70 QUILL_LOG_DEBUG(
log,
"Minimizing initial structure\n");
71 fctmp =
initial->getPotentialCalls();
74 QUILL_LOG_DEBUG(
log,
"Initial minimization took {} fcalls",
75 initial->getPotentialCalls() - fctmp);
76 }
77
80
82 if (
params.saddle_search_options().method ==
"min_mode" ||
83 params.saddle_search_options().method ==
"basin_hopping" ||
84 params.saddle_search_options().method ==
"bgsd") {
85 if (
params.saddle_search_options().displace_type ==
87
88
91 params.saddle_search_options().displace_magnitude)) {
93 displacementFilename, modeFilename);
94 throw std::runtime_error("failed to load " + displacementFilename);
95 }
98 &mode)) {
100 } else {
102 }
105 }
106 } else {
107
109 }
110 min2->setPotential(min2Pot);
111
112 const bool useARTnAsMinMode =
113 params.saddle_search_options().method ==
"min_mode" &&
114 params.saddle_search_options().minmode_method ==
"artn";
115
116 if (
params.saddle_search_options().method ==
"min_mode") {
117 if (
params.saddle_search_options().displace_type ==
119 std::filesystem::exists(modeFilename)) {
121 }
122#ifdef WITH_ARTN
123
124
125 if (useARTnAsMinMode) {
128 } else
129#endif
130 {
133 }
134#ifdef WITH_ARTN
135 }
else if (
params.saddle_search_options().method ==
"artn") {
136
137
139 if (
params.saddle_search_options().displace_type ==
141 std::filesystem::exists(modeFilename)) {
142 artnMode =
144 }
147#endif
148 }
else if (
params.saddle_search_options().method ==
"basin_hopping") {
151 }
else if (
params.saddle_search_options().method ==
"dynamics") {
153 }
else if (
params.saddle_search_options().method ==
"bgsd") {
154 saddleSearch = std::make_unique<BiasedGradientSquaredDescent>(
156 }
157
158#ifndef WITH_ARTN
159
160
161
162
163 if (
params.saddle_search_options().method ==
"artn") {
164 throw std::runtime_error(
165 "saddle_search.method=artn requires a build with ARTn support "
166 "(reconfigure with -Dwith_artn=true)");
167 }
168 if (useARTnAsMinMode) {
169 throw std::runtime_error(
170 "saddle_search.minmode_method=artn requires a build with ARTn "
171 "support (reconfigure with -Dwith_artn=true)");
172 }
173#endif
174
176 throw std::runtime_error("unknown saddle_search.method");
177 }
178
181}
#define EONC_LOG_CRITICAL(...)
std::shared_ptr< Matter > displacement
Configuration used during the saddle point search.
std::vector< std::string > returnFiles
Container for the results of the run.
std::shared_ptr< Matter > runPrepared()
bool applyClientDisplacement(Matter &target, const Matter &initial, const Parameters ¶ms, AtomMatrix *modeOut)
std::string getRelevantFile(std::string filename)
bool loadOrSynthesizeDisplacement(Matter &target, const Matter &initial, const std::string &displacementPath, const std::string &modePath, double scale)
AtomMatrix loadMode(FILE *modeFile, int nAtoms)
std::shared_ptr< Potential > makePotential(const Parameters ¶ms)
constexpr bool io_ok(IoStatus s) noexcept