Skip to content

Commit

Permalink
Processed Richard's review comments
Browse files Browse the repository at this point in the history
- Split a unit test case to be consistent with other test cases.
- Be more explicit about the top and bottom sides of the line interface geometry in the documentation.
  • Loading branch information
avdg81 committed Sep 19, 2024
1 parent 81ea340 commit fb87db5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Similarly, the 3+3 line interface geometry has the following node numbering for

One thing to note, is that this line interface geometry does not implement functions from the Geometry base class which are related to the integration scheme. That is because most of the time, interface geometries are used with a Lobatto integration scheme, which is not supported by the Geometry base class.

Any line interface geometry has two edges. The first edge coincides with the first (i.e. bottom) side of the geometry. The first edge's nodes are identical to the nodes at the first edge. For the 3+3 line interface geometry this means the list of node IDs equals [1, 2, 3]. The second edge references the nodes of the second (i.e. top) side of the line interface geometry. However, this edge traverses the second side in opposite direction. This implies that the end nodes will be swapped and any high-order nodes are reversed. For instance, for the 3+3 line interface geometry the second edge's nodes are ordered as follows: [5, 4, 6];
Any line interface geometry has two edges. The first edge coincides with the first side (i.e. bottom side in the above figures) of the geometry. The first edge's nodes are identical to the nodes at the first edge. For the 3+3 line interface geometry this means the list of node IDs equals [1, 2, 3]. The second edge references the nodes of the second side (i.e. top side in the above figures) of the line interface geometry. However, this edge traverses the second side in opposite direction. This implies that the end nodes will be swapped and any high-order nodes are reversed. For instance, for the 3+3 line interface geometry the second edge's nodes are ordered as follows: [5, 4, 6];
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void AssertNodeIdsOfGeometry(const Geometry<Node>::Pointer& rGeometryPtr,
const std::vector<std::size_t>& rExpectedNodeIds)
{
KRATOS_EXPECT_NE(rGeometryPtr, nullptr);

auto node_ids = std::vector<std::size_t>{};
std::transform(rGeometryPtr->begin(), rGeometryPtr->end(), std::back_inserter(node_ids),
[](const auto& rNode) { return rNode.Id(); });
Expand Down Expand Up @@ -374,20 +374,28 @@ KRATOS_TEST_CASE_IN_SUITE(GetLocalCoordinatesOfAllNodesOfThreePlusThreeNodedLine
KRATOS_EXPECT_MATRIX_NEAR(result, expected_result, 1e-6)
}

KRATOS_TEST_CASE_IN_SUITE(AnyLineInterfaceGeometryHasTwoEdgesWithOppositeOrientations, KratosGeoMechanicsFastSuiteWithoutKernel)
KRATOS_TEST_CASE_IN_SUITE(TwoPlusTwoLineInterfaceGeometryHasTwoEdgesWithOppositeOrientations,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
const auto geometry = CreateTwoPlusTwoNoded2DLineInterfaceGeometry();

const auto edges = geometry.GenerateEdges();

KRATOS_EXPECT_EQ(edges.size(), 2);
AssertNodeIdsOfGeometry(edges(0), {1, 2});
AssertNodeIdsOfGeometry(edges(1), {4, 3});
}

KRATOS_TEST_CASE_IN_SUITE(ThreePlusThreeLineInterfaceGeometryHasTwoEdgesWithOppositeOrientations,
KratosGeoMechanicsFastSuiteWithoutKernel)
{
const auto two_plus_two_noded_geometry = CreateTwoPlusTwoNoded2DLineInterfaceGeometry();
const auto three_plus_three_noded_geometry = CreateThreePlusThreeNoded2DLineInterfaceGeometry();
const auto geometry = CreateThreePlusThreeNoded2DLineInterfaceGeometry();

const auto edges_of_2_plus_2_geometry = two_plus_two_noded_geometry.GenerateEdges();
const auto edges_of_3_plus_3_geometry = three_plus_three_noded_geometry.GenerateEdges();
const auto edges = geometry.GenerateEdges();

KRATOS_EXPECT_EQ(edges_of_2_plus_2_geometry.size(), 2);
AssertNodeIdsOfGeometry(edges_of_2_plus_2_geometry(0), {1, 2});
AssertNodeIdsOfGeometry(edges_of_2_plus_2_geometry(1), {4, 3});
KRATOS_EXPECT_EQ(edges_of_3_plus_3_geometry.size(), 2);
AssertNodeIdsOfGeometry(edges_of_3_plus_3_geometry(0), {1, 2, 3});
AssertNodeIdsOfGeometry(edges_of_3_plus_3_geometry(1), {5, 4, 6});
KRATOS_EXPECT_EQ(edges.size(), 2);
AssertNodeIdsOfGeometry(edges(0), {1, 2, 3});
AssertNodeIdsOfGeometry(edges(1), {5, 4, 6});
}

KRATOS_TEST_CASE_IN_SUITE(InterfaceGeometry_Throws_WhenCallingArea, KratosGeoMechanicsFastSuiteWithoutKernel)
Expand Down

0 comments on commit fb87db5

Please sign in to comment.