-
Notifications
You must be signed in to change notification settings - Fork 247
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
[GeoMechanicsApplication] Create exit criterion for c phi process #12980
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,14 @@ KRATOS_TEST_CASE_IN_SUITE(CheckFailureEmptyModelPartApplyCPhiReductionProcess, K | |
"ApplyCPhiReductionProces has no elements in modelpart dummy") | ||
} | ||
|
||
KRATOS_TEST_CASE_IN_SUITE(CheckReturnsZeroForValidModelPartApplyCPhiReductionProcess, KratosGeoMechanicsFastSuite) | ||
{ | ||
Model model; | ||
auto& r_model_part = PrepareCPhiTestModelPart(model); | ||
ApplyCPhiReductionProcess process{r_model_part, {}}; | ||
KRATOS_CHECK_EQUAL(process.Check(), 0); | ||
} | ||
|
||
KRATOS_TEST_CASE_IN_SUITE(CheckFailureNegativeReductionFactorApplyCPhiReductionProcess, KratosGeoMechanicsFastSuite) | ||
{ | ||
Model model; | ||
|
@@ -200,4 +208,23 @@ KRATOS_TEST_CASE_IN_SUITE(CheckFailureNegativeReductionFactorApplyCPhiReductionP | |
"Reduction factor should not drop below 0.01, calculation stopped."); | ||
} | ||
|
||
KRATOS_TEST_CASE_IN_SUITE(CheckFailureTooSmallReductionIncrementApplyCPhiReductionProcess, KratosGeoMechanicsFastSuite) | ||
{ | ||
Model model; | ||
auto& r_model_part = PrepareCPhiTestModelPart(model); | ||
// Number of cycles should be larger than one to trigger the step halving of the | ||
// reduction increment | ||
r_model_part.GetProcessInfo().GetValue(NUMBER_OF_CYCLES) = 10; | ||
ApplyCPhiReductionProcess process{r_model_part, {}}; | ||
for (size_t i = 0; i < 6; ++i) { | ||
process.ExecuteInitializeSolutionStep(); | ||
} | ||
|
||
// After halving the initial reduction increment (0.1) for the seventh time, it becomes | ||
// 0,00078125, so it should throw an exception | ||
KRATOS_EXPECT_EXCEPTION_IS_THROWN( | ||
process.ExecuteInitializeSolutionStep(), | ||
"Reduction increment should not drop below 0.001, calculation stopped. Final safety factor = 1"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was a bit surprised to see a final safety factor of 1.0. I'm not sure whether I would have expected that particular value. Can you perhaps help me to see why 1.0 must be the correct value in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. the error message use mPreviousReductionFactor which is only updated in ExecuteFinalizeSolutionStep. |
||
} | ||
|
||
} // namespace Kratos::Testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking (use the dot as decimal separator):