Loading...
Searching...
No Matches
DynamicsJob.cpp
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#include <stdexcept>
13#include <string>
14
15#include "eon/Dynamics.h"
16#include "eon/DynamicsJob.h"
17#include "eon/EonLogger.h"
18#include "eon/HelperFunctions.h"
19#include "eon/Parameters.h"
20#include "eon/Potential.h"
21
22std::vector<std::string> DynamicsJob::run(void) {
23 auto R = std::make_shared<Matter>(pot, params);
24 auto F = std::make_shared<Matter>(pot, params);
25 if (!eonc::io::io_ok(R->con2matter("pos.con"))) {
26 EONC_LOG_CRITICAL("Failed to load pos.con");
27 throw std::runtime_error("failed to load pos.con");
28 }
29 *F = *R;
30
31 auto d = std::make_unique<Dynamics>(R.get(), params);
32 d->run();
33
34 *F = *R;
35 std::string productFilename("final.con");
36 if (!eonc::io::io_ok(F->matter2con(productFilename))) {
37 EONC_LOG_ERROR("Failed to write {}", productFilename);
38 }
39
40 std::vector<std::string> returnFiles;
41 returnFiles.push_back(productFilename);
42 return returnFiles;
43}
#define EONC_LOG_ERROR(...)
Definition EonLogger.h:262
#define EONC_LOG_CRITICAL(...)
Definition EonLogger.h:268
std::vector< std::string > run(void)
Virtual run; used solely for dynamic dispatch.
std::vector< std::string > returnFiles
Definition DynamicsJob.h:26
std::shared_ptr< Potential > pot
Definition Job.h:55
Parameters params
Definition Job.h:54
constexpr bool io_ok(IoStatus s) noexcept
Definition ConFileIO.h:38