votca
2024.2-dev
Loading...
Searching...
No Matches
xtp
include
votca
xtp
energy_terms.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_ENERGY_TERMS_H
22
#define VOTCA_XTP_ENERGY_TERMS_H
23
24
// Local VOTCA includes
25
#include "
eeinteractor.h
"
26
#include "
eigen.h
"
27
34
namespace
votca
{
35
namespace
xtp {
36
37
class
Energy_terms
{
38
public
:
39
Energy_terms
&
operator+=
(
const
Energy_terms
& right) {
40
this->
data_
+= right.
data_
;
41
return
*
this
;
42
}
43
44
Energy_terms
operator+
(
Energy_terms
right)
const
{
45
right.
data_
+= this->
data_
;
46
return
right;
47
}
48
49
Energy_terms
operator-
(
Energy_terms
right)
const
{
50
right.
data_
*= (-1);
51
right.
data_
+= this->
data_
;
52
return
right;
53
}
54
55
void
addInternalPolarContrib
(
const
eeInteractor::E_terms
& induction_terms) {
56
data_
.segment<3>(0) += induction_terms.
data
();
57
}
58
59
double
Etotal
()
const
{
return
data_
.sum(); }
// total energy
60
double
Epolar
()
const
{
61
return
data_
.segment<4>(0).sum();
62
}
// all polar inside region and from outside contributions
63
// dQ-dQ,Q-dQ,E_internal
64
double
Estatic
()
const
{
65
return
data_
.segment<2>(4).sum();
66
}
// all static contributions Q-Q inside region and from outside
67
double
Eextern
()
const
{
68
return
data_
.segment<2>(3).sum();
69
}
// all external contributions
70
double
Eintern
()
const
{
71
return
Etotal
() -
Eextern
();
72
}
// all internal contributions
73
74
double
&
E_indu_indu
() {
return
data_
[0]; }
// dQ-dQ inside region
75
double
&
E_indu_stat
() {
return
data_
[1]; }
// dQ-Q inside region
76
double
&
E_internal
() {
return
data_
[2]; }
// e_internal
77
double
&
E_polar_ext
() {
78
return
data_
[3];
79
}
// dQ-Q and dQ-dQ from outside regions
80
double
&
E_static_ext
() {
return
data_
[4]; }
// Q-Q from outside regions
81
double
&
E_static_static
() {
return
data_
[5]; }
// Q-Q inside region
82
83
const
Eigen::Matrix<double, 6, 1>&
data
()
const
{
return
data_
; }
84
Eigen::Matrix<double, 6, 1>&
data
() {
return
data_
; }
85
86
private
:
87
Eigen::Matrix<double, 6, 1>
data_
= Eigen::Matrix<double, 6, 1>::Zero();
88
};
89
90
}
// namespace xtp
91
}
// namespace votca
92
93
#endif
// VOTCA_XTP_ENERGY_TERMS_H
votca::xtp::Energy_terms
Definition
energy_terms.h:37
votca::xtp::Energy_terms::E_internal
double & E_internal()
Definition
energy_terms.h:76
votca::xtp::Energy_terms::Etotal
double Etotal() const
Definition
energy_terms.h:59
votca::xtp::Energy_terms::Eintern
double Eintern() const
Definition
energy_terms.h:70
votca::xtp::Energy_terms::Estatic
double Estatic() const
Definition
energy_terms.h:64
votca::xtp::Energy_terms::data_
Eigen::Matrix< double, 6, 1 > data_
Definition
energy_terms.h:87
votca::xtp::Energy_terms::E_polar_ext
double & E_polar_ext()
Definition
energy_terms.h:77
votca::xtp::Energy_terms::operator+=
Energy_terms & operator+=(const Energy_terms &right)
Definition
energy_terms.h:39
votca::xtp::Energy_terms::E_static_ext
double & E_static_ext()
Definition
energy_terms.h:80
votca::xtp::Energy_terms::addInternalPolarContrib
void addInternalPolarContrib(const eeInteractor::E_terms &induction_terms)
Definition
energy_terms.h:55
votca::xtp::Energy_terms::E_indu_indu
double & E_indu_indu()
Definition
energy_terms.h:74
votca::xtp::Energy_terms::E_indu_stat
double & E_indu_stat()
Definition
energy_terms.h:75
votca::xtp::Energy_terms::data
const Eigen::Matrix< double, 6, 1 > & data() const
Definition
energy_terms.h:83
votca::xtp::Energy_terms::operator-
Energy_terms operator-(Energy_terms right) const
Definition
energy_terms.h:49
votca::xtp::Energy_terms::E_static_static
double & E_static_static()
Definition
energy_terms.h:81
votca::xtp::Energy_terms::operator+
Energy_terms operator+(Energy_terms right) const
Definition
energy_terms.h:44
votca::xtp::Energy_terms::Epolar
double Epolar() const
Definition
energy_terms.h:60
votca::xtp::Energy_terms::Eextern
double Eextern() const
Definition
energy_terms.h:67
votca::xtp::Energy_terms::data
Eigen::Matrix< double, 6, 1 > & data()
Definition
energy_terms.h:84
votca::xtp::eeInteractor::E_terms
Definition
eeinteractor.h:59
votca::xtp::eeInteractor::E_terms::data
const Eigen::Vector3d & data() const
Definition
eeinteractor.h:77
eeinteractor.h
votca
base class for all analysis tools
Definition
basebead.h:33
eigen.h
Generated by
1.12.0