-
Notifications
You must be signed in to change notification settings - Fork 1
/
parameters.py
166 lines (120 loc) · 3.83 KB
/
parameters.py
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
""" This is the parameter description file. Basically it provides a namespace
where we store a function per input parameter. Each function receives a string
and is responsible for converting to the appropriate type, checking for
allowed values. The docstring of the function is a description of the
parameter. """
from readinput import positive, nonnegative, default
def run_name(s):
""" Name of the run. """
return s
def out_file(s):
""" File name (including path) of the .h5 output file. """
return s
def desc(s):
""" A comment to describe this simulation. It is ignored by the code. """
return s
@default(-1)
def random_seed(s):
""" Seed for the random generator. If < 0 the system time is used (default)."""
return int(s)
def dummy(s):
""" This parameter is completely ignored. It is used only to produce
series of identical runs. """
@positive
def max_charges_per_box(s):
""" Maximum number of charges per box in the FMM refinement scheme. """
return int(s)
@positive
def fmm_threshold(s):
""" Threshold in the number of charges between using the direct solver \
and FMM solver. """
return int(s)
@positive
def multipolar_terms(s):
""" Order of the multipole expansion in the FMM. """
return int(s)
def external_field(s):
""" Externally applied electric field in the z direction. """
return float(s)
@positive
def conductance(s):
""" Conductance of the channels. """
return float(s)
@positive
def maxwell_factor(s):
""" Maxwell factor for the potential and electric fields. In SI units
it is 1 / 4 pi epsilon_0"""
return float(s)
@positive
def tip_mobility(s):
""" Ratio between the tip velocity of each streamer and the local field. """
return float(s)
@default(0)
@nonnegative
def tip_min_field(s):
""" Minimum field at the tip for a streamer to propagate. """
return float(s)
@default(0)
@nonnegative
def initial_nodes(s):
""" Starts the simulation with a vertical string with this number of
charged nodes separated a distance CONDUCTOR_THICKNESS. """
return int(s)
@positive
def end_time(s):
""" Final time of the simulation. """
return float(s)
@positive
def time_step(s):
""" Timestep of the simulation. """
return float(s)
@positive
def conductor_thickness(s):
""" Thickness of the conductors for the thin-wire approximation. """
return float(s)
@nonnegative
def branching_probability(s):
""" Probability that a filament branches per unit distance travelled. """
return float(s)
@positive
def branching_sigma(s):
""" Standard deviation of the branching dispacement in the symmetric gaussian branching model. """
return float(s)
@default(0)
@nonnegative
def single_branching_time(s):
""" If nonzero, performs a single branching at the given time. """
return float(s)
@default(0)
def single_branching_z(s):
""" If nonzero, performs a single branching at the given z. """
return float(s)
@default(0)
def fixed_branching_angle(s):
""" If nonzero, fixes the angle between sibling branches. """
return float(s)
@default(False)
def branch_in_xz(s):
""" If true, branches always within the XZ plane. """
return (s.lower() == 'true')
@default('null')
def electrode_geometry(s):
""" The electrode geometry. """
return s.lower()
@positive
def electrode_radius(s):
""" Radius of an spherical electrode. """
return float(s)
@default(0)
def electrode_potential(s):
""" Electrostatic potential of a (spherical) electrode. """
return float(s)
@default(1e10)
def max_step(s):
""" Longest step for a channel in dt. The timestep will be reduced
to satisfy this constraint"""
return float(s)
@default(True)
def end_with_reconnection(s):
""" If true, finishes when a reconnection is detected """
return (s.lower() == 'true')