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

make sure harmonic average particle interpolator does not average neg… #5359

Merged

Conversation

jdannberg
Copy link
Contributor

…ative values

This is based on a discussion with @anne-glerum this morning.

For all pull requests:

@jdannberg
Copy link
Contributor Author

Looks like the one test that is failing (particle_interpolator_harmonic_average_solkz) triggers this exact problem: It averages a compositional field that is negative, in this case, it is the a field that is used to compute the density which is initialized as -1 * sin(2z) * cos(3pi*x) in a 1x1 box, so it varies between plus and minus 1.

Any suggestions what to do with that? If this test is just for averaging, I could just add +1 to that whole function and it should be fine. Does that seem reasonable?

@gassmoeller
Copy link
Member

I could just add +1 to that whole function and it should be fine. Does that seem reasonable?

Seems reasonable to me since this test is not meant to test the accuracy of SolKz. Just add a comment to the parameter file that explains why you changed it.

@jdannberg
Copy link
Contributor Author

Thank you! I have adapted the test (and while the pressure error is meaningless now, this actually improved the velocity error quite a bit).

@jdannberg jdannberg force-pushed the assert_harmonic_particle_interpolator branch from 633c35a to 56b78e8 Compare August 17, 2023 13:37
Copy link
Member

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

The improved velocity error probably comes from the fact we no longer compute wrong averages for the negative values.
Anyway, thanks for the fix.

@gassmoeller gassmoeller merged commit 684559c into geodynamics:main Aug 18, 2023
7 checks passed
@jdannberg jdannberg deleted the assert_harmonic_particle_interpolator branch August 18, 2023 18:44
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.

None yet

2 participants