votca 2024.2-dev
Loading...
Searching...
No Matches
chargecarrier.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 * author: Kordt
17 */
18
19#pragma once
20#ifndef VOTCA_XTP_CHARGECARRIER_H
21#define VOTCA_XTP_CHARGECARRIER_H
22
23// Local VOTCA includes
24#include "glink.h"
25#include "gnode.h"
26
27namespace votca {
28namespace xtp {
29
31 public:
33 : id_(id),
34 lifetime(0.0),
35 steps(0),
36 dr_travelled_(Eigen::Vector3d::Zero()),
37 node(nullptr) {};
38 bool hasNode() { return (node != nullptr); }
39 void updateLifetime(double dt) { lifetime += dt; }
41 void updateSteps(Index t) { steps += t; }
42 void resetCarrier() {
43 lifetime = 0;
44 steps = 0;
45 dr_travelled_ = Eigen::Vector3d::Zero();
46 }
47 double getLifetime() const { return lifetime; }
48 Index getSteps() const { return steps; }
49 Index getCurrentNodeId() const { return node->getId(); }
50 double getCurrentEnergy() const { return node->getSitenergy(); }
51 const Eigen::Vector3d& getCurrentPosition() const { return node->getPos(); }
52 double getCurrentEscapeRate() const { return node->getEscapeRate(); }
53 GNode& getCurrentNode() const { return *node; }
54
55 void ReleaseNode() { node->setOccupation(false); }
56
57 void settoNote(GNode* newnode) {
58 node = newnode;
59 node->setOccupation(true);
60 }
61
62 void jumpAccordingEvent(const GLink& event) {
65 dr_travelled_ += event.getDeltaR();
66 }
67
68 const Eigen::Vector3d& get_dRtravelled() const { return dr_travelled_; }
69
70 Index getId() const { return id_; }
71 void setId(Index id) { id_ = id; }
72
73 private:
75 double lifetime;
77 Eigen::Vector3d dr_travelled_;
79};
80
81} // namespace xtp
82} // namespace votca
83
84#endif // VOTCA_XTP_CHARGECARRIER_H
const Eigen::Vector3d & getCurrentPosition() const
Index getCurrentNodeId() const
void updateOccupationtime(double dt)
GNode & getCurrentNode() const
void settoNote(GNode *newnode)
Eigen::Vector3d dr_travelled_
double getCurrentEnergy() const
void updateLifetime(double dt)
void jumpAccordingEvent(const GLink &event)
const Eigen::Vector3d & get_dRtravelled() const
double getCurrentEscapeRate() const
void UpdateOccupationTime(double deltat)
Definition gnode.h:45
void setOccupation(bool occupied)
Definition gnode.h:40
const Eigen::Vector3d & getPos() const
Definition gnode.h:43
Index getId() const
Definition gnode.h:44
double getEscapeRate() const
Definition gnode.h:50
double getSitenergy() const
Definition gnode.h:55
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26