Skip to content

Commit 6ce2c76

Browse files
committed
updated ossfe
1 parent 9f89de6 commit 6ce2c76

File tree

4 files changed

+105
-38
lines changed

4 files changed

+105
-38
lines changed

episodes/fig/paraview_pipeline.png

16.6 KB
Loading

episodes/files/analysis_3d_magnetic_mirror.ipynb

Lines changed: 33 additions & 6 deletions
Large diffs are not rendered by default.

episodes/ossfe2025.Rmd

Lines changed: 71 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exercises: 30
77
:::::::::::::::::::::::::::::::::::::: questions
88

99
- 🤌 What is WarpX?
10-
- 🧮 How can I install and run WarpX?
10+
- 🔧 How can I install and run WarpX?
1111
- 🕵️ How can I analyze the simulation results?
1212

1313
::::::::::::::::::::::::::::::::::::::::::::::::
@@ -22,58 +22,70 @@ exercises: 30
2222

2323
## WarpX, a particle-in-cell code
2424

25-
Welcome to the WarpX tutorial at [OSSFE 2025](https://ossfe.github.io/)!
25+
Welcome to the WarpX tutorial at [OSSFE 2025](https://ossfe.github.io/)! 👋
2626

27-
[WarpX](https://github.com/BLAST-WarpX/warpx) is a general purpose **open-source** **high-performance** Particle-In-Cell (PIC) code.
27+
[WarpX](https://github.com/BLAST-WarpX/warpx) is a general purpose **open-source** **high-performance** **Particle-In-Cell** (PIC) code.
2828
If you are not familiar with the PIC method, here is a picture that condenses the core idea:
2929

30-
If you want to know more, here are a few references:
30+
![Some computational particles (a.k.a. macroparticles) traveling in space, across the cells of a grid.](https://gist.github.com/user-attachments/assets/50726d37-2b72-4664-9435-f90d7d2f0043
31+
){alt="macroparticles in the cells of a grid"}
32+
33+
And here is a more informative image that explains the core algorithmic steps.
34+
35+
![The loop at the basis of standard PIC codes.](https://gist.github.com/user-attachments/assets/659c0816-3c13-4375-b17d-03b894e17b93
36+
){alt="pic loop"}
37+
38+
If you want to know more about PIC, here are a few **references**:
3139

3240
* The two bibles on PIC 📚
3341
* [C. K. Birdsall and A. B. Langdon. Plasma Physics Via Computer Simulation.](https://doi.org/10.1201/9781315275048)
3442
* [R. W. Hockney and J. W. Eastwood. Computer simulation using particles.](https://doi.org/10.1201/9780367806934)
3543
* An old review written by one of the pioneers: [John M. Dawson, Particle simulation of plasmas, Rev. Mod. Phys. 55, 403](https://doi.org/10.1103/RevModPhys.55.403)
3644
* Browse our docs for [many more references about advanced algorithms and methods](https://warpx.readthedocs.io/en/latest/theory/pic.html).
3745

38-
39-
In this tutorial we will go through the basics of WarpX: installation, running a simple example and visualizing the results.
46+
In this tutorial we will go through the **basics of WarpX**: installation, running a simple example and visualizing the results.
4047
Along the way, we will point to some specific locations in the documentation, for your reference.
4148

42-
4349
::: callout
44-
Everything you need to know to use WarpX is in the [documentation](https://warpx.readthedocs.io/en/latest/index.html), check it out!
50+
📣 Everything you need to know to use WarpX is in the [documentation](https://warpx.readthedocs.io/en/latest/index.html), check it out!
4551
:::
4652

4753
::::::::::::::::::::::::::::::::::::::::::::::: checklist
4854

4955
Some cool features of WarpX:
5056

51-
- [x] Open-source - we wouldn't be here otherwise
52-
- [x] Runs on GPUs: NVIDIA, AMD, and Intel
53-
- [x] Runs on multiple GPUs or CPUs, on systems ranging from laptops to supercomputers
54-
- [x] Advanced algorithms and methods: mesh-refinement, embedded boundaries, electrostatic/electromagnetic/pseudospectral solvers, etc.
55-
- [x] Standards: [openPMD](https://www.openpmd.org/#/start) for output data, [PICMI](https://github.com/picmi-standard/picmi) for inputs
56-
- [x] Active development and mainteinance: check our [GitHub repo](https://github.com/BLAST-WarpX/warpx)
57-
- [x] International, cross-disciplinary community: plasma physics, fusion devices, laser-plasma interactions, beam physics, plasma-based acceleration, astrophysics
57+
📖 Open-source - we wouldn't be here otherwise!
58+
59+
✈️ Runs on GPUs: NVIDIA, AMD, and Intel
60+
61+
🚀 Runs on multiple GPUs or CPUs, on systems ranging from laptops to supercomputers
62+
63+
🤓 Advanced algorithms and methods: mesh-refinement, embedded boundaries, electrostatic/electromagnetic/pseudospectral solvers, etc.
64+
65+
💾 Standards: [openPMD](https://www.openpmd.org/#/start) for input/output data, [PICMI](https://github.com/picmi-standard/picmi) for inputs
66+
67+
🤸 Active development and mainteinance: check our [GitHub repo](https://github.com/BLAST-WarpX/warpx)
68+
69+
🗺️ International, cross-disciplinary community: plasma physics, fusion devices, laser-plasma interactions, beam physics, plasma-based acceleration, astrophysics
5870

5971
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
6072

6173
## Installing WarpX using Conda-Forge
6274

63-
First, you need a Conda installation and we will assume that you indeed have one.
64-
We will also assume you have some familiarity with the terminal.
75+
First, you need a **Conda** installation and we will assume that you indeed have one.
6576
If not, follow the [instruction at this link](https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html#regular-installation).
66-
You can install Conda on most operative systems: Windows, macOS, and Linux.
67-
Once you have Conda on your system, WarpX is available as a package via [Conda-Forge](https://conda-forge.org/download/).
68-
It's a one-liner, no-brainer, small-potatoes 😌!
77+
You can install Conda on most operative systems: **Windows, macOS, and Linux**.
78+
We will also assume you have some familiarity with the **terminal**.
79+
Once you have Conda on your system, **WarpX is available as a package** via [Conda-Forge](https://conda-forge.org/download/).
80+
The installation is a **one-liner** 😌!
6981

7082
::: callout
7183
```bash
7284
conda install -c conda-forge warpx
7385
```
7486
:::
7587

76-
Ok, maybe two lines if you want to keep your system clean by creating a new environment.
88+
Ok, maybe two lines if you want to keep your system clean by creating a new **environment**.
7789

7890
```bash
7991
conda create -n warpx -c conda-forge warpx
@@ -96,11 +108,14 @@ then you got this 🙌! You can also import `pywarpx` in `python`
96108

97109
## A simple example of a magnetic mirror
98110

99-
In this example we will simulate a bunch of protons inside a magnetic mirror machine.
111+
In this example we will simulate a bunch of **protons inside a magnetic mirror machine**.
100112
The protons are initialized with random positions and velocities.
101113
The magnetic field is loaded from a `.h5` file.
102114
Make sure to download the [input file](./files/inputs_3d_magnetic_mirror.txt).
103115

116+
Whenever you need to prepare an input file, [this is where you want to go](https://warpx.readthedocs.io/en/latest/usage/parameters.html).
117+
By the way, analytics tell us that this is the most popular page of the documentation 👠!
118+
104119
:::::::::::::::::::::::::::::::::::::::::: spoiler
105120

106121
### Let's take a look at the input file
@@ -141,16 +156,23 @@ If that's the case, yey! 💯
141156
If the run went wrong, you may find a `Backtrace.0.0` file which can be useful for debugging purposes.
142157
Let me know if the code fails in any way!
143158

159+
Here we have loaded the field of hte magnetic bottle from a file.
160+
You can also you can [define an external field analytically](https://warpx.readthedocs.io/en/latest/usage/parameters.html#applied-to-particles).
161+
144162

163+
## Visualizing
145164

146-
## Visualizing with python
165+
### With python 🐍
147166

148167
Now that we have the results, we can analyze them using `python`.
149168
We will use the [openPMD-viewer](https://openpmd-viewer.readthedocs.io/en/latest/) library to grab the data that the simulation produced in `openPMD` format.
169+
Here you can find [a few great tutorials on how to use the viewer](https://openpmd-viewer.readthedocs.io/en/latest/tutorials/tutorials.html).
170+
If you feel nerdy and/or you need to deal with the data in parallel workflows, you can use the [openPMD-api](https://openpmd-api.readthedocs.io/en/latest/).
150171

151172
:::::::::::::::::::::::::::::::::::::::::: spoiler
152173

153-
### Let's take a look at a simple Jupyter notebook
174+
Let's take a look at a simple Jupyter notebook where we retrieve the magnetic field and the particle attributes at the end of the simulation.
175+
With a little bit more work, we also plot the trajectories of the particles.
154176

155177
```{r, results='asis', echo=FALSE}
156178
cat('<iframe src="https://nbviewer.org/github/aeriforme/warpx-tutorials/blob/main/episodes/files/analysis_3d_magnetic_mirror.ipynb"
@@ -160,22 +182,39 @@ cat('<iframe src="https://nbviewer.org/github/aeriforme/warpx-tutorials/blob/mai
160182
::::::::::::::::::::::::::::::::::::::::::::::::::
161183

162184

163-
## Visualizing with Paraview
185+
You can [download the notebook](../files/analysis_3d_magnetic_mirror.ipynb) and try it yourself.
186+
Remember to either run the notebook from the simulation directory or change the corresponding path in the notebook.
164187

165-
Add stuff...
188+
### With Paraview
166189

167-
You can get images and videos 😎
190+
Now it's time to produce some pretty cool images and videos! 😎
191+
If you don't have it, you can [download Paraview here](https://www.paraview.org/download/).
192+
In the `diags/diag1` directory you should find a file named `paraview.pmd`: Paraview can read `.pmd` files.
193+
Just open Paraview and from there open the `.pmd` file.
194+
You should see `Meshes` and `Particles` in your pipeline browser (usually on the left).
195+
We can zhuzh up the pipeline so that we can visualize the trajectories of the protons in time
168196

169-
![Protons trajectories in a magnetic mirror](https://gist.github.com/user-attachments/assets/24b11226-4242-4958-bc12-c09159363065){alt="simulation of proton trajectories inside a magnetic mirror"}
197+
This is the pipeline that I have used to produce the visualizations below.
170198

199+
![](fig/paraview_pipeline.png){alt="paraview pipeline"}
200+
201+
![Protons trajectories in a magnetic mirror](https://gist.github.com/user-attachments/assets/24b11226-4242-4958-bc12-c09159363065){alt="simulation of proton trajectories inside a magnetic mirror"}
171202

172203
<iframe src="https://drive.google.com/file/d/1HhY2bL4kzkKoNp9eCkdI6S3m49JXUKsx/preview" width="100%" height="500" allow="autoplay"></iframe>
173204

205+
206+
If you make any other 3D visualization with this data, let me know! We can add it here 😉!
207+
208+
And that's all for now! 👋
209+
174210
::::::::::::::::::::::::::::::::::::: keypoints
175211

176-
- WarpX is a open-source high-performance particle-in-cell code
177-
- WarpX is easy to install using `Conda`: `conda -c conda-forge warpx`
178-
- The documentation is the first place to look for answers, otherwise check out our Issues and Discussions
179-
- Visualizing 3D results with Paraview and `openpmd` data using `.pmd` files.
212+
📖 [**WarpX**](https://ecp-warpx.github.io/) is a open-source high-performance particle-in-cell code
213+
214+
🔧 WarpX is **easy to install via Conda**: `conda -c conda-forge warpx`
215+
216+
🔍 The [**documentation**](https://warpx.readthedocs.io/en/latest/) is the first place to look for answers, otherwise check out our [**issues**](https://github.com/BLAST-WarpX/warpx/issues) and [**discussions**](https://github.com/BLAST-WarpX/warpx/discussions).
217+
218+
👀 To visualize the simulation results in [**openPMD**](http://www.openpmd.org/) format, you can use the [**openPMD-viewer**](https://openpmd-viewer.readthedocs.io/) library for `python` or you can open `.pmd` files directly in [**Paraview**]((https://www.paraview.org/download/)).
180219

181220
::::::::::::::::::::::::::::::::::::::::::::::::

links.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ any links that you are not going to use.
88
[warpx-readthedocs]: https://warpx.readthedocs.io/en/latest/
99
[openpmd]: http://www.openpmd.org/
1010
[picmi]: https://picmi.readthedocs.io/en/latest/
11+
[openpmd-viewer]: https://openpmd-viewer.readthedocs.io/

0 commit comments

Comments
 (0)