diff --git a/applications/GeoMechanicsApplication/custom_workflows/adaptive_time_incrementor.cpp b/applications/GeoMechanicsApplication/custom_workflows/adaptive_time_incrementor.cpp index 72222063c1e..ebcc8fe1f8c 100644 --- a/applications/GeoMechanicsApplication/custom_workflows/adaptive_time_incrementor.cpp +++ b/applications/GeoMechanicsApplication/custom_workflows/adaptive_time_incrementor.cpp @@ -84,8 +84,9 @@ void AdaptiveTimeIncrementor::PostTimeStepExecution(const TimeStepEndState& rRes } if (rResultantState.time < mEndTime) { // Up-scaling to reach end_time without small increments - constexpr auto small_increment = 1.0e-3; - if (rResultantState.time + mDeltaTime > mEndTime - small_increment * mDeltaTime) { + constexpr auto small_increment_factor = 1.0e-3; + if (auto small_time_increment = small_increment_factor * mDeltaTime; + rResultantState.time + mDeltaTime > mEndTime - small_time_increment) { mDeltaTime = mEndTime - rResultantState.time; } } @@ -97,7 +98,7 @@ void AdaptiveTimeIncrementor::PostTimeStepExecution(const TimeStepEndState& rRes } KRATOS_ERROR_IF(mDeltaTime < mMinAllowableDeltaTime.second) - << "Delta time (" << mDeltaTime << ") is smaller than minimum allowable value " + << "Delta time (" << mDeltaTime << ") is smaller than " << mMinAllowableDeltaTime.first << " minimum allowable value " << mMinAllowableDeltaTime.second << std::endl; } diff --git a/applications/GeoMechanicsApplication/custom_workflows/dgeosettlement.cpp b/applications/GeoMechanicsApplication/custom_workflows/dgeosettlement.cpp index 427821c1b88..180f9385739 100644 --- a/applications/GeoMechanicsApplication/custom_workflows/dgeosettlement.cpp +++ b/applications/GeoMechanicsApplication/custom_workflows/dgeosettlement.cpp @@ -78,7 +78,7 @@ double GetMaxDeltaTimeFactorFrom(const Parameters& rProjectParameters) std::pair GetMinAllowableDeltaTimeFrom(const Parameters& rProjectParameters) { if (rProjectParameters["solver_settings"]["time_stepping"].Has("minimum_allowable_value")) { - return {"set", + return {"given", rProjectParameters["solver_settings"]["time_stepping"]["minimum_allowable_value"].GetDouble()}; } else { constexpr auto minimum_allowable_value = 1e-10; diff --git a/applications/GeoMechanicsApplication/python_scripts/geomechanics_analysis.py b/applications/GeoMechanicsApplication/python_scripts/geomechanics_analysis.py index 3ed6adc56c7..fd8b66b4a9b 100644 --- a/applications/GeoMechanicsApplication/python_scripts/geomechanics_analysis.py +++ b/applications/GeoMechanicsApplication/python_scripts/geomechanics_analysis.py @@ -80,7 +80,7 @@ def _check_delta_time_size(self): KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "The time step ", self.delta_time, " is smaller than a given minimum value of ", self.min_delta_time) else: KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "The time step ", self.delta_time, " is smaller than a default minimum value of ", self.min_delta_time) - KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "Please check the case settings.") + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "Please check settings in Project Parameters and Materials Files.") raise RuntimeError('The time step is too small!') def RunSolutionLoop(self): @@ -194,9 +194,9 @@ def ResetIfHasNodalSolutionStepVariable(self, variable): self._GetSolver().GetComputingModelPart().Nodes, variable, zero_vector, 1) def PrintAnalysisStageProgressInformation(self): - KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "STEP : ", self._GetSolver().GetComputingModelPart().ProcessInfo[KratosMultiphysics.STEP]) - KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "DELTA_TIME : ", self._GetSolver().GetComputingModelPart().ProcessInfo[KratosMultiphysics.DELTA_TIME]) - KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "TIME : ", self._GetSolver().GetComputingModelPart().ProcessInfo[KratosMultiphysics.TIME]) + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "STEP : ", self._GetSolver().GetComputingModelPart().ProcessInfo[KratosMultiphysics.STEP]) + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "DELTA_TIME: ", self._GetSolver().GetComputingModelPart().ProcessInfo[KratosMultiphysics.DELTA_TIME]) + KratosMultiphysics.Logger.PrintInfo(self._GetSimulationName(), "TIME : ", self._GetSolver().GetComputingModelPart().ProcessInfo[KratosMultiphysics.TIME]) def _CreateSolver(self): return geomechanics_solvers_wrapper.CreateSolver(self.model, self.project_parameters) diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_workflows/test_time_incrementor.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_workflows/test_time_incrementor.cpp index defc8a33e72..fb526827f90 100644 --- a/applications/GeoMechanicsApplication/tests/cpp_tests/custom_workflows/test_time_incrementor.cpp +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/custom_workflows/test_time_incrementor.cpp @@ -25,7 +25,7 @@ struct AdaptiveTimeIncrementorSettings { double StartTime{0.0}; double EndTime{8.0}; double StartIncrement{0.5}; - std::pair MinAllowableDeltaTime{"set", 1e-06}; + std::pair MinAllowableDeltaTime{"given", 1e-06}; std::size_t MaxNumOfCycles{8}; double ReductionFactor{0.5}; double IncreaseFactor{2.0}; @@ -440,13 +440,13 @@ KRATOS_TEST_CASE_IN_SUITE(ThrowExceptionWhenDeltaTimeSmallerThanTheLimit, Kratos KRATOS_EXPECT_EXCEPTION_IS_THROWN( time_incrementor.PostTimeStepExecution(previous_state), - "Delta time (1e-07) is smaller than minimum allowable value 1e-06"); + "Delta time (1e-07) is smaller than given minimum allowable value 1e-06"); previous_state.convergence_state = TimeStepEndState::ConvergenceState::non_converged; KRATOS_EXPECT_EXCEPTION_IS_THROWN( - time_incrementor.PostTimeStepExecution(previous_state), - "Delta time (5e-08) is smaller than minimum allowable value 1e-06"); + time_incrementor.PostTimeStepExecution(previous_state), + "Delta time (5e-08) is smaller than given minimum allowable value 1e-06"); } KRATOS_TEST_CASE_IN_SUITE(HalfTimeStepAtNonConverged, KratosGeoMechanicsFastSuiteWithoutKernel)