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

Fix prescribed velocity cookbooks for dc stokes #5396

Conversation

MFraters
Copy link
Member

When working on a project I noticed that the prescribed velocities within the domain where a multiple of the prescribed value too high, and that the multiple was the number of nonlinear iterations. When using a defect correction Stokes (which includes the Newton Stokes), this should only be added at nonlinear iteration 0.

I am not sure if there is a cleaner way of checking this then what I am currently doing, so I am open to suggestions.

Comment on lines 272 to 277
((parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::no_Advection_iterated_defect_correction_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::single_Advection_iterated_defect_correction_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::iterated_Advection_and_defect_correction_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::iterated_Advection_and_Newton_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::single_Advection_iterated_Newton_Stokes)
&& simulator_access.get_nonlinear_iteration() == 0)
Copy link
Member

Choose a reason for hiding this comment

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

would this work?

Suggested change
((parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::no_Advection_iterated_defect_correction_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::single_Advection_iterated_defect_correction_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::iterated_Advection_and_defect_correction_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::iterated_Advection_and_Newton_Stokes ||
parameters.nonlinear_solver==Parameters<dim>::NonlinearSolver::single_Advection_iterated_Newton_Stokes)
&& simulator_access.get_nonlinear_iteration() == 0)
(simulator_access.get_nonlinear_iteration() == 0)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that works as well, thanks! I have update the pull request for both plugins

@MFraters MFraters force-pushed the fix_prescribed_velocity_cookbooks_for_DC_Stokes branch from a435291 to edcfeca Compare September 21, 2023 15:25
@gassmoeller
Copy link
Member

/rebuild

@gassmoeller
Copy link
Member

Looks good. The failing tester is unrelated.

@gassmoeller gassmoeller merged commit 52cab84 into geodynamics:main Sep 26, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants