votca 2024.1-dev
Loading...
Searching...
No Matches
segment.cc
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// Local VOTCA includes
21#include "votca/xtp/segment.h"
23
24namespace votca {
25namespace xtp {
26
27double Segment::getApproxSize() const {
28 std::pair<Eigen::Vector3d, Eigen::Vector3d> minmax = CalcSpatialMinMax();
29 return (minmax.first - minmax.second).norm();
30}
31
32const Atom* Segment::getAtom(Index id) const {
33
34 for (const Atom& atom : *this) {
35 if (atom.getId() == id) {
36 return &atom;
37 }
38 }
39 return nullptr;
40}
41
44 w(molecule_ids_, "mol_ids");
45
47 w(U_xX_nN_.getValue(QMStateType::Hole), "U_xX_nN_h");
48 w(U_xX_nN_.getValue(QMStateType::Singlet), "U_xX_nN_s");
49 w(U_xX_nN_.getValue(QMStateType::Triplet), "U_xX_nN_t");
51 w(U_nX_nN_.getValue(QMStateType::Hole), "U_nX_nN_h");
52 w(U_nX_nN_.getValue(QMStateType::Singlet), "U_nX_nN_s");
53 w(U_nX_nN_.getValue(QMStateType::Triplet), "U_nX_nN_t");
55 w(U_xN_xX_.getValue(QMStateType::Hole), "U_xN_xX_h");
56 w(U_xN_xX_.getValue(QMStateType::Singlet), "U_xN_xX_s");
57 w(U_xN_xX_.getValue(QMStateType::Triplet), "U_xN_xX_t");
59 w(site_eng_.getValue(QMStateType::Hole), "site_eng_h");
60 w(site_eng_.getValue(QMStateType::Singlet), "site_eng_s");
61 w(site_eng_.getValue(QMStateType::Triplet), "site_eng_t");
62}
63
66 r(molecule_ids_, "mol_ids");
67 double value;
68 r(value, "U_xX_nN_e");
70 r(value, "U_xX_nN_h");
72 r(value, "U_xX_nN_s");
74 r(value, "U_xX_nN_t");
76 r(value, "U_nX_nN_e");
78 r(value, "U_nX_nN_h");
80 r(value, "U_nX_nN_s");
82 r(value, "U_nX_nN_t");
84 r(value, "U_xN_xX_e");
86 r(value, "U_xN_xX_h");
88 r(value, "U_xN_xX_s");
90 r(value, "U_xN_xX_t");
92 r(value, "site_eng_e");
94 r(value, "site_eng_h");
96 r(value, "site_eng_s");
98 r(value, "site_eng_t");
100}
101
102} // namespace xtp
103} // namespace votca
virtual void WriteToCpt(CheckpointWriter &w) const
virtual void ReadFromCpt(CheckpointReader &r)
std::pair< Eigen::Vector3d, Eigen::Vector3d > CalcSpatialMinMax() const
T getValue(QMStateType t) const
Definition qmstate.h:115
void setValue(T value, QMStateType t)
Definition qmstate.h:109
QMStateCarrierStorage< double > U_nX_nN_
Definition segment.h:114
std::vector< Index > molecule_ids_
Definition segment.h:111
double getApproxSize() const
Definition segment.cc:27
QMStateCarrierStorage< double > U_xX_nN_
Definition segment.h:113
QMStateCarrierStorage< double > U_xN_xX_
Definition segment.h:115
void ReadFromCpt(CheckpointReader &r) override
Definition segment.cc:64
QMStateCarrierStorage< double > site_eng_
Definition segment.h:116
void WriteToCpt(CheckpointWriter &w) const override
Definition segment.cc:42
const Atom * getAtom(Index id) const
Definition segment.cc:32
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26