KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.02k stars 245 forks source link

[Core] Fix condition creation in sub model part #12364

Closed ddiezrod closed 4 months ago

ddiezrod commented 5 months ago

📝 Description I have encountered a problem when trying to create a new condition with a vector of nodes. The current implementation assumes that the nodes belong to the model part, but this is not necessarily the case if it is a submodel part. For some reason, this was fixed for the elements but not for the conditions. I think it makes sense to do the same for both functions (see https://github.com/KratosMultiphysics/Kratos/blob/f6e7a3c2c529a6a8c9e782d628fe412633771220/kratos/sources/model_part.cpp#L980 )

ddiezrod commented 5 months ago

Just to be clear, the problem arises when we are in line https://github.com/KratosMultiphysics/Kratos/blob/f6e7a3c2c529a6a8c9e782d628fe412633771220/kratos/sources/model_part.cpp#L1521

and we try to do a pGetNode. If it is a submodelpart, it might not have the node.