-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11533 from KratosMultiphysics/core/entities-utili…
…ties-has-entity [FastPR][Core] Adding HasPrototypeEntity to EntityIdentifier
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
kratos/tests/cpp_tests/utilities/test_entities_utilities.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,35 @@ | ||
// | / | | ||
// ' / __| _` | __| _ \ __| | ||
// . \ | ( | | ( |\__ ` | ||
// _|\_\_| \__,_|\__|\___/ ____/ | ||
// Multi-Physics | ||
// | ||
// License: BSD License | ||
// Kratos default license: kratos/license.txt | ||
// | ||
// Main authors: Ruben Zorrilla | ||
// | ||
// | ||
|
||
// Project includes | ||
#include "testing/testing.h" | ||
#include "containers/model.h" | ||
#include "includes/expect.h" | ||
#include "utilities/entities_utilities.h" | ||
|
||
namespace Kratos::Testing | ||
{ | ||
|
||
KRATOS_TEST_CASE_IN_SUITE(EntityIdentifierHasPrototype, KratosCoreFastSuite) | ||
{ | ||
Model model; | ||
auto& r_model_part = model.CreateModelPart("MainModelPart"); | ||
r_model_part.CreateNewNode(1, 0.0, 0.0, 0.0); | ||
r_model_part.CreateNewNode(2, 1.0, 0.0, 0.0); | ||
r_model_part.CreateNewNode(3, 0.0, 1.0, 0.0); | ||
auto p_tri_geom = r_model_part.CreateNewGeometry("Triangle2D3", 1, {{1, 2, 3}}); | ||
auto entity_identifier = EntitiesUtilities::EntitityIdentifier<Element>("Element2D3N"); | ||
KRATOS_EXPECT_TRUE(entity_identifier.HasPrototypeEntity(*p_tri_geom)); | ||
} | ||
|
||
} // namespace Kratos::Testing. |
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
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