Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add PICMI interface for injecting from embedded boundary #5395

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,11 @@ def setup_parse_momentum_functions(
class UniformFluxDistribution(
picmistandard.PICMI_UniformFluxDistribution, DensityDistributionBase
):
def init(self, kw):
self.inject_from_embedded_boundary = kw.pop(
"warpx_inject_from_embedded_boundary", False
)

def distribution_initialize_inputs(
self, species_number, layout, species, density_scale, source_name
):
Expand All @@ -702,13 +707,22 @@ def distribution_initialize_inputs(
species.add_new_group_attr(source_name, "flux", self.flux)
if density_scale is not None:
species.add_new_group_attr(source_name, "flux", density_scale)
species.add_new_group_attr(
source_name, "flux_normal_axis", self.flux_normal_axis
)
species.add_new_group_attr(
source_name, "surface_flux_pos", self.surface_flux_position
)
species.add_new_group_attr(source_name, "flux_direction", self.flux_direction)

if not self.inject_from_embedded_boundary:
species.add_new_group_attr(
source_name, "flux_normal_axis", self.flux_normal_axis
)
species.add_new_group_attr(
source_name, "surface_flux_pos", self.surface_flux_position
)
species.add_new_group_attr(
source_name, "flux_direction", self.flux_direction
)
else:
species.add_new_group_attr(
source_name, "inject_from_embedded_boundary", True
)

species.add_new_group_attr(source_name, "flux_tmin", self.flux_tmin)
species.add_new_group_attr(source_name, "flux_tmax", self.flux_tmax)

Expand Down
Loading