Skip to content

Commit 92e894a

Browse files
committed
minor tweaks to high order
1 parent a172865 commit 92e894a

4 files changed

Lines changed: 263 additions & 30 deletions

File tree

docs/content/3-code/6-higherorder.md

Lines changed: 201 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,36 +34,216 @@ The stencils are optimized for a given `CFL`, so it is important to use the one
3434

3535
Note that the `CFL` is given in the standard convention! In order to use it with entity you need to multiply it by $\sqrt{N_\mathrm{dim}}$.
3636

37-
| Solver | `CFL` | `delta_x` | `delta_y` | `delta_z` | `beta_xy` | `beta_yx` | `beta_xz` | `beta_zx` | `beta_yz` | `beta_zy` |
38-
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
39-
| **2D** | | | | | | | | | | |
40-
| Yee | $1/\sqrt{2}$ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
41-
| Cowan | 0.999 | 0 | 0 | 0 | 0.125 | 0.125 | 0 | 0 | 0 | 0 |
42-
| Lehe | 0.96 | -0.021 | 0 | 0 | 0.125 | 0.125 | 0 | 0 | 0 | 0 |
43-
| min1 | $0.97/\sqrt{2}$ | -0.125 | -0.125 | 0 | 0.11 | 0.11 | 0 | 0 | 0 | 0 |
44-
| min2 | $0.95/\sqrt{2}$ | -0.013 | -0.013 | 0 | -0.013 | -0.013 | 0 | 0 | 0 | 0 |
45-
| min3 | 0.5 | -0.065 | -0.065 | 0 | -0.065 | -0.065 | 0 | 0 | 0 | 0 |
46-
| min4 | 0.1 | -0.125 | -0.125 | 0 | -0.125 | -0.125 | 0 | 0 | 0 | 0 |
47-
| min5 | 0.96 | -0.017 | -0.017 | 0 | 0.133 | 0.133 | 0 | 0 | 0 | 0 |
48-
| min6 | 0.999 | -0.0005 | 0 | 0 | 0.128 | 0.128 | 0 | 0 | 0 | 0 |
49-
| **3D** | | | | | | | | | | |
50-
| Yee | $1/\sqrt{3}$ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
51-
| min3 | 0.5 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 |
52-
| min4 | 0.1 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 |
37+
<table id="blinne">
38+
<tr>
39+
<th>
40+
Dimension:
41+
</th>
42+
<th class="solvers-2d" colspan="9" style="text-align:center">
43+
2D
44+
</th>
45+
<th class="solvers-3d" colspan="3" style="text-align:center">
46+
3D
47+
</th>
48+
</tr>
49+
<tr>
50+
<th> Solver: </th>
51+
<th> Yee </th>
52+
<th> Cowan </th>
53+
<th> Lehe </th>
54+
<th> min1 </th>
55+
<th> min2 </th>
56+
<th> min3 </th>
57+
<th> min4 </th>
58+
<th> min5 </th>
59+
<th> min6 </th>
60+
<th> Yee </th>
61+
<th> min3 </th>
62+
<th> min4 </th>
63+
</tr>
64+
<tr>
65+
<th> <code>CFL</code> </th>
66+
<td> $1/\sqrt{2}$ </td>
67+
<td> $0.999$ </td>
68+
<td> $0.96$ </td>
69+
<td> $0.97/\sqrt{2}$ </td>
70+
<td> $0.95/\sqrt{2}$ </td>
71+
<td> $0.5$ </td>
72+
<td> $0.1$ </td>
73+
<td> $0.96$ </td>
74+
<td> $0.999$ </td>
75+
<td> $1/\sqrt{3}$ </td>
76+
<td> $0.5$ </td>
77+
<td> $0.1$ </td>
78+
</tr>
79+
<tr>
80+
<th> <code>delta_x</code> </th>
81+
<td> $0$ </td>
82+
<td> $0$ </td>
83+
<td> $-0.021$ </td>
84+
<td> $-0.125$ </td>
85+
<td> $-0.013$ </td>
86+
<td> $-0.065$ </td>
87+
<td> $-0.125$ </td>
88+
<td> $-0.017$ </td>
89+
<td> $-0.005$ </td>
90+
<td> $0$ </td>
91+
<td> $-0.00867$ </td>
92+
<td> $-0.048434$ </td>
93+
</tr>
94+
<tr>
95+
<th> <code>delta_y</code> </th>
96+
<td> $0$ </td>
97+
<td> $0$ </td>
98+
<td> $0$ </td>
99+
<td> $-0.125$ </td>
100+
<td> $-0.013$ </td>
101+
<td> $-0.065$ </td>
102+
<td> $-0.125$ </td>
103+
<td> $-0.017$ </td>
104+
<td> $0$ </td>
105+
<td> $0$ </td>
106+
<td> $-0.00867$ </td>
107+
<td> $-0.048434$ </td>
108+
</tr>
109+
<tr>
110+
<th> <code>delta_z</code> </th>
111+
<td> $0$ </td>
112+
<td> $0$ </td>
113+
<td> $0$ </td>
114+
<td> $0$ </td>
115+
<td> $0$ </td>
116+
<td> $0$ </td>
117+
<td> $0$ </td>
118+
<td> $0$ </td>
119+
<td> $0$ </td>
120+
<td> $0$ </td>
121+
<td> $-0.00867$ </td>
122+
<td> $-0.048434$ </td>
123+
</tr>
124+
<tr>
125+
<th> <code>beta_xy</code> </th>
126+
<td> $0$ </td>
127+
<td> $0.125$ </td>
128+
<td> $0.125$ </td>
129+
<td> $0.11$ </td>
130+
<td> $-0.013$ </td>
131+
<td> $-0.065$ </td>
132+
<td> $-0.125$ </td>
133+
<td> $0.133$ </td>
134+
<td> $0.128$ </td>
135+
<td> $0$ </td>
136+
<td> $-0.00867$ </td>
137+
<td> $-0.048434$ </td>
138+
</tr>
139+
<tr>
140+
<th> <code>beta_yx</code> </th>
141+
<td> $0$ </td>
142+
<td> $0.125$ </td>
143+
<td> $0.125$ </td>
144+
<td> $0.11$ </td>
145+
<td> $-0.013$ </td>
146+
<td> $-0.065$ </td>
147+
<td> $-0.125$ </td>
148+
<td> $0.133$ </td>
149+
<td> $0.128$ </td>
150+
<td> $0$ </td>
151+
<td> $-0.00867$ </td>
152+
<td> $-0.048434$ </td>
153+
</tr>
154+
<tr>
155+
<th> <code>beta_xz</code> </th>
156+
<td> $0$ </td>
157+
<td> $0$ </td>
158+
<td> $0$ </td>
159+
<td> $0$ </td>
160+
<td> $0$ </td>
161+
<td> $0$ </td>
162+
<td> $0$ </td>
163+
<td> $0$ </td>
164+
<td> $0$ </td>
165+
<td> $0$ </td>
166+
<td> $-0.00867$ </td>
167+
<td> $-0.048434$ </td>
168+
</tr>
169+
<tr>
170+
<th> <code>beta_zx</code> </th>
171+
<td> $0$ </td>
172+
<td> $0$ </td>
173+
<td> $0$ </td>
174+
<td> $0$ </td>
175+
<td> $0$ </td>
176+
<td> $0$ </td>
177+
<td> $0$ </td>
178+
<td> $0$ </td>
179+
<td> $0$ </td>
180+
<td> $0$ </td>
181+
<td> $-0.00867$ </td>
182+
<td> $-0.048434$ </td>
183+
</tr>
184+
<tr>
185+
<th> <code>beta_yz</code> </th>
186+
<td> $0$ </td>
187+
<td> $0$ </td>
188+
<td> $0$ </td>
189+
<td> $0$ </td>
190+
<td> $0$ </td>
191+
<td> $0$ </td>
192+
<td> $0$ </td>
193+
<td> $0$ </td>
194+
<td> $0$ </td>
195+
<td> $0$ </td>
196+
<td> $-0.00867$ </td>
197+
<td> $-0.048434$ </td>
198+
</tr>
199+
<tr>
200+
<th> <code>beta_zy</code> </th>
201+
<td> $0$ </td>
202+
<td> $0$ </td>
203+
<td> $0$ </td>
204+
<td> $0$ </td>
205+
<td> $0$ </td>
206+
<td> $0$ </td>
207+
<td> $0$ </td>
208+
<td> $0$ </td>
209+
<td> $0$ </td>
210+
<td> $0$ </td>
211+
<td> $-0.00867$ </td>
212+
<td> $-0.048434$ </td>
213+
</tr>
214+
</table>
215+
216+
<!-- | Solver | `CFL` | `delta_x` | `delta_y` | `delta_z` | `beta_xy` | `beta_yx` | `beta_xz` | `beta_zx` | `beta_yz` | `beta_zy` | -->
217+
<!-- | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -->
218+
<!-- | **2D** | | | | | | | | | | | -->
219+
<!-- | Yee | $1/\sqrt{2}$ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -->
220+
<!-- | Cowan | 0.999 | 0 | 0 | 0 | 0.125 | 0.125 | 0 | 0 | 0 | 0 | -->
221+
<!-- | Lehe | 0.96 | -0.021 | 0 | 0 | 0.125 | 0.125 | 0 | 0 | 0 | 0 | -->
222+
<!-- | min1 | $0.97/\sqrt{2}$ | -0.125 | -0.125 | 0 | 0.11 | 0.11 | 0 | 0 | 0 | 0 | -->
223+
<!-- | min2 | $0.95/\sqrt{2}$ | -0.013 | -0.013 | 0 | -0.013 | -0.013 | 0 | 0 | 0 | 0 | -->
224+
<!-- | min3 | 0.5 | -0.065 | -0.065 | 0 | -0.065 | -0.065 | 0 | 0 | 0 | 0 | -->
225+
<!-- | min4 | 0.1 | -0.125 | -0.125 | 0 | -0.125 | -0.125 | 0 | 0 | 0 | 0 | -->
226+
<!-- | min5 | 0.96 | -0.017 | -0.017 | 0 | 0.133 | 0.133 | 0 | 0 | 0 | 0 | -->
227+
<!-- | min6 | 0.999 | -0.0005 | 0 | 0 | 0.128 | 0.128 | 0 | 0 | 0 | 0 | -->
228+
<!-- | **3D** | | | | | | | | | | | -->
229+
<!-- | Yee | $1/\sqrt{3}$ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -->
230+
<!-- | min3 | 0.5 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -0.00867 | -->
231+
<!-- | min4 | 0.1 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -0.048434 | -->
53232

