Skip to content

Commit

Permalink
Processing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaasse committed Jul 18, 2024
1 parent 8d97f3b commit 8464a53
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ void ResetDisplacementProcess::CheckRetrievedElementData(const std::vector<Const
const Element& rElement)
{
KRATOS_ERROR_IF(rConstitutiveLaws.empty())
<< "The constitutive laws on the integration points could not be retrieved for element "
<< rElement.GetId() << std::endl;
<< "The constitutive laws on the integration points could not be retrieved for element "
<< rElement.GetId() << std::endl;
KRATOS_ERROR_IF(rStressesOnIntegrationPoints.empty())
<< "The stress vectors on the integration points could not be retrieved for element "
<< rElement.GetId() << std::endl;
KRATOS_ERROR_IF(rStressesOnIntegrationPoints.size() != rConstitutiveLaws.size())
<< "Number of retrieved stress vectors does not match the number of constitutive laws for element "
<< "Number of retrieved stress vectors does not match the number of constitutive laws for "
"element "
<< rElement.GetId() << std::endl;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class Element;
class KRATOS_API(GEO_MECHANICS_APPLICATION) ResetDisplacementProcess : public Process
{
public:
KRATOS_CLASS_POINTER_DEFINITION(ResetDisplacementProcess);
ResetDisplacementProcess(ModelPart& rModelPart, const Parameters&);
KRATOS_CLASS_POINTER_DEFINITION(ResetDisplacementProcess);
ResetDisplacementProcess(ModelPart& rModelPart, const Parameters&);
~ResetDisplacementProcess() override = default;

ResetDisplacementProcess(const ResetDisplacementProcess&) = delete;
ResetDisplacementProcess& operator=(const ResetDisplacementProcess&) = delete;
ResetDisplacementProcess(const ResetDisplacementProcess&) = delete;
ResetDisplacementProcess& operator=(const ResetDisplacementProcess&) = delete;

void ExecuteInitialize() override;
int Check() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ void AddCustomProcessesToPython(pybind11::module& m)
m, "ApplyCPhiReductionProcess")
.def(py::init<ModelPart&, const Parameters>());

py::class_<CalculateIncrementalDisplacementProcess, CalculateIncrementalDisplacementProcess::Pointer, Process>
(m, "CalculateIncrementalDisplacementProcess")
py::class_<CalculateIncrementalDisplacementProcess, CalculateIncrementalDisplacementProcess::Pointer, Process>(
m, "CalculateIncrementalDisplacementProcess")
.def(py::init<ModelPart&, const Parameters&>());

py::class_<ResetDisplacementProcess, ResetDisplacementProcess::Pointer, Process>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ KRATOS_TEST_CASE_IN_SUITE(ResetDisplacementProcess_SetsInitialStressOfConstituti
Vector initial_stress_vector(4);
initial_stress_vector <<= 1.0, 2.0, 3.0, 4.0;

constexpr auto number_of_integration_points = 3;
dynamic_cast<StubElement&>(model_part.Elements()[1]).mIntegrationPointVectors =
std::vector<Vector>(3, initial_stress_vector);
std::vector<Vector>(number_of_integration_points, initial_stress_vector);

ResetDisplacementProcess reset_displacement_process(model_part, {});
reset_displacement_process.ExecuteInitialize();
Expand All @@ -88,7 +89,7 @@ KRATOS_TEST_CASE_IN_SUITE(ResetDisplacementProcess_SetsInitialStressOfConstituti
model_part.Elements()[1].CalculateOnIntegrationPoints(CONSTITUTIVE_LAW, constitutive_laws,
model_part.GetProcessInfo());

KRATOS_EXPECT_EQ(constitutive_laws.size(), 3);
KRATOS_EXPECT_EQ(constitutive_laws.size(), number_of_integration_points);
for (const auto& constitutive_law : constitutive_laws) {
KRATOS_EXPECT_VECTOR_NEAR(constitutive_law->GetInitialState().GetInitialStressVector(),
initial_stress_vector, 1e-12)
Expand Down

0 comments on commit 8464a53

Please sign in to comment.