feat(cpp-object-oriented-modular-refactoring): step 19 - boundary-condition-policy
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "fesa/elements/element.h"
|
||||
#include "fesa/elements/element_definition.h"
|
||||
#include "fesa/io/abaqus/input_reader.h"
|
||||
#include "fesa/math/vector3.h"
|
||||
@@ -292,12 +293,15 @@ TEST(InpDomainMapping, MapsEverySupportedKeywordAndLegacyDeck) {
|
||||
EXPECT_DOUBLE_EQ(step.TimePeriod(), 1.5);
|
||||
EXPECT_DOUBLE_EQ(step.MinimumIncrement(), 0.01);
|
||||
EXPECT_DOUBLE_EQ(step.MaximumIncrement(), 1.5);
|
||||
ASSERT_EQ(step.Boundaries().size(), 2U);
|
||||
EXPECT_EQ(step.Boundaries()[0].target, "rootassembly");
|
||||
EXPECT_EQ(step.Boundaries()[0].first_dof, 1);
|
||||
EXPECT_DOUBLE_EQ(step.Boundaries()[0].value, 0.125);
|
||||
EXPECT_EQ(step.Boundaries()[1].last_dof, 2);
|
||||
EXPECT_DOUBLE_EQ(step.Boundaries()[1].value, 0.0);
|
||||
ASSERT_EQ(step.PrescribedDisplacements().Size(), 2U);
|
||||
EXPECT_EQ(step.PrescribedDisplacements()[0U].Target().target_name_or_label,
|
||||
"rootassembly");
|
||||
EXPECT_EQ(step.PrescribedDisplacements()[0U].Component(),
|
||||
fesa::DofComponent::kUx);
|
||||
EXPECT_DOUBLE_EQ(step.PrescribedDisplacements()[0U].PrescribedValue(), 0.125);
|
||||
EXPECT_EQ(step.PrescribedDisplacements()[1U].Component(),
|
||||
fesa::DofComponent::kUy);
|
||||
EXPECT_DOUBLE_EQ(step.PrescribedDisplacements()[1U].PrescribedValue(), 0.0);
|
||||
ASSERT_EQ(step.ConcentratedLoads().Size(), 1U);
|
||||
EXPECT_EQ(step.ConcentratedLoads()[0U].Target().target_name_or_label,
|
||||
"RootAssembly");
|
||||
@@ -411,7 +415,11 @@ OnlySecond, 2, 5.
|
||||
(std::vector<fesa::EntityIndex>{1U}));
|
||||
|
||||
ASSERT_EQ(domain.Steps().Size(), 1U);
|
||||
EXPECT_EQ(domain.Steps()[0].Boundaries()[0].target, "OnlySecond");
|
||||
EXPECT_EQ(domain.Steps()[0]
|
||||
.PrescribedDisplacements()[0U]
|
||||
.Target()
|
||||
.target_name_or_label,
|
||||
"OnlySecond");
|
||||
EXPECT_EQ(
|
||||
domain.Steps()[0].ConcentratedLoads()[0U].Target().target_name_or_label,
|
||||
"OnlySecond");
|
||||
@@ -421,7 +429,12 @@ OnlySecond, 2, 5.
|
||||
ReplaceOnce(ReplaceOnce(MinimalDeck(), "Root, 1, 6", "1, 1, 6"),
|
||||
"Tip, 2, -1.", "2, 2, -1."));
|
||||
ASSERT_TRUE(direct.HasValue());
|
||||
EXPECT_EQ(direct.Value().Steps()[0].Boundaries()[0].target, "1");
|
||||
EXPECT_EQ(direct.Value()
|
||||
.Steps()[0]
|
||||
.PrescribedDisplacements()[0U]
|
||||
.Target()
|
||||
.target_name_or_label,
|
||||
"1");
|
||||
EXPECT_EQ(direct.Value()
|
||||
.Steps()[0]
|
||||
.ConcentratedLoads()[0U]
|
||||
@@ -551,8 +564,8 @@ TEST(InpDomainMapping, NoOpAllowlistWarnsWithoutSemanticEffect) {
|
||||
EXPECT_EQ(with_no_ops.Value().ElementSets().size(),
|
||||
plain.Value().ElementSets().size());
|
||||
EXPECT_EQ(with_no_ops.Value().Steps().Size(), plain.Value().Steps().Size());
|
||||
EXPECT_EQ(with_no_ops.Value().Steps()[0].Boundaries().size(),
|
||||
plain.Value().Steps()[0].Boundaries().size());
|
||||
EXPECT_EQ(with_no_ops.Value().Steps()[0].BoundaryConditions().size(),
|
||||
plain.Value().Steps()[0].BoundaryConditions().size());
|
||||
EXPECT_EQ(with_no_ops.Value().Steps()[0].Loads().size(),
|
||||
plain.Value().Steps()[0].Loads().size());
|
||||
}
|
||||
@@ -613,8 +626,9 @@ TEST(InpDomainMapping, MapsS4AndS4rThroughOneMitc4Identity) {
|
||||
(std::array<double, 3>{0.0, 1.0, 0.0}));
|
||||
|
||||
ASSERT_EQ(domain.Steps().Size(), 1U);
|
||||
ASSERT_EQ(domain.Steps()[0].Boundaries().size(), 1U);
|
||||
EXPECT_EQ(domain.Steps()[0].Boundaries()[0].last_dof, 6);
|
||||
ASSERT_EQ(domain.Steps()[0].PrescribedDisplacements().Size(), 6U);
|
||||
EXPECT_EQ(domain.Steps()[0].PrescribedDisplacements()[5U].Component(),
|
||||
fesa::DofComponent::kUrz);
|
||||
ASSERT_EQ(domain.Steps()[0].ConcentratedLoads().Size(), 1U);
|
||||
EXPECT_DOUBLE_EQ(
|
||||
domain.Steps()[0].ConcentratedLoads()[0U].GlobalComponents()[5U], 1.0);
|
||||
|
||||
Reference in New Issue
Block a user