7 #ifndef READUCT_TASKFACTORY_H_
8 #define READUCT_TASKFACTORY_H_
46 static std::unique_ptr<Task>
produce(std::string name,
const std::vector<std::string>& input,
47 const std::vector<std::string>& output, std::shared_ptr<Core::Log> logger =
nullptr) {
48 std::unique_ptr<Task> task;
49 std::transform(name.begin(), name.end(), name.begin(), ::toupper);
50 if (name ==
"OPT" || name ==
"GEOOPT" || name ==
"GEOMETRYOPTIMIZATION" || name ==
"GEOMETRY_OPTIMIZATION") {
51 task = std::make_unique<GeometryOptimizationTask>(input, output, logger);
53 else if (name ==
"AFIR" || name ==
"AFIROPT" || name ==
"AFIROPTIMIZATION" || name ==
"AFIR_OPTIMIZATION") {
54 task = std::make_unique<AfirOptimizationTask>(input, output, logger);
56 else if (name ==
"TS" || name ==
"TSOPT" || name ==
"TRANSITIONSTATE_OPTIMIZATION" ||
57 name ==
"TRANSITION_STATE_OPTIMIZATION") {
58 task = std::make_unique<TsOptimizationTask>(input, output, logger);
60 else if (name ==
"SP" || name ==
"SINGLEPOINT" || name ==
"ENERGY" || name ==
"SINGLE_POINT") {
61 task = std::make_unique<SinglePointTask>(input, output, logger);
63 else if (name ==
"IRC" || name ==
"IRCOPT") {
64 task = std::make_unique<IrcTask>(input, output, logger);
66 else if (name ==
"NT" || name ==
"NEWTONTRAJECTORY" || name ==
"NTOPTIMIZATION" ||
67 name ==
"NEWTONTRAJECTORYOPTIMIZATION" || name ==
"NTOPT" || name ==
"NT1") {
68 task = std::make_unique<NtOptimizationTask>(input, output);
70 else if (name ==
"NT2" || name ==
"NEWTONTRAJECTORY2" || name ==
"NTOPTIMIZATION2" ||
71 name ==
"NEWTONTRAJECTORYOPTIMIZATION2" || name ==
"NTOPT2") {
72 task = std::make_unique<NtOptimization2Task>(input, output);
74 else if (name ==
"HESSIAN" || name ==
"FREQUENCY_ANALYSIS" || name ==
"FREQUENCYANALYSIS" || name ==
"FREQ" ||
75 name ==
"FREQUENCY" || name ==
"FREQUENCIES") {
76 task = std::make_unique<HessianTask>(input, output, logger);
78 else if (name ==
"BONDS" || name ==
"BOND_ORDERS" || name ==
"BONDORDERS" || name ==
"BOS" || name ==
"BO") {
79 task = std::make_unique<BondOrderTask>(input, output, logger);
81 else if (name ==
"BSPLINE_INTERPOLATION" || name ==
"BSPLINEINTERPOLATION" || name ==
"BSPLINE") {
82 task = std::make_unique<BSplineInterpolationTask>(input, output, logger);
84 else if (name ==
"INTEGRALS" || name ==
"INTS") {
85 task = std::make_unique<IntegralTask>(input, output, logger);
88 throw std::runtime_error(
"The requested task '" + name +
"' is not available.\n");
97 #endif // READUCT_TASKFACTORY_H_
static std::unique_ptr< Task > produce(std::string name, const std::vector< std::string > &input, const std::vector< std::string > &output, std::shared_ptr< Core::Log > logger=nullptr)
Contstructs a Task with a given set of input and output systems.
Definition: TaskFactory.h:46
A factory generating Tasks by name (mainly).
Definition: TaskFactory.h:33
TaskFactory()=delete
Has only static functions.