votca 2024.2-dev
Loading...
Searching...
No Matches
polarregion.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 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_POLARREGION_H
22#define VOTCA_XTP_POLARREGION_H
23
24// Local VOTCA includes
25#include "eeinteractor.h"
26#include "energy_terms.h"
27#include "hist.h"
28#include "mmregion.h"
29
38namespace votca {
39namespace xtp {
40class QMRegion;
41class PolarRegion;
42class StaticRegion;
43
44class PolarRegion : public MMRegion<PolarSegment> {
45 public:
46 PolarRegion(Index id, Logger& log) : MMRegion<PolarSegment>(id, log) {}
47
48 std::string identify() const override { return "polarregion"; }
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 Reset() override;
57
58 double Etotal() const override { return E_hist_.back().Etotal(); }
59
60 void WriteToCpt(CheckpointWriter& w) const override;
61
62 void ReadFromCpt(CheckpointReader& r) override;
63
64 protected:
65 void AppendResult(tools::Property& prop) const override;
66 double InteractwithQMRegion(const QMRegion& region) override;
67 double InteractwithPolarRegion(const PolarRegion& region) override;
68 double InteractwithStaticRegion(const StaticRegion& region) override;
69
70 private:
72 double StaticInteraction();
74
75 double PolarEnergy_extern() const;
77 Index CalcPolDoF() const;
78
79 Eigen::VectorXd CalcInducedDipoleInsideSegments() const;
80 Eigen::VectorXd ReadInducedDipolesFromLastIteration() const;
81
82 Eigen::VectorXd CalcInducedDipolesViaPCG(
83 const Eigen::VectorXd& initial_guess);
84 void WriteInducedDipolesToSegments(const Eigen::VectorXd& x);
85
87 double deltaE_ = 1e-5;
88 double deltaD_ = 1e-5;
90 double exp_damp_ = 0.39;
91};
92
93} // namespace xtp
94} // namespace votca
95
96#endif // VOTCA_XTP_POLARREGION_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
Eigen::VectorXd CalcInducedDipoleInsideSegments() const
PolarRegion(Index id, Logger &log)
Definition polarregion.h:46
void AppendResult(tools::Property &prop) const override
void WriteInducedDipolesToSegments(const Eigen::VectorXd &x)
void ReadFromCpt(CheckpointReader &r) override
double InteractwithQMRegion(const QMRegion &region) override
void Initialize(const tools::Property &prop) override
bool Converged() const override
eeInteractor::E_terms PolarEnergy() const
Eigen::VectorXd CalcInducedDipolesViaPCG(const Eigen::VectorXd &initial_guess)
Eigen::VectorXd ReadInducedDipolesFromLastIteration() const
std::string identify() const override
Definition polarregion.h:48
hist< Energy_terms > E_hist_
Definition polarregion.h:86
void WriteToCpt(CheckpointWriter &w) const override
double InteractwithPolarRegion(const PolarRegion &region) override
void Evaluate(std::vector< std::unique_ptr< Region > > &regions) override
void Reset() override
double Etotal() const override
Definition polarregion.h:58
double InteractwithStaticRegion(const StaticRegion &region) override
double PolarEnergy_extern() const
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26