-
Notifications
You must be signed in to change notification settings - Fork 0
/
GreensFunction2DRefWedgeAbs.hpp
116 lines (91 loc) · 3.3 KB
/
GreensFunction2DRefWedgeAbs.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
#ifndef GREENS_FUNCTION_2D_REF_WEDGE_ABS_HPP
#define GREENS_FUNCTION_2D_REF_WEDGE_ABS_HPP
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include "Defs.hpp"
namespace greens_functions
{
class GreensFunction2DRefWedgeAbs
{
public:
GreensFunction2DRefWedgeAbs(const Real D, const Real r0, const Real a,
const Real phi);
virtual ~GreensFunction2DRefWedgeAbs();
const Real drawTime (const Real rnd) const;
const Real drawR (const Real rnd, const Real t) const;
const Real drawTheta(const Real rnd, const Real r, const Real t) const;
const Real p_survival (const Real t) const;
const Real p_int_r (const Real r, const Real t) const;
const Real p_int_phi (const Real r, const Real t) const;
const Real dp_int_phi (const Real t) const;
const Real p_int_theta (const Real r, const Real theta, const Real t) const;
const Real dp_int_theta(const Real theta, const Real t) const;
const Real getD() const {return this->D_; }
const Real geta() const {return this->a_; }
const Real getr0() const {return this->r0_; }
const Real getphi() const {return this->phi_;}
const std::string dump() const;
const char* getName() const
{
return "GreensFunction2DRefWedgeAbs";
}
private:
const Real p_int_theta_first(const Real r,
const Real theta,
const Real t) const;
const Real p_int_theta_second(const Real r,
const Real theta,
const Real t) const;
const Real dp_int_theta_first(const Real theta,
const Real t) const;
const Real dp_int_theta_second(const Real theta,
const Real t) const;
private:
struct p_survival_params
{
const GreensFunction2DRefWedgeAbs* const gf;
const Real rnd;
};
struct p_r_params
{
const GreensFunction2DRefWedgeAbs* const gf;
const Real t;
const Real target;
/* when time = t, probability of existence is p_surv(t). *
* to seek the r, the random value that satisfy the equation *
* must be in [0, p_surv). the value, rnd * p_surv(t) is target. */
};
struct p_theta_params
{
const GreensFunction2DRefWedgeAbs* const gf;
const Real t;
const Real r;
const Real rnd;
};
struct dp_theta_params
{
const GreensFunction2DRefWedgeAbs* const gf;
const Real t;
const Real rnd;
};
static const Real p_survival_F(const Real t,
const p_survival_params* params);
static const Real p_r_F(const Real r,
const p_r_params* params);
static const Real p_theta_F(const Real theta,
const p_theta_params* params);
static const Real dp_theta_F(const Real theta,
const dp_theta_params* params);
private:
static const Real CUTOFF;//1e-10, provisionally.
static const Real maximum_alpha2_Dt;
Real D_;
Real a_;
Real r0_;
Real phi_;// the angle of apical. initial theta = \phi / 2
};
}
#endif//GREENS_FUNCTION_2D_REF_WEDGE_ABS