Kicks off the Process Search.
85 {
86 if (
params.saddle_search_options().method ==
"min_mode") {
88 }
90 std::string displacementFilename("displacement.con");
91 std::string modeFilename("direction.dat");
92 size_t fctmp{0};
94 if (
params.saddle_search_options().method ==
"min_mode" ||
95 params.saddle_search_options().method ==
"basin_hopping" ||
96 params.saddle_search_options().method ==
"bgsd") {
98 }
else if (
params.saddle_search_options().method ==
"dynamics") {
100 }
102
103 std::shared_ptr<Potential> min2Pot =
pot;
104 if (
pot->needsPerImageInstance() &&
params.main_options().parallel) {
106 }
108 min2 = std::make_shared<Matter>(min2Pot,
params);
109
112 throw std::runtime_error("failed to load " + reactantFilename);
113 }
114
115 if (
params.process_search_options().minimize_first) {
116 QUILL_LOG_DEBUG(
log,
"Minimizing initial structure\n");
117 fctmp =
initial->getPotentialCalls();
120 QUILL_LOG_DEBUG(
log,
"Initial minimization took {} fcalls",
121 initial->getPotentialCalls() - fctmp);
122 }
123
126
128 if (
params.saddle_search_options().method ==
"min_mode" ||
129 params.saddle_search_options().method ==
"basin_hopping" ||
130 params.saddle_search_options().method ==
"bgsd") {
131 if (
params.saddle_search_options().displace_type ==
133
134
137 params.saddle_search_options().displace_magnitude)) {
139 displacementFilename, modeFilename);
140 throw std::runtime_error("failed to load " + displacementFilename);
141 }
144 &mode)) {
146 } else {
148 }
151 }
152 } else {
153
155 }
156 min2->setPotential(min2Pot);
157
158 const bool useARTnAsMinMode =
159 params.saddle_search_options().method ==
"min_mode" &&
160 params.saddle_search_options().minmode_method ==
"artn";
161
162 if (
params.saddle_search_options().method ==
"min_mode") {
163 if (
params.saddle_search_options().displace_type ==
165 std::filesystem::exists(modeFilename)) {
167 }
168#ifdef WITH_ARTN
169
170
171 if (useARTnAsMinMode) {
174 } else
175#endif
176 {
177 auto minMode = std::make_unique<MinModeSaddleSearch>(
179 if (
params.process_search_options().known_saddles) {
180 loadKnownSaddles(
"known_saddles.dat", *
initial, *minMode);
181 }
183 }
184#ifdef WITH_ARTN
185 }
else if (
params.saddle_search_options().method ==
"artn") {
186
187
189 if (
params.saddle_search_options().displace_type ==
191 std::filesystem::exists(modeFilename)) {
192 artnMode =
194 }
197#endif
198 }
else if (
params.saddle_search_options().method ==
"basin_hopping") {
201 }
else if (
params.saddle_search_options().method ==
"dynamics") {
203 }
else if (
params.saddle_search_options().method ==
"bgsd") {
204 saddleSearch = std::make_unique<BiasedGradientSquaredDescent>(
206 }
207
208#ifndef WITH_ARTN
209
210
211
212
213 if (
params.saddle_search_options().method ==
"artn") {
214 throw std::runtime_error(
215 "saddle_search.method=artn requires a build with ARTn support "
216 "(reconfigure with -Dwith_artn=true)");
217 }
218 if (useARTnAsMinMode) {
219 throw std::runtime_error(
220 "saddle_search.minmode_method=artn requires a build with ARTn "
221 "support (reconfigure with -Dwith_artn=true)");
222 }
223#endif
224
226 throw std::runtime_error("unknown saddle_search.method");
227 }
228
231}
#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)
std::shared_ptr< Potential > makeImagePotential(const Potential &pot, const Parameters ¶ms)
A separate instance of pot for one image of a band, dimer or pair of minimizations: a clone when the ...
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
void requirePrfoRefine(const Parameters ¶ms)
Does nothing unless [Saddle Search] prfo_refine is on.