votca 2026-dev
Loading...
Searching...
No Matches
xtpdft.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2022 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_XTPDFT_H
22#define VOTCA_XTP_XTPDFT_H
23
24// Standard includes
25#include <memory>
26#include <string>
27
28// Local VOTCA includes
29#include "votca/xtp/dftengine.h"
30#include "votca/xtp/orbitals.h"
32#include "votca/xtp/polarsite.h"
33#include "votca/xtp/qmpackage.h"
34
35namespace votca {
36namespace xtp {
37
43
44class XTPDFT final : public QMPackage {
45 public:
46 std::string getPackageName() const final { return "xtp"; }
47
48 bool WriteInputFile(const Orbitals& orbitals) final;
49
50 bool RunDFT() final;
51
52 bool RunActiveDFT() final;
53
54 void setSetupCache(std::shared_ptr<DFTSetupCache> cache) final {
55 setup_cache_ = std::move(cache);
56 }
57
58 void setSCFToleranceFloor(double energy, double error) final {
59 scf_energy_floor_ = energy;
60 scf_error_floor_ = error;
61 }
62
63 void CleanUp() final;
64
66
67 bool ParseLogFile(Orbitals& orbitals) final;
68
69 bool ParseMOsFile(Orbitals& orbitals) final;
70
71 StaticSegment GetCharges() const final {
72 throw std::runtime_error(
73 "If you want partial charges just run the 'partialcharges' calculator");
74 }
75
78 Eigen::Matrix3d GetPolarizability() const final;
79
80 protected:
81 void ParseSpecificOptions(const tools::Property& options) final;
82 const std::array<Index, 49>& ShellMulitplier() const final {
83 return multipliers_;
84 }
85 const std::array<Index, 49>& ShellReorder() const final {
86 return reorderList_;
87 }
88
89 private:
90 // clang-format off
91 std::array<Index,49> multipliers_={{
92 1, //s
93 1,1,1, //p
94 1,1,1,1,1, //d
95 1,1,1,1,1,1,1, //f
96 1,1,1,1,1,1,1,1,1, //g
97 1,1,1,1,1,1,1,1,1,1,1, //h
98 1,1,1,1,1,1,1,1,1,1,1,1,1 //i
99 }};
100 std::array<Index,49> reorderList_={{
101 0, //s
102 0,0,0, //p
103 0,0,0,0,0, //d
104 0,0,0,0,0,0,0, //f
105 0,0,0,0,0,0,0,0,0, //g
106 0,0,0,0,0,0,0,0,0,0,0, //h
107 0,0,0,0,0,0,0,0,0,0,0,0,0, //i
108 }};
109 // clang-format on
110
111 void WriteChargeOption() final { return; }
113 // setup kept between runs (QM/MM iterations) by the caller; may be empty
114 std::shared_ptr<DFTSetupCache> setup_cache_;
115 double scf_energy_floor_ = 0.0;
116 double scf_error_floor_ = 0.0;
117
119};
120
121} // namespace xtp
122} // namespace votca
123
124#endif // VOTCA_XTP_XTPDFT_H
class to manage program options with xml serialization functionality
Definition property.h:55
Container for molecular orbitals and derived one-particle data.
Definition orbitals.h:47
Wrapper for the internal XTP DFT engine.
Definition xtpdft.h:44
void WriteChargeOption() final
Definition xtpdft.h:111
bool ParseLogFile(Orbitals &orbitals) final
Definition xtpdft.cc:136
Orbitals orbitals_
Definition xtpdft.h:118
const std::array< Index, 49 > & ShellMulitplier() const final
Definition xtpdft.h:82
double scf_error_floor_
Definition xtpdft.h:116
Eigen::Matrix3d GetPolarizability() const final
Definition xtpdft.cc:38
void setSCFToleranceFloor(double energy, double error) final
Definition xtpdft.h:58
double scf_energy_floor_
Definition xtpdft.h:115
void setSetupCache(std::shared_ptr< DFTSetupCache > cache) final
Definition xtpdft.h:54
const std::array< Index, 49 > & ShellReorder() const final
Definition xtpdft.h:85
bool RunDFT() final
Definition xtpdft.cc:67
void ParseSpecificOptions(const tools::Property &options) final
Definition xtpdft.cc:51
void CleanUp() final
Definition xtpdft.cc:115
std::string getPackageName() const final
Definition xtpdft.h:46
bool WriteInputFile(const Orbitals &orbitals) final
writes a coordinate file WITHOUT taking into account PBCs
Definition xtpdft.cc:57
std::shared_ptr< DFTSetupCache > setup_cache_
Definition xtpdft.h:114
tools::Property xtpdft_options_
Definition xtpdft.h:112
bool ParseMOsFile(Orbitals &orbitals) final
Definition xtpdft.cc:134
StaticSegment GetCharges() const final
Definition xtpdft.h:71
std::array< Index, 49 > reorderList_
Definition xtpdft.h:100
std::array< Index, 49 > multipliers_
Definition xtpdft.h:91
bool RunActiveDFT() final
Definition xtpdft.cc:97
STL namespace.
ClassicalSegment< StaticSite > StaticSegment
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26
Parts of the DFT setup that stay the same between runs on the same molecule with the same basis sets,...
Definition dftengine.h:55