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

Implement positivty limiter with numbers for conservative variables #113

Merged
merged 3 commits into from
Jun 19, 2023

Conversation

bennibolm
Copy link
Owner

@bennibolm bennibolm commented Jun 14, 2023

This PR changes the call of the IDP positivity limiter. One uses an array of numbers to call the positivity limiter for conservative variables. Before, we used a tuple of functions. This change is useful when adding state limiting of conservative variables in the future.

Example (limiting density of Euler equations): Use variables_cons=[1] instead of variables_cons=(Trixi.density,)

Comment on lines +243 to +245
struct IndicatorIDP{RealT <: Real, Cache} <: AbstractIndicator
positivity::Bool
variables_cons::LimitingVariablesCons # Positivity of conservative variables
variables_cons::Vector{Int} # Impose positivity for conservative variables
Copy link
Owner Author

Choose a reason for hiding this comment

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

I am not sure if a tuple or an array is more useful. The length can vary depending on the example, which is why I now use an array. Is there still the possibility to use a tuple with undefined length?
The non-linear variables (in latter PRs) are still passed as functions in a tuple. But maybe the same type (tuple/array) should be used here (?).

@bennibolm bennibolm marked this pull request as ready for review June 19, 2023 13:21
@bennibolm bennibolm changed the title WIP: Implement positivty limiter with numbers for conservative variables Implement positivty limiter with numbers for conservative variables Jun 19, 2023
@bennibolm bennibolm merged commit 6cfbbff into IDPlimiting-positivity-cons Jun 19, 2023
@bennibolm bennibolm deleted the IDPlimiting-positivity-cons-2 branch August 18, 2023 11:51
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.

1 participant