From e0b14ebb06f19f932363f23631a0a776173ee217 Mon Sep 17 00:00:00 2001 From: Daniel Diez Date: Thu, 9 May 2024 11:08:14 +0200 Subject: [PATCH] [Core] Fix condition creation in sub model part (#12364) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix condition creation in sub model part * Fix spacing --------- Co-authored-by: Daniel Diez Co-authored-by: Vicente Mataix Ferrándiz --- kratos/sources/model_part.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kratos/sources/model_part.cpp b/kratos/sources/model_part.cpp index b068ff42cd0c..020a997c1284 100644 --- a/kratos/sources/model_part.cpp +++ b/kratos/sources/model_part.cpp @@ -1514,6 +1514,13 @@ ModelPart::ConditionType::Pointer ModelPart::CreateNewCondition(std::string Cond ModelPart::PropertiesType::Pointer pProperties, ModelPart::IndexType ThisIndex) { KRATOS_TRY + + if (IsSubModelPart()) { + ConditionType::Pointer p_new_condition = mpParentModelPart->CreateNewCondition(ConditionName, Id, ConditionNodeIds, pProperties, ThisIndex); + GetMesh(ThisIndex).AddCondition(p_new_condition); + return p_new_condition; + } + Geometry< Node >::PointsArrayType pConditionNodes; for (unsigned int i = 0; i < ConditionNodeIds.size(); i++)