-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28f37f8
commit f0ea24c
Showing
4 changed files
with
120 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
""" | ||
This file is part of ImpactX | ||
Copyright 2023 ImpactX contributors | ||
Authors: Axel Huebl | ||
License: BSD-3-Clause-LBNL | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
__all__ = [ | ||
"register_ImpactXParIter_extension", | ||
"soa", | ||
"soa_int_comps", | ||
"soa_real_comps", | ||
] | ||
|
||
def register_ImpactXParIter_extension(impactx_pybind): | ||
""" | ||
ImpactXParIter helper methods | ||
""" | ||
|
||
def soa(self): | ||
""" | ||
Get the StructOfArrays on the current tile | ||
Parameters | ||
---------- | ||
self : ImpactXParIter or ImpactXParConstIter | ||
used to query particle container component names | ||
""" | ||
|
||
def soa_int_comps(pti, num_comps): | ||
""" | ||
Name the ImpactX int components in SoA. | ||
Parameters | ||
---------- | ||
pti : ImpactXParIter or ImpactXParConstIter | ||
used to query particle container component names | ||
num_comps : int | ||
number of components to generate names for. | ||
Returns | ||
------- | ||
A list of length num_comps with values. | ||
""" | ||
|
||
def soa_real_comps(pti, num_comps): | ||
""" | ||
Name the ImpactX ParticleReal components in SoA. | ||
Parameters | ||
---------- | ||
pti : ImpactXParIter or ImpactXParConstIter | ||
used to query particle container component names | ||
num_comps : int | ||
number of components to generate names for. | ||
Returns | ||
------- | ||
A list of length num_comps with values. | ||
""" |
38 changes: 38 additions & 0 deletions
38
src/python/impactx/extensions/ImpactXParticleContainer.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
This file is part of ImpactX | ||
Copyright 2023 ImpactX contributors | ||
Authors: Axel Huebl | ||
License: BSD-3-Clause-LBNL | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
__all__ = ["ix_pc_plot_mpl_phasespace", "register_ImpactXParticleContainer_extension"] | ||
|
||
def ix_pc_plot_mpl_phasespace(self, num_bins=50, root_rank=0): | ||
""" | ||
Plot the longitudinal and transverse phase space projections with matplotlib. | ||
Parameters | ||
---------- | ||
self : ImpactXParticleContainer_* | ||
The particle container class in ImpactX | ||
num_bins : int, default=50 | ||
The number of bins for spatial and momentum directions per plot axis. | ||
root_rank : int, default=0 | ||
MPI root rank to reduce to in parallel runs. | ||
Returns | ||
------- | ||
A matplotlib figure with containing the plot. | ||
For MPI-parallel ranks, the figure is only created on the root_rank. | ||
""" | ||
|
||
def register_ImpactXParticleContainer_extension(ixpc): | ||
""" | ||
ImpactXParticleContainer helper methods | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from . import ImpactXParIter, ImpactXParticleContainer | ||
|
||
__all__ = ["ImpactXParIter", "ImpactXParticleContainer"] |