forked from ecell/epdp
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathGreensFunction3DRadInf.hpp
122 lines (76 loc) · 2.86 KB
/
GreensFunction3DRadInf.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#if !defined(__PLAINPAIRGREENSFUNCTION)
#define __PLAINPAIRGREENSFUNCTION
#include <cmath>
#include <vector>
#include <gsl/gsl_integration.h>
#include "Logger.hpp"
#include "PairGreensFunction.hpp"
class GreensFunction3DRadInf: public PairGreensFunction
{
public:
typedef std::vector<Real> RealVector;
private:
struct p_corr_R_params;
struct p_theta_params;
private:
// Error tolerance used by default.
static const Real TOLERANCE = 1e-8;
// SphericalBesselGenerator's accuracy, used by some
// theta-related calculations.
static const Real THETA_TOLERANCE = 1e-5;
static const Real MIN_T = 1e-12;
static const unsigned int MAX_ORDER = 70;
static const Real H = 4.0;
public:
GreensFunction3DRadInf(Real D, Real kf, Real r0, Real Sigma);
virtual ~GreensFunction3DRadInf();
virtual Real drawTime(Real rnd) const;
virtual Real drawR(Real rnd, Real t) const;
virtual Real drawTheta(Real rnd, Real r, Real t) const;
Real getkD() const
{
return this->kD;
}
Real getalpha() const
{
return this->alpha;
}
Real p_reaction(Real t) const;
Real p_survival(Real t) const;
Real p_int_r(Real r, Real t) const;
Real p_theta(Real theta, Real r, Real time) const;
Real ip_theta(Real theta, Real r, Real time) const;
Real p_free(Real theta, Real r, Real t) const;
Real ip_free(Real theta, Real r, Real t) const;
Real p_corr(Real theta, Real r, Real t) const;
Real ip_corr(Real theta, Real r, Real t) const;
std::string dump() const;
const char* getName() const
{
return "GreensFunction3DRadInf";
}
private:
Real p_corr_R(Real alpha, unsigned int n, Real r, Real t) const;
Real p_corr_n(unsigned int n, RealVector const& RnTable, RealVector const& lgndTable) const;
Real ip_corr_n(unsigned int n, RealVector const& RnTable, RealVector const& lgndTable) const;
Real p_corr_table(Real theta, Real r, Real t, RealVector const& RnTable) const;
Real
ip_corr_table(Real theta, Real r, Real t, RealVector const& RnTable) const;
Real p_theta_table(Real r, Real theta, Real time,
RealVector const& RnTable) const;
Real ip_theta_table(Real r, Real theta, Real time,
RealVector const& RnTable) const;
Real
p_corr_table(Real theta, Real r, Real t, RealVector const& RnTable);
void makeRnTable(RealVector& RnTable, Real r, Real t) const;
Real Rn(unsigned int order, Real r, Real t,
gsl_integration_workspace* workspace, Real tol) const;
private:
static Real p_corr_R_F(Real, p_corr_R_params*);
static Real ip_theta_F(Real theta, p_theta_params* params);
private:
const Real kD;
const Real alpha;
static Logger& log_;
};
#endif // __PLAINPAIRGREENSFUNCTION