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
Do not average unfilled material properties. #5385
Do not average unfilled material properties. #5385
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this! This works for me, and I made a pull request to your branch adding a simple test case (that crashed for me on the current main branch). The problem here was actually the GMG solver.
I don't know if it would be worth investigating in more detail why that averages viscosity values that have not been filled by the material model in the Stokes assembly.
source/material_model/interface.cc
Outdated
namespace | ||
{ | ||
bool | ||
all_entries_NaN(const std::vector<double> &values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all_entries_NaN(const std::vector<double> &values) | |
all_entries_NaN (const std::vector<double> &values) |
I am pretty sure that is because the GMG computes only the right-hand side of the Stokes equation in the assembly step. The viscosity is evaluated separately. Therefore it doesnt request the viscosity from the material model. I merged your test and updated the results to pass. This should be ready for another look. |
Oh, I see. That makes sense then! |
I found a bug in the
average_property
function that would cause floating point exceptions if a material output property is not filled. Our current convention for unfilled output properties is no longer that they are set to size 0, but that they are left unfilled at their default values NaN. I left the old condition untouched so that in case a user material model sets the size to 0 it still works the same way as before. I also moved the condition behind the disabling of the floating point exceptions, becauseisnan(NaN)
seems to sometimes throw floating point exceptions (at least it did for me) even though as far as I understand it shouldnt.