votca 2024.2-dev
Loading...
Searching...
No Matches
xtp_tools.cc
Go to the documentation of this file.
1/*
2 * Copyright 2009-2023 The VOTCA Development Team (http://www.votca.org)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16
17#include "xtp_bind_tools.h"
18#include <iostream>
20
21using namespace votca;
22
23namespace pyxtp {
24
25void call_tool(const std::string& name, Index nThreads, std::string xmlfile) {
27 prop.LoadFromXML(xmlfile);
28
31 handler.ProcessUserInput(prop, name).get("options." + name);
32
33 // Call calculator
34 pyxtp::XTPTools tool;
35 tool.Initialize(name, nThreads, options);
36}
37
38void XTPTools::Initialize(const std::string& name, Index nThreads,
41 tool_->setnThreads(nThreads);
42 tool_->Initialize(prop);
43 tool_->Evaluate();
44}
45
46} // namespace pyxtp
void Initialize(const std::string &calculatorName, Index nThreads, votca::tools::Property prop)
Definition xtp_tools.cc:38
std::unique_ptr< xtp::QMTool > tool_
void setnThreads(Index nThreads)
Sets number of threads to use.
Definition calculator.h:83
virtual std::unique_ptr< T > Create(const key_t &key, args_t &&...arguments)
Property ProcessUserInput(const Property &user_input, const std::string &calcname) const
Load the default options and merge them with the user input.
class to manage program options with xml serialization functionality
Definition property.h:55
Property & get(const std::string &key)
get existing property
Definition property.cc:79
void LoadFromXML(std::string filename)
Definition property.cc:238
void Initialize(const tools::Property &options) final
Initializes a calculator from an XML file with options.
Definition qmtool.cc:27
void call_tool(const std::string &calculatorName, Index nThreads, std::string xmlfile)
Construct a new pybind11 module object to invoke a votca-xtp QMTool.
Definition xtp_tools.cc:25
std::string GetVotcaShare()
Retrieves VOTCASHARE environment variable. Throws std::runtime_error if not set.
Definition globals.cc:27
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26