votca 2026-dev
Loading...
Searching...
No Matches
kmcrates.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2026 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_KMCRATES_H
22#define VOTCA_XTP_KMCRATES_H
23
24// Standard includes
25#include <vector>
26
27// Local VOTCA includes
28#include "eigen.h"
29#include "tofgraph.h"
30
31namespace votca {
32namespace xtp {
33
53 public:
54 virtual ~TimeDependentRates() = default;
55
57 virtual double Rate(Index edge, double t) const = 0;
58
61 virtual double EscapeRate(Index site, double t) const;
62
64 virtual double UpperBound(Index edge) const = 0;
65
67 virtual double Period() const { return 0.0; }
68
70 virtual bool isStatic() const { return false; }
71
72 const ToFGraph& Graph() const { return graph_; }
73
74 protected:
75 explicit TimeDependentRates(const ToFGraph& graph) : graph_(graph) {}
77};
78
80class StaticRates final : public TimeDependentRates {
81 public:
82 explicit StaticRates(const ToFGraph& graph) : TimeDependentRates(graph) {}
83 double Rate(Index edge, double) const override {
84 return graph_.getEdge(edge).rate;
85 }
86 double EscapeRate(Index site, double) const override {
87 return graph_.EscapeRate(site);
88 }
89 double UpperBound(Index edge) const override {
90 return graph_.getEdge(edge).rate;
91 }
92 bool isStatic() const override { return true; }
93};
94
95} // namespace xtp
96} // namespace votca
97
98#endif // VOTCA_XTP_KMCRATES_H
StaticRates(const ToFGraph &graph)
Definition kmcrates.h:82
bool isStatic() const override
true if no rate depends on time
Definition kmcrates.h:92
double EscapeRate(Index site, double) const override
Definition kmcrates.h:86
double UpperBound(Index edge) const override
an upper bound of Rate(edge, t) for all t (needed by thinning)
Definition kmcrates.h:89
double Rate(Index edge, double) const override
rate of edge e at time t
Definition kmcrates.h:83
virtual double EscapeRate(Index site, double t) const
const ToFGraph & graph_
Definition kmcrates.h:76
const ToFGraph & Graph() const
Definition kmcrates.h:72
virtual double UpperBound(Index edge) const =0
an upper bound of Rate(edge, t) for all t (needed by thinning)
virtual bool isStatic() const
true if no rate depends on time
Definition kmcrates.h:70
virtual ~TimeDependentRates()=default
virtual double Period() const
common period T of all rates if they are periodic, 0 otherwise
Definition kmcrates.h:67
virtual double Rate(Index edge, double t) const =0
rate of edge e at time t
TimeDependentRates(const ToFGraph &graph)
Definition kmcrates.h:75
Hopping graph for time-of-flight (ToF) transport.
Definition tofgraph.h:77
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26