54233
To visualize the impact of the field stencil you can see the field of a single particle traveling in vacuum at `gamma = 10.0` in the following plot.
55234
The rows show the particle traveling at $\theta = 0^\circ$, $\theta = 45^\circ$, $\theta = 90^\circ$ with respect to the x-axis.
56235
Each column corresponds to a different field stencil from the table above.
57236

58-
![higherorder_stencil](../../assets/images/higherorder/fieldstencil_dark.png){width=100%, align=center}
237+
![higherorder_stencil](../../assets/images/higherorder/fieldstencil_dark.png#only-dark){width=100% align=center}
238+
![higherorder_stencil](../../assets/images/higherorder/fieldstencil_light.png#only-light){width=100% align=center}
59239

60240

61241
## Higher order shape functions
62242

63243
To interpolate the current of a particle to the grid and the fields back to the particle, Entity uses a shape function. Before v1.3.0 this shape function was only of first order.
64244
Since v1.3.0 you can use shape functions with up-to 11th order and deposit charges with the scheme introduced by [Esirkepov (2001)](https://ui.adsabs.harvard.edu/abs/2001CoPhC.135..144E/abstract).
65245

66-
![higherorder_shape](../../assets/images/higherorder/shape_functions_dark.png){width=50%, align=right}
246+
![higherorder_shape](../../assets/images/higherorder/shape_functions_dark.png){width=50% align=right class="invertdark"}
67247

68248
You can switch to higher order shape functions by adding the follwoing compile flags to you `cmake` command: `-D deposit=esirkepov -D shape_order=<N>`, where `<N>` can be any number between `1` and `11`.
69249

@@ -73,12 +253,13 @@ We choose the temperature to be very low, in order to purposefully under-resolve
73253
From the top to bottom we uncrease the resolution of the grid to improve resolving the Debye-length.
74254
You can see that with higher order shape functions the numerical heating stops at considerably lower resolution.
75255

76-
![higherorder_shape](../../assets/images/higherorder/heating_dark.png){width=100%, align=center}
256+
![higherorder_shape](../../assets/images/higherorder/heating_dark.png){width=100% align=center class="invertdark"}
77257

78258
This allows you to reduce the numerical resolution when moving to higher order shape functions.
79259
We strongly advise to perform careful convergence tests before reducing numerical resolution in favor of higher order shape functions.
80260

81261
The computational cost increase is negligible for 1D, but can become substantial for 3D.
82262
You can find scaling tests performed on a single Intel PVC GPU in the following plot.
83263

84-
![higherorder_shape](../../assets/images/higherorder/scaling_dark.png){width=100%, align=center}
264+
![higherorder_shape](../../assets/images/higherorder/scaling_dark.png#only-dark){width=100% align=center}
265+
![higherorder_shape](../../assets/images/higherorder/scaling_light.png#only-light){width=100% align=center}

sass/components/_image.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@use "../colors" as colors;
2+
3+
img.invertdark {
4+
@include colors.light-theme {
5+
filter: invert(1) hue-rotate(180deg);
6+
}
7+
}

0 commit comments

Comments
 (0)