votca 2024.2-dev
Loading...
Searching...
No Matches
qmregion.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2023 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_QMREGION_H
22#define VOTCA_XTP_QMREGION_H
23
24// Local VOTCA includes
25#include "hist.h"
26#include "orbitals.h"
27#include "qmpackagefactory.h"
28#include "region.h"
29#include "statetracker.h"
30
38namespace votca {
39namespace xtp {
40
41class PolarRegion;
42class StaticRegion;
43class QMRegion : public Region {
44
45 public:
46 QMRegion(Index id, Logger& log, std::string workdir)
47 : Region(id, log), workdir_(workdir) {};
48 ~QMRegion() override = default;
49
50 void Initialize(const tools::Property& prop) override;
51
52 bool Converged() const override;
53
54 void Evaluate(std::vector<std::unique_ptr<Region> >& regions) override;
55
56 void WriteToCpt(CheckpointWriter& w) const override;
57
58 void ReadFromCpt(CheckpointReader& r) override;
59
60 void ApplyQMFieldToPolarSegments(std::vector<PolarSegment>& segments) const;
61
62 Index size() const override { return size_; }
63
64 void WritePDB(csg::PDBWriter& writer) const override;
65
66 std::string identify() const override { return "qmregion"; }
67
68 void push_back(const QMMolecule& mol);
69
70 void Reset() override;
71
72 double charge() const override;
73 double Etotal() const override { return E_hist_.back(); }
74
75 protected:
76 void AppendResult(tools::Property& prop) const override;
77 double InteractwithQMRegion(const QMRegion& region) override;
78 double InteractwithPolarRegion(const PolarRegion& region) override;
79 double InteractwithStaticRegion(const StaticRegion& region) override;
80
81 private:
82 void AddNucleiFields(std::vector<PolarSegment>& segments,
83 const StaticSegment& seg) const;
84
87
89 std::string workdir_ = "";
90 std::unique_ptr<QMPackage> qmpackage_ = nullptr;
91
92 std::string grid_accuracy_for_ext_interaction_ = "medium";
93
96
97 // convergence options
98 double DeltaD_ = 5e-5;
99 double DeltaE_ = 5e-5;
100 double DeltaDmax_ = 5e-5;
101
102 bool do_gwbse_ = false;
103 bool do_localize_ = false;
104 bool do_dft_in_dft_ = false;
105
109
111};
112
113} // namespace xtp
114} // namespace votca
115
116#endif // VOTCA_XTP_QMREGION_H
class to manage program options with xml serialization functionality
Definition property.h:55
Logger is used for thread-safe output of messages.
Definition logger.h:164
container for molecular orbitals
Definition orbitals.h:46
void AppendResult(tools::Property &prop) const override
Definition qmregion.cc:326
StateTracker statetracker_
Definition qmregion.h:110
hist< Eigen::MatrixXd > Dmat_hist_
Definition qmregion.h:95
std::string grid_accuracy_for_ext_interaction_
Definition qmregion.h:92
std::string identify() const override
Definition qmregion.h:66
double Etotal() const override
Definition qmregion.h:73
hist< double > E_hist_
Definition qmregion.h:94
void AddNucleiFields(std::vector< PolarSegment > &segments, const StaticSegment &seg) const
Definition qmregion.cc:368
std::unique_ptr< QMPackage > qmpackage_
Definition qmregion.h:90
void push_back(const QMMolecule &mol)
Definition qmregion.cc:285
void WriteToCpt(CheckpointWriter &w) const override
Definition qmregion.cc:419
double InteractwithStaticRegion(const StaticRegion &region) override
Definition qmregion.cc:359
double InteractwithPolarRegion(const PolarRegion &region) override
Definition qmregion.cc:355
std::string workdir_
Definition qmregion.h:89
void Reset() override
Definition qmregion.cc:334
QMRegion(Index id, Logger &log, std::string workdir)
Definition qmregion.h:46
Index size() const override
Definition qmregion.h:62
void WritePDB(csg::PDBWriter &writer) const override
Definition qmregion.cc:364
void ReadFromCpt(CheckpointReader &r) override
Definition qmregion.cc:441
bool Converged() const override
Definition qmregion.cc:95
void Evaluate(std::vector< std::unique_ptr< Region > > &regions) override
Definition qmregion.cc:117
tools::Property localize_options_
Definition qmregion.h:108
double InteractwithQMRegion(const QMRegion &region) override
Definition qmregion.cc:350
void ApplyQMFieldToPolarSegments(std::vector< PolarSegment > &segments) const
Definition qmregion.cc:377
~QMRegion() override=default
void Initialize(const tools::Property &prop) override
Definition qmregion.cc:36
double charge() const override
Definition qmregion.cc:294
tools::Property dftoptions_
Definition qmregion.h:106
tools::Property gwbseoptions_
Definition qmregion.h:107
Identifier for QMstates. Strings like S1 are converted into enum +zero indexed int.
Definition qmstate.h:132
Tracks from a spectrum of states the state, which fullfills certain criteria.
const T & back() const
Definition hist.h:51
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26