43 std::string tasks_string = options.
get(
".tasks").
as<std::string>();
47 std::vector<std::string> tasks = tokenizedTasks.ToVector();
49 do_dft_input_ = std::find(tasks.begin(), tasks.end(),
"input") != tasks.end();
50 do_dft_run_ = std::find(tasks.begin(), tasks.end(),
"dft") != tasks.end();
51 do_dft_parse_ = std::find(tasks.begin(), tasks.end(),
"parse") != tasks.end();
52 do_gwbse_ = std::find(tasks.begin(), tasks.end(),
"gwbse") != tasks.end();
53 do_esp_ = std::find(tasks.begin(), tasks.end(),
"esp") != tasks.end();
115 std::vector<tools::Property*> lSegments = job_input_.
Select(
"segment");
116 Index segId = lSegments.front()->getAttribute<
Index>(
"id");
117 std::string segType = lSegments.front()->getAttribute<std::string>(
"type");
118 std::string qmgeo_state =
"n";
119 if (lSegments.front()->exists(
"qm_geometry")) {
120 qmgeo_state = lSegments.front()->getAttribute<std::string>(
"qm_geometry");
131 <<
TimeStamp() <<
" Evaluating site " << seg.
getId() << std::flush;
134 std::filesystem::path arg_path;
135 std::string eqm_work_dir =
"OR_FILES";
136 std::string frame_dir =
137 "frame_" + boost::lexical_cast<std::string>(top.
getStep());
138 std::string orb_file =
139 (format(
"%1%_%2%%3%") %
"molecule" % segId %
".orb").str();
140 std::string mol_dir = (format(
"%1%%2%%3%") %
"molecule" %
"_" % segId).str();
141 std::string package_append =
"workdir_" +
Identify();
142 std::string work_dir =
143 (arg_path / eqm_work_dir / package_append / frame_dir / mol_dir)
149 std::string segName = seg.
getType();
161 std::string
package = package_options_.get(".name").as<std::string>();
163 qmpackage->setLog(&dft_logger);
164 qmpackage->setRunDir(work_dir);
165 qmpackage->Initialize(package_options_);
169 std::filesystem::create_directories(work_dir);
170 qmpackage->WriteInputFile(orbitals);
174 bool run_dft_status = qmpackage->Run();
175 if (!run_dft_status) {
176 std::string output =
"DFT run failed";
177 SetJobToFailed(jres, pLog, output);
184 bool parse_log_status = qmpackage->ParseLogFile(orbitals);
185 if (!parse_log_status) {
186 std::string output =
"log incomplete; ";
187 SetJobToFailed(jres, pLog, output);
190 bool parse_orbitals_status = qmpackage->ParseMOsFile(orbitals);
191 if (!parse_orbitals_status) {
192 std::string output =
"orbfile failed; ";
193 SetJobToFailed(jres, pLog, output);
197 if (qmpackage->getPackageName() ==
"orca") {
198 std::string DIR = eqm_work_dir +
"/molecules/" + frame_dir;
199 std::filesystem::create_directories(DIR);
200 std::string gbw_file =
201 (format(
"%1%_%2%%3%") %
"molecule" % segId %
".gbw").str();
202 std::string GBWFILE = DIR +
"/" + gbw_file;
204 <<
"Copying MO data to " << gbw_file << std::flush;
205 std::string GBWFILE_workdir =
207 package_options_.get(
"temporary_file").as<std::string>() +
".gbw";
208 std::filesystem::copy_file(
209 GBWFILE_workdir, GBWFILE,
210 std::filesystem::copy_options::overwrite_existing);
214 qmpackage->CleanUp();
215 WriteLoggerToFile(work_dir +
"/dft.log", dft_logger);
220 std::string ORB_FILE =
221 eqm_work_dir +
"/molecules/" + frame_dir +
"/" + orb_file;
223 <<
TimeStamp() <<
" Loading DFT data from " << ORB_FILE << std::flush;
242 }
catch (std::runtime_error& error) {
243 std::string errormessage(error.what());
257 std::string mps_file = (format(
"%1%_%2%_%3%.mps") % segType % segId %
260 std::filesystem::create_directories(ESPDIR);
261 seg2.
WriteMPS(ESPDIR +
"/" + mps_file,
264 <<
"Written charges to " << (ESPDIR +
"/" + mps_file) << std::flush;
265 segment_summary.
add(
"partialcharges", (ESPDIR +
"/" + mps_file));
266 }
catch (std::runtime_error& error) {
267 std::string errormessage(error.what());
273 << seg.
getId() << std::flush;
277 std::string DIR = eqm_work_dir +
"/molecules/" + frame_dir;
278 std::filesystem::create_directories(DIR);
279 std::string ORBFILE = DIR +
"/" + orb_file;