From 76b74acdf930735e9eb2ae7ce09ce446ab25e13b Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Thu, 21 Nov 2024 18:39:25 +0100 Subject: [PATCH 1/3] Add warning when disabled mechanism is used --- .../solidmechanics/spring/MeshSpringForceField.inl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl index b36565e01c9..0235f65f28a 100644 --- a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl +++ b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl @@ -102,7 +102,15 @@ void MeshSpringForceField::addSpring(std::set void MeshSpringForceField::init() { + if(this->d_springsIndices[0].getValue().size() || this->d_springsIndices[1].getValue().size()) + { + msg_warning(this) << "Setting springs of MeshSpringForcefield through datas indices1 and indices2 is disabled since v24.12. The inputed indices will be overriden by the mesh."; + } + SpringForceField::clear(); + + + if(!(mstate1) || !(mstate2)) mstate2 = mstate1 = dynamic_cast *>(this->getContext()->getMechanicalState()); From 19942b507e69043787dfb885fc77f5517cc81521 Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Thu, 21 Nov 2024 18:40:11 +0100 Subject: [PATCH 2/3] remove unnecessary new lines --- .../component/solidmechanics/spring/MeshSpringForceField.inl | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl index 0235f65f28a..21bd77e6d98 100644 --- a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl +++ b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl @@ -109,8 +109,6 @@ void MeshSpringForceField::init() SpringForceField::clear(); - - if(!(mstate1) || !(mstate2)) mstate2 = mstate1 = dynamic_cast *>(this->getContext()->getMechanicalState()); From 4598a35efdb39e275d27c907eb1e9af1ee9bfaa0 Mon Sep 17 00:00:00 2001 From: Paul Baksic <30337881+bakpaul@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:38:05 +0100 Subject: [PATCH 3/3] Update Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl Co-authored-by: Hugo --- .../component/solidmechanics/spring/MeshSpringForceField.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl index 21bd77e6d98..b99fa7bc3dc 100644 --- a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl +++ b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl @@ -104,7 +104,7 @@ void MeshSpringForceField::init() { if(this->d_springsIndices[0].getValue().size() || this->d_springsIndices[1].getValue().size()) { - msg_warning(this) << "Setting springs of MeshSpringForcefield through datas indices1 and indices2 is disabled since v24.12. The inputed indices will be overriden by the mesh."; + msg_warning(this) << "Setting springs of MeshSpringForcefield through datas \'indices1\' and \'indices2\' has been disabled since v24.12. The input indices will be overridden by the mesh."; } SpringForceField::clear();