-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GeoMechanicsApplication] Fix performance difference between line-bas…
…ed and interface-based piping elements (#13091)
- Loading branch information
Showing
2 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...csApplication/tests/cpp_tests/custom_elements/test_geo_steady_state_Pw_piping_element.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// KRATOS___ | ||
// // ) ) | ||
// // ___ ___ | ||
// // ____ //___) ) // ) ) | ||
// // / / // // / / | ||
// ((____/ / ((____ ((___/ / MECHANICS | ||
// | ||
// License: geo_mechanics_application/license.txt | ||
// | ||
// Main authors: Richard Faasse | ||
// | ||
|
||
#include "custom_elements/geo_steady_state_Pw_piping_element.h" | ||
#include "tests/cpp_tests/geo_mechanics_fast_suite.h" | ||
|
||
namespace Kratos::Testing | ||
{ | ||
|
||
KRATOS_TEST_CASE_IN_SUITE(GeoSteadyStatePipingElement_DoesNotLosePipingStateAfterInitializingTwice, | ||
KratosGeoMechanicsFastSuiteWithoutKernel) | ||
{ | ||
Model model; | ||
auto& r_model_part = model.CreateModelPart("Dummy"); | ||
auto p_node_1 = r_model_part.CreateNewNode(1, 0.0, -0.1, 0.0); | ||
auto p_node_2 = r_model_part.CreateNewNode(2, 1.0, -0.1, 0.0); | ||
auto p_element = make_intrusive<GeoSteadyStatePwPipingElement<2, 2>>( | ||
1, Kratos::make_shared<Line2D2<Node>>(p_node_1, p_node_2)); | ||
|
||
p_element->Initialize(r_model_part.GetProcessInfo()); | ||
KRATOS_EXPECT_FALSE(p_element->GetValue(PIPE_ACTIVE)) | ||
|
||
p_element->SetValue(PIPE_ACTIVE, true); | ||
p_element->Initialize(r_model_part.GetProcessInfo()); | ||
|
||
KRATOS_EXPECT_TRUE(p_element->GetValue(PIPE_ACTIVE)) | ||
} | ||
|
||
} // namespace Kratos::Testing |