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

Open
wants to merge 8 commits into
base: development
Choose a base branch
from

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.

@oshapoval oshapoval closed this Nov 4, 2024
@oshapoval oshapoval reopened this Nov 4, 2024
@RemiLehe RemiLehe self-assigned this Nov 4, 2024
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