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

[Core] Fix norm in residual criteria and revert tests to original values #2976

Merged
merged 2 commits into from
Oct 5, 2018

Conversation

marandra
Copy link
Contributor

@marandra marandra commented Oct 4, 2018

This PR fixes a bug in the computation of the 2-norm (missing sqrt), introduced between commits 11377ef and ba897e3

Most importantly, it reverts tolerance values used in a Structural Mechanics test to the original values, so tests are passing again. The test failed after the modification of the computation of the norm, so the test was changed. I understand that with the modification in the routine, it was expected different results, so a change in the test might be needed. This is just a remainder to be VERY CAREFUL when modifying tests, as it completely defeats their purpose.

--- a/applications/StructuralMechanicsApplication/tests/test_patch_test_truss.py
+++ b/applications/StructuralMechanicsApplication/tests/test_patch_test_truss.py
@@ -92,7 +92,7 @@ class TestTruss3D2N(KratosUnittest.TestCase):
         linear_solver = KratosMultiphysics.SkylineLUFactorizationSolver()
         builder_and_solver = KratosMultiphysics.ResidualBasedBlockBuilderAndSolver(linear_solver)
         scheme = KratosMultiphysics.ResidualBasedIncrementalUpdateStaticScheme()
-        convergence_criterion = KratosMultiphysics.ResidualCriteria(1e-8,1e-8)
+        convergence_criterion = KratosMultiphysics.ResidualCriteria(1e-16,1e-24)
         convergence_criterion.SetEchoLevel(0)

         max_iters = 1000
@@ -118,7 +118,7 @@ class TestTruss3D2N(KratosUnittest.TestCase):
         linear_solver = KratosMultiphysics.SkylineLUFactorizationSolver()
         builder_and_solver = KratosMultiphysics.ResidualBasedBlockBuilderAndSolver(linear_solver)
         scheme = KratosMultiphysics.ResidualBasedBossakDisplacementScheme(0.00)
-        convergence_criterion = KratosMultiphysics.ResidualCriteria(1e-8,1e-8)
+        convergence_criterion = KratosMultiphysics.ResidualCriteria(1e-16,1e-24)
         convergence_criterion.SetEchoLevel(0)

philbucher
philbucher previously approved these changes Oct 4, 2018
Copy link
Member

@philbucher philbucher left a comment

Choose a reason for hiding this comment

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

thanks @marandra !
this PR seems fine to me, but please also wait for the response of others
also FYI @KlausBSautter since he made those tests

@jcotela
Copy link
Member

jcotela commented Oct 4, 2018

@marandra Thanks for fixing this. I'd however ask you to wait for a while to merge, since I suspect that the trilinos version will have the same mistake. Id like to test it during the afternoon and push a fix to this branch if necessary.

@marandra
Copy link
Contributor Author

marandra commented Oct 4, 2018

@jcotela I suspected that it could impact MPI or other parts of the code. Feel free to merge and delete the branch when you are done.

loumalouomega
loumalouomega previously approved these changes Oct 4, 2018
Copy link
Member

@loumalouomega loumalouomega left a comment

Choose a reason for hiding this comment

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

Ups, sorry

@jcotela jcotela dismissed stale reviews from loumalouomega and philbucher via db1a116 October 4, 2018 13:37
@jcotela
Copy link
Member

jcotela commented Oct 4, 2018

Ok the trilinos test is still failing, but we (@philbucher and I) are not convinced that it is due to the residual criteria itself. We would merge as is and fix the test later.

@marandra
Copy link
Contributor Author

marandra commented Oct 5, 2018

So we merge then? We need to re-approve.

@jcotela
Copy link
Member

jcotela commented Oct 5, 2018

Yes. Thanks for the re-approval, too.

@jcotela jcotela merged commit 511115b into master Oct 5, 2018
@jcotela jcotela deleted the fix-norm-residual-criteria branch October 5, 2018 08:59
@marandra
Copy link
Contributor Author

marandra commented Oct 5, 2018

Thanks!

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.

4 participants