-
Notifications
You must be signed in to change notification settings - Fork 239
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
Add an assertion to the computation of the SPD factor. #5685
base: main
Are you sure you want to change the base?
Conversation
It looks like you got a merge conflict and a bunch of newton solver tests fail. |
@YiminJin I could use your help here. This patch adds an assertion that the computation of the SPD factor is really only called when We compute the derivative with |
@bangerth This is because I forced the assembler to use the deviatoric strain rate (line 179 and 404 in source/simulator/assemblers/newton_stokes.cc). The exception handler will certainly be triggered when a material model calculates the effective viscosity with the full strain rate. I made this modification because the newton solver was meant to serve the only two rheology models that calculate the viscosity derivatives (ViscoPlastic and CompositeViscoPlastic), and both of them use the deviatoric strain rate when calculating the effective viscosity (line 135 in source/material_model/rheology/visco_plastic.cc and line 133 in source/material_model/rheology/composite_visco_plastic.cc). Personally I think it is better to use the deviatoric strain rate when calculating the viscosity, since the viscosity is only related with the deviatoric parts of strain and stress in most cases. But if we are really in need of calculating the viscosity with the full strain rate, we may distinguish such cases by passing a boolean to the assembler (somewhere in Scratch), or add an entry in the parameter list. What do you think? |
I have opened a PR for the SPD factor in general cases (#5754 ). This can circumvent the problem, but I doubt if it is a good idea, because the convergence rate of the Newton solver is very sensitive to the descending direction, and a small deviation in the descending direction may significantly increase the number of iterations required for convergence. |
This is a follow-up to #5671 and codifies an assumption in the design of the algorithm by @YiminJin .
@naliboff FYI.