Skip to content

Conversation

@sunethwarna
Copy link
Member

@sunethwarna sunethwarna commented Nov 11, 2025

📝 Description

This PR just initializes the Bossak constants, and some other information in the Scheme::Predict as well to allow the change introduced in #13350 .

But this is only a ** Temporary ** fix, because now we are doing the same initialization in Scheme::Predict and Scheme::InitializeSolutionStep. In some schemes, this can be very expensive as shown below where nodal neighbour count is also now has to be done in both Scheme::Predict and Scheme::InitializeSolutionStep.

Lets hope the CI passes :)

void InitializeSolutionStep(
ModelPart& rModelPart,
SystemMatrixType& rA,
SystemVectorType& rDx,
SystemVectorType& rb) override
{
KRATOS_TRY;
BaseType::InitializeSolutionStep(rModelPart, rA, rDx, rb);
const auto& r_current_process_info = rModelPart.GetProcessInfo();
mBossak = CalculateBossakConstants(mBossak.Alpha, GetTimeStep(r_current_process_info));
this->CalculateNodeNeighbourCount(rModelPart);
KRATOS_CATCH("");
}

🆕 Changelog

  • Temporary fix to initialize bossak scheme values both in Predict and InitializeSolutionStep.

RiccardoRossi
RiccardoRossi previously approved these changes Nov 12, 2025
Copy link
Member

@RiccardoRossi RiccardoRossi left a comment

Choose a reason for hiding this comment

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

one question, however i'll approve since anyway this is only a short term bugfix (thanks for taking care!!)

//Set Newmark coefficients

if( mNewmark.static_dynamic != 0 ) {
CurrentProcessInfo[NEWMARK_BETA] = mNewmark.beta;
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this?

@RiccardoRossi
Copy link
Member

ouch, it fails the tests in the core

 RUN      ] KratosCoreFastSuite.DisplacementNewmarkSchemeTest
2025-11-11T13:41:33.1881733Z  |  /           |                  
2025-11-11T13:41:33.1881803Z  ' /   __| _` | __|  _ \   __|    
2025-11-11T13:41:33.1881866Z  . \  |   (   | |   (   |\__ \  
2025-11-11T13:41:33.1881929Z _|\_\_|  \__,_|\__|\___/ ____/
2025-11-11T13:41:33.1882035Z            Multi-Physics 10.3."0"--975312ed-Custom-x86_64
2025-11-11T13:41:33.1882142Z            Compiled for GNU/Linux and Undefined with GCC-11.2
2025-11-11T13:41:33.1882283Z Compiled with threading support. Threading support with OpenMP.
2025-11-11T13:41:33.1882360Z Maximum number of threads: 4.
2025-11-11T13:41:33.1882599Z /__w/Kratos/Kratos/kratos/tests/cpp_tests/strategies/schemes/test_schemes.cpp:300: Failure
2025-11-11T13:41:33.1882817Z Expected: ((std::abs(v + std::sin(time)))) <= ((tolerance)), actual: 0.001 vs 1e-06
2025-11-11T13:41:33.1882988Z Check failed because std::abs(v + std::sin(time)) is greater than tolerance
2025-11-11T13:41:33.1882995Z 
2025-11-11T13:41:33.1883228Z /__w/Kratos/Kratos/kratos/tests/cpp_tests/strategies/schemes/test_schemes.cpp:300: Failure
2025-11-11T13:41:33.1883385Z Expected: ((std::abs(v + std::sin(time)))) <= ((tolerance)), actual: 0.001 vs 1e-06
2025-11-11T13:41:33.1883553Z Check failed because std::abs(v + std::sin(time)) is greater than tolerance
2025-11-11T13:41:33.1883632Z 
2025-11-11T13:41:33.1883866Z /__w/Kratos/Kratos/kratos/tests/cpp_tests/strategies/schemes/test_schemes.cpp:300: Failure
2025-11-11T13:41:33.1884021Z Expected: ((std::abs(v + std::sin(time)))) <= ((tolerance)), actual: 0.001 vs 1e-06
2025-11-11T13:41:33.1884189Z Check failed because std::abs(v + std::sin(time)) is greater than tolerance
2025-11-11T13:41:33.1884193Z 
2025-11-11T13:41:33.1884418Z /__w/Kratos/Kratos/kratos/tests/cpp_tests/strategies/schemes/test_schemes.cpp:300: Failure
2025-11-11T13:41:33.1884569Z Expected: ((std::abs(v + std::sin(time)))) <= ((tolerance)), actual: 0.001 vs 1e-06
2025-11-11T13:41:33.1884729Z Check failed because std::abs(v + std::sin(time)) is greater than tolerance
2025-11-11T13:41:33.1884732Z 
2025-11-11T13:41:33.1884960Z /__w/Kratos/Kratos/kratos/tests/cpp_tests/strategies/schemes/test_schemes.cpp:300: Failure
2025-11-11T13:41:33.1885142Z Expected: ((std::abs(v + std::sin(time)))) <= ((tolerance)), actual: 0.001 vs 1e-06
2025-11-11T13:41:33.1885305Z Check failed because std::abs(v + std::sin(time)) is greater than tolerance
2025-11-11T13:41:33.1885309Z 
2025-11-11T13:41:33.1885532Z /__w/Kratos/Kratos/kratos/tests/cpp_tests/strategies/schemes/test_schemes.cpp:300: Failure
2025-11-11T13:41:33.1885699Z Expected: ((std::abs(v + std::sin(time)))) <= ((tolerance)), actual: 0.001 vs 1e-06
2025-11-11T13:41:33.1886280Z Check failed because std::abs(v + std::sin(time)) is greater than tolerance
2025-11-11T13:41:33.1886285Z 

@RiccardoRossi
Copy link
Member

mmm, i believe the problem comes from here:

https://github.com/KratosMultiphysics/Kratos/blob/master/kratos/tests/cpp_tests/strategies/schemes/test_schemes.cpp#L208

(order not changed in the test)

@sunethwarna
Copy link
Member Author

@RiccardoRossi This is ready for your review. :)

Copy link
Member

@RiccardoRossi RiccardoRossi left a comment

Choose a reason for hiding this comment

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

Thank you!

@sunethwarna sunethwarna merged commit 612e841 into master Dec 2, 2025
9 of 10 checks passed
@sunethwarna sunethwarna deleted the core/temporary_fix_in_bossak_schemes_for_change_in_initialzie_sol_step branch December 2, 2025 06:53
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.

3 participants