aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2023-04-19 14:40:41 -0700
committerGravatar GitHub <noreply@github.com> 2023-04-19 14:40:41 -0700
commit7a543b983c7ae0a2b204daabbd9ccef6684456b4 (patch)
treeb3eff22e152656da017eb5b062bee41b135c7d47 /Python/pywarpx/picmi.py
parent328e8a8d86da19b21318b2160e32ac042d22fa43 (diff)
downloadWarpX-7a543b983c7ae0a2b204daabbd9ccef6684456b4.tar.gz
WarpX-7a543b983c7ae0a2b204daabbd9ccef6684456b4.tar.zst
WarpX-7a543b983c7ae0a2b204daabbd9ccef6684456b4.zip
Add more PICMI options (#3773)
* Add PICMI option to cover multiple cuts * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Parse flux_min, flux_tmax from PICMI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Implement review comments --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r--Python/pywarpx/picmi.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py
index 9d620eb72..4a3798059 100644
--- a/Python/pywarpx/picmi.py
+++ b/Python/pywarpx/picmi.py
@@ -416,6 +416,8 @@ class UniformFluxDistribution(picmistandard.PICMI_UniformFluxDistribution, Densi
species.flux_normal_axis = self.flux_normal_axis
species.surface_flux_pos = self.surface_flux_position
species.flux_direction = self.flux_direction
+ species.flux_tmin = self.flux_tmin
+ species.flux_tmax = self.flux_tmax
# --- Use specific attributes for flux injection
species.injection_style = "nfluxpercell"
@@ -1341,12 +1343,15 @@ class EmbeddedBoundary(picmistandard.base._ClassWithInit):
Analytic expression defining the potential. Can only be specified
when the solver is electrostatic.
+ cover_multiple_cuts: bool, default=None
+ Whether to cover cells with multiple cuts.
+ (If False, this will raise an error if some cells have multiple cuts)
Parameters used in the analytic expressions should be given as additional keyword arguments.
"""
def __init__(self, implicit_function=None, stl_file=None, stl_scale=None, stl_center=None, stl_reverse_normal=False,
- potential=None, **kw):
+ potential=None, cover_multiple_cuts=None, **kw):
assert stl_file is None or implicit_function is None, Exception('Only one between implicit_function and '
'stl_file can be specified')
@@ -1365,6 +1370,8 @@ class EmbeddedBoundary(picmistandard.base._ClassWithInit):
self.potential = potential
+ self.cover_multiple_cuts = cover_multiple_cuts
+
# Handle keyword arguments used in expressions
self.user_defined_kw = {}
for k in list(kw.keys()):
@@ -1393,6 +1400,8 @@ class EmbeddedBoundary(picmistandard.base._ClassWithInit):
pywarpx.eb2.stl_center = self.stl_center
pywarpx.eb2.stl_reverse_normal = self.stl_reverse_normal
+ pywarpx.eb2.cover_multiple_cuts = self.cover_multiple_cuts
+
if self.potential is not None:
assert isinstance(solver, ElectrostaticSolver), Exception('The potential is only supported with the ElectrostaticSolver')
expression = pywarpx.my_constants.mangle_expression(self.potential, self.mangle_dict)