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

Added AnalyticFluxDistribution class #5422

Merged

Conversation

oshapoval
Copy link
Member

Added an AnalyticFluxDistribution class with a parsed flux_expression. Depends on picmi-standard/picmi#121

@@ -739,6 +739,41 @@ def distribution_initialize_inputs(
species.add_new_group_attr(source_name, "density", density_scale)


class AnalyticFluxDistribution(
Copy link
Member

@dpgrote dpgrote Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a different way to handle this? This is an exact duplicate of UniformFluxDistribution except for the one keyword argument flux_expression.
This could be simplified if the picmistandard class took the same argument, flux, as the uniform distribution, then one could do "UniformFluxDistribution = AnalyticFluxDistribution" and have only one version of the class.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Note that we also have two different classes for the volume injection: UniformDistribution and AnalyticDistribution, so we were trying to mirror the same setup here for UniformFluxDistribution and AnalyticFluxDistribution.

Do you think that your comment also applies to UniformDistribution and AnalyticDistribution?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out, I will refactor accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UniformDistribution and AnalyticDistribution are quite a bit different from each other and it's probably too late to change that API.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this PR ready? I still see the duplication of 'UniformFluxDistribution' - this is fine if that is the intent. Also, UniformFluxDistribution has the inject_from_embedded_boundary option - would that also be supported with the analytic distribution?

@oshapoval oshapoval closed this Nov 4, 2024
@oshapoval oshapoval reopened this Nov 4, 2024
@RemiLehe RemiLehe self-assigned this Nov 4, 2024
@RemiLehe RemiLehe requested a review from dpgrote November 18, 2024 18:58
Python/pywarpx/picmi.py Fixed Show fixed Hide fixed
Copy link
Member

@dpgrote dpgrote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now. Thanks!

@RemiLehe RemiLehe merged commit 5bc4790 into ECP-WarpX:development Dec 12, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants