forked from gfrd/egfrd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomainUtils.hpp
More file actions
116 lines (104 loc) · 3.38 KB
/
Copy pathDomainUtils.hpp
File metadata and controls
116 lines (104 loc) · 3.38 KB
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 DOMAIN_UTILS_HPP
#define DOMAIN_UTILS_HPP
#include "exceptions.hpp"
#include "Single.hpp"
#include "Pair.hpp"
#include "GreensFunction3DAbsSym.hpp"
template<typename Ttraits_>
struct DomainUtils
{
typedef Ttraits_ traits_type;
typedef typename traits_type::spherical_shell_type spherical_shell_type;
typedef typename traits_type::cylindrical_shell_type cylindrical_shell_type;
typedef typename traits_type::domain_type domain_type;
typedef Single<Ttraits_, spherical_shell_type> spherical_single_type;
typedef Single<Ttraits_, cylindrical_shell_type> cylindrical_single_type;
typedef Pair<Ttraits_, spherical_shell_type> spherical_pair_type;
typedef Pair<Ttraits_, cylindrical_shell_type> cylindrical_pair_type;
static length_type calculate_mobility_radius(spherical_single_type const& dom)
{
return dom.shell().second.shape().radius() - dom.particle().second.shape().radius();
}
static length_type calculate_mobility_radius(cylindrical_single_type const& dom)
{
return dom.shell().second.shape().size() - dom.particle().second.shape().radius();
}
static length_type calculate_mobility_radius(domain_type const& dom)
{
{
spherical_single_type const* x(
dynamic_cast<spherical_single_type const*>(&dom));
if (x)
{
return calculate_mobility_radius(*x);
}
}
{
cylindrical_single_type const* x(
dynamic_cast<cylindrical_single_type const*>(&dom));
if (x)
{
return calculate_mobility_radius(*x);
}
}
throw unsupported("unsupported domain type");
}
static length_type get_shell_size(spherical_single_type const& dom)
{
return dom.shell().second.radius();
}
static length_type get_shell_size(cylindrical_single_type const& dom)
{
return dom.shell().second.radius();
}
static length_type get_shell_size(spherical_pair_type const& dom)
{
return dom.shell().second.radius();
}
static length_type get_shell_size(cylindrical_pair_type const& dom)
{
return dom.shell().second.radius();
}
static length_type get_shell_size(domain_type const& dom)
{
{
spherical_single_type const* x(
dynamic_cast<spherical_single_type const*>(&dom));
if (x)
{
return get_shell_size(*x);
}
}
{
cylindrical_single_type const* x(
dynamic_cast<cylindrical_single_type const*>(&dom));
if (x)
{
return get_shell_size(*x);
}
}
{
spherical_pair_type const* x(
dynamic_cast<spherical_pair_type const*>(&dom));
if (x)
{
return get_shell_size(*x);
}
}
{
cylindrical_pair_type const* x(
dynamic_cast<cylindrical_pair_type const*>(&dom));
if (x)
{
return get_shell_size(*x);
}
}
throw unsupported("unsupported domain type");
}
template<typename Tdom_>
static GreensFunction3DAbsSym get_com_greens_function(Tdom_ const& dom)
{
return GreensFunction3DAbsSym(dom)
}
};
#endif /* DOMAIN_UTILS_HPP */