votca 2024.1-dev
Loading...
Searching...
No Matches
gnode.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18#pragma once
19#ifndef VOTCA_XTP_GNODE_H
20#define VOTCA_XTP_GNODE_H
21
22// Local VOTCA includes
23#include "glink.h"
24#include "huffmantree.h"
25#include "qmpair.h"
26#include "segment.h"
27
28namespace votca {
29namespace xtp {
30
31class GNode {
32 public:
33 GNode(const Segment& seg, QMStateType carriertype, bool injectable)
34 : id_(seg.getId()),
35 siteenergy_(seg.getSiteEnergy(carriertype)),
36 position_(seg.getPos()),
37 injectable_(injectable) {};
38
39 bool isOccupied() const { return occupied_; }
40 void setOccupation(bool occupied) { occupied_ = occupied; }
41 bool isInjectable() const { return injectable_; }
42 bool canDecay() const { return hasdecay_; }
43 const Eigen::Vector3d& getPos() const { return position_; }
44 Index getId() const { return id_; }
45 void UpdateOccupationTime(double deltat) { occupationtime_ += deltat; }
46
47 const std::vector<GLink>& Events() const { return events_; }
48 double OccupationTime() const { return occupationtime_; }
49
50 double getEscapeRate() const { return escape_rate_; }
51 void InitEscapeRate();
52 void AddDecayEvent(double decayrate);
53 void AddEventfromQmPair(const QMPair& pair, std::vector<GNode>& nodes,
54 double rate);
55 double getSitenergy() const { return siteenergy_; }
56
57 GLink* findHoppingDestination(double p) const;
58 void MakeHuffTree();
59 void AddEvent(GNode* seg2, const Eigen::Vector3d& dr, double rate);
60
61 private:
63 bool occupied_ = false;
64 double occupationtime_ = 0.0;
65 double escape_rate_ = 0.0;
66 bool hasdecay_ = false;
68 Eigen::Vector3d position_;
69 bool injectable_ = true;
70 std::vector<GLink> events_;
71
73
74 void organizeProbabilities(Index id, double add);
76};
77
78} // namespace xtp
79} // namespace votca
80
81#endif // VOTCA_XTP_GNODE_H
void UpdateOccupationTime(double deltat)
Definition gnode.h:45
double occupationtime_
Definition gnode.h:64
void AddEventfromQmPair(const QMPair &pair, std::vector< GNode > &nodes, double rate)
Definition gnode.cc:53
void InitEscapeRate()
Definition gnode.cc:37
const std::vector< GLink > & Events() const
Definition gnode.h:47
void organizeProbabilities(Index id, double add)
Eigen::Vector3d position_
Definition gnode.h:68
GNode(const Segment &seg, QMStateType carriertype, bool injectable)
Definition gnode.h:33
void AddEvent(GNode *seg2, const Eigen::Vector3d &dr, double rate)
Definition gnode.cc:33
void setOccupation(bool occupied)
Definition gnode.h:40
bool canDecay() const
Definition gnode.h:42
double siteenergy_
Definition gnode.h:67
double escape_rate_
Definition gnode.h:65
const Eigen::Vector3d & getPos() const
Definition gnode.h:43
bool injectable_
Definition gnode.h:69
bool isInjectable() const
Definition gnode.h:41
Index getId() const
Definition gnode.h:44
huffmanTree< GLink > hTree
Definition gnode.h:72
void moveProbabilities(Index id)
void AddDecayEvent(double decayrate)
Definition gnode.cc:28
double OccupationTime() const
Definition gnode.h:48
void MakeHuffTree()
Definition gnode.cc:48
double getEscapeRate() const
Definition gnode.h:50
GLink * findHoppingDestination(double p) const
Definition gnode.cc:44
bool isOccupied() const
Definition gnode.h:39
std::vector< GLink > events_
Definition gnode.h:70
double getSitenergy() const
Definition gnode.h:55
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26