diff --git a/Sofa/Component/Collision/Response/Contact/CMakeLists.txt b/Sofa/Component/Collision/Response/Contact/CMakeLists.txt
index 3b6e2a38162..9ea5c096b4d 100644
--- a/Sofa/Component/Collision/Response/Contact/CMakeLists.txt
+++ b/Sofa/Component/Collision/Response/Contact/CMakeLists.txt
@@ -6,6 +6,10 @@ set(SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR "src/sofa/component/collisi
set(HEADER_FILES
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/config.h.in
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/init.h
+ ${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/AugmentedLagrangianResponse.h
+ ${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/AugmentedLagrangianResponse.inl
+ ${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/BaseUnilateralContactResponse.h
+ ${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/BaseUnilateralContactResponse.inl
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/BarycentricPenalityContact.h
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/BarycentricPenalityContact.inl
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/BarycentricStickContact.h
@@ -26,6 +30,7 @@ set(HEADER_FILES
set(SOURCE_FILES
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/init.cpp
+ ${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/AugmentedLagrangianResponse.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/BarycentricPenalityContact.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/BarycentricStickContact.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/CollisionResponse.cpp
@@ -36,6 +41,7 @@ set(SOURCE_FILES
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/RayContact.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/RuleBasedContactManager.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/StickContactConstraint.cpp
+ ${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/TetrahedronAugmentedLagrangianContact.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/TetrahedronBarycentricPenalityContact.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/TetrahedronFrictionContact.cpp
${SOFACOMPONENTCOLLISIONRESPONSECONTACT_SOURCE_DIR}/TetrahedronRayContact.cpp
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.cpp b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.cpp
new file mode 100644
index 00000000000..18a25ba3871
--- /dev/null
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.cpp
@@ -0,0 +1,85 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Authors: The SOFA Team and external contributors (see Authors.txt) *
+* *
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+#include
+#include
+#include
+
+#include
+#include
+
+namespace sofa::component::collision::response::contact
+{
+
+using namespace defaulttype;
+using namespace sofa::helper;
+using namespace sofa::component::collision::geometry;
+using simulation::Node;
+
+Creator, PointCollisionModel> > PointPointAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, SphereCollisionModel> > LineSphereAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, PointCollisionModel> > LinePointAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, LineCollisionModel> > LineLineAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, SphereCollisionModel> > TriangleSphereAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, PointCollisionModel> > TrianglePointAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, LineCollisionModel> > TriangleLineAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, TriangleCollisionModel> > TriangleTriangleAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, SphereCollisionModel> > SphereSphereAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, PointCollisionModel> > SpherePointAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator > RigidSphereRigidSphereAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, RigidSphereModel> > SphereRigidSphereAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, RigidSphereModel> > LineRigidSphereAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator, RigidSphereModel> > TriangleRigidSphereAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+Creator> > RigidSpherePointAugmentedLagrangianResponseClass("AugmentedLagrangianResponseConstraint",true);
+
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, SphereCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, LineCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, SphereCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, LineCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, TriangleCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, SphereCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, RigidSphereModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, RigidSphereModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, RigidSphereModel,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse,constraint::lagrangian::model::AugmentedLagrangianContactParameters>;
+
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, PointCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, SphereCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, PointCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, LineCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, SphereCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, PointCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, LineCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, TriangleCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, SphereCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, PointCollisionModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, RigidSphereModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, RigidSphereModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse, RigidSphereModel>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API AugmentedLagrangianResponse>;
+
+} //namespace sofa::component::collision::response::contact
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.h b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.h
new file mode 100644
index 00000000000..052c4d1133f
--- /dev/null
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.h
@@ -0,0 +1,65 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Authors: The SOFA Team and external contributors (see Authors.txt) *
+* *
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+#pragma once
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+namespace sofa::component::collision::response::contact
+{
+template
+class AugmentedLagrangianResponse : public BaseUnilateralContactResponse
+{
+public:
+ SOFA_CLASS(SOFA_TEMPLATE3(AugmentedLagrangianResponse, TCollisionModel1, TCollisionModel2, ResponseDataTypes), SOFA_TEMPLATE4(BaseUnilateralContactResponse, TCollisionModel1, TCollisionModel2,constraint::lagrangian::model::AugmentedLagrangianContactParameters, ResponseDataTypes));
+
+ typedef typename Inherit1::DataTypes1 DataTypes1;
+ typedef typename Inherit1::DataTypes2 DataTypes2;
+ typedef typename Inherit1::CollisionModel1 CollisionModel1;
+ typedef typename Inherit1::CollisionModel2 CollisionModel2;
+ typedef typename Inherit1::Intersection Intersection;
+
+ typedef core::behavior::MechanicalState MechanicalState1;
+ typedef core::behavior::MechanicalState MechanicalState2;
+
+ Data d_mu; ///< friction parameter
+ Data d_epsilon; ///< Penalty parameter
+
+ AugmentedLagrangianResponse();
+ AugmentedLagrangianResponse(CollisionModel1* model1, CollisionModel2* model2, Intersection* intersectionMethod);
+
+ virtual ~AugmentedLagrangianResponse() = default;
+
+ virtual constraint::lagrangian::model::AugmentedLagrangianContactParameters getParameterFromDatas() const override;
+ virtual void setupConstraint(MechanicalState1 *,MechanicalState2 *) override;
+
+};
+
+} // namespace sofa::component::collision::response::contact
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.inl b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.inl
new file mode 100644
index 00000000000..7c94ccfd7a0
--- /dev/null
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/AugmentedLagrangianResponse.inl
@@ -0,0 +1,65 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Authors: The SOFA Team and external contributors (see Authors.txt) *
+* *
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+#pragma once
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace sofa::component::collision::response::contact
+{
+
+template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
+AugmentedLagrangianResponse::AugmentedLagrangianResponse()
+ : AugmentedLagrangianResponse(nullptr, nullptr, nullptr)
+{
+}
+
+
+template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
+AugmentedLagrangianResponse::AugmentedLagrangianResponse(CollisionModel1* model1, CollisionModel2* model2, Intersection* intersectionMethod)
+ : BaseUnilateralContactResponse(model1,model2,intersectionMethod)
+ , d_mu (initData(&d_mu, 0.0, "mu", "friction coefficient (0 for frictionless contacts)"))
+ , d_epsilon (initData(&d_epsilon, 0.0, "epsilon", "Penalty parameter"))
+{
+
+}
+
+template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
+constraint::lagrangian::model::AugmentedLagrangianContactParameters AugmentedLagrangianResponse::getParameterFromDatas() const
+{
+ return {d_mu.getValue(),d_epsilon.getValue()};
+}
+
+
+template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
+void AugmentedLagrangianResponse::setupConstraint(MechanicalState1 * mmodel1,MechanicalState2 * mmodel2)
+{
+ this->m_constraint = sofa::core::objectmodel::New >(mmodel1, mmodel2);
+}
+
+
+} //namespace sofa::component::collision::response::contact
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/BaseUnilateralContactResponse.h b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/BaseUnilateralContactResponse.h
new file mode 100644
index 00000000000..272201d37b5
--- /dev/null
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/BaseUnilateralContactResponse.h
@@ -0,0 +1,101 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Authors: The SOFA Team and external contributors (see Authors.txt) *
+* *
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+#pragma once
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+namespace sofa::component::collision::response::contact
+{
+template
+class BaseUnilateralContactResponse : public core::collision::Contact, public ContactIdentifier
+{
+public:
+ SOFA_CLASS(SOFA_TEMPLATE4(BaseUnilateralContactResponse, TCollisionModel1, TCollisionModel2,ConstraintParameters, ResponseDataTypes), core::collision::Contact);
+ typedef TCollisionModel1 CollisionModel1;
+ typedef TCollisionModel2 CollisionModel2;
+ typedef core::collision::Intersection Intersection;
+ typedef typename TCollisionModel1::DataTypes::CPos TVec1;
+ typedef typename TCollisionModel1::DataTypes::CPos TVec2;
+ typedef sofa::defaulttype::StdVectorTypes DataTypes1;
+ typedef sofa::defaulttype::StdVectorTypes DataTypes2;
+
+ typedef core::behavior::MechanicalState MechanicalState1;
+ typedef core::behavior::MechanicalState MechanicalState2;
+ typedef typename CollisionModel1::Element CollisionElement1;
+ typedef typename CollisionModel2::Element CollisionElement2;
+ typedef core::collision::DetectionOutputVector OutputVector;
+ typedef core::collision::TDetectionOutputVector TOutputVector;
+
+protected:
+ CollisionModel1* model1;
+ CollisionModel2* model2;
+ Intersection* intersectionMethod;
+ bool selfCollision; ///< true if model1==model2 (in this case, only mapper1 is used)
+ mapper::ContactMapper mapper1;
+ mapper::ContactMapper mapper2;
+
+ typename constraint::lagrangian::model::BaseContactLagrangianConstraint::SPtr m_constraint;
+ core::objectmodel::BaseContext* parent;
+
+ SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_RESPONSE_CONTACT()
+ sofa::core::objectmodel::RenamedData mu;
+
+ SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_RESPONSE_CONTACT()
+ sofa::core::objectmodel::RenamedData tol;
+
+ Data d_tol; ///< tolerance for the constraints resolution (0 for default tolerance)
+ std::vector< sofa::core::collision::DetectionOutput* > contacts;
+ std::vector< std::pair< std::pair, double > > mappedContacts;
+
+ virtual void activateMappers();
+
+ void setInteractionTags(MechanicalState1* mstate1, MechanicalState2* mstate2);
+
+ BaseUnilateralContactResponse();
+ BaseUnilateralContactResponse(CollisionModel1* model1, CollisionModel2* model2, Intersection* intersectionMethod);
+
+ ~BaseUnilateralContactResponse() override;
+public:
+ void cleanup() override;
+
+ std::pair getCollisionModels() override { return std::make_pair(model1,model2); }
+
+ void setDetectionOutputs(OutputVector* outputs) override;
+
+ void createResponse(core::objectmodel::BaseContext* group) override;
+
+ void removeResponse() override;
+
+ virtual ConstraintParameters getParameterFromDatas() const = 0;
+ virtual void setupConstraint(MechanicalState1 *,MechanicalState2 *) = 0;
+};
+
+} // namespace sofa::component::collision::response::contact
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/BaseUnilateralContactResponse.inl b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/BaseUnilateralContactResponse.inl
new file mode 100644
index 00000000000..31b2199f8c0
--- /dev/null
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/BaseUnilateralContactResponse.inl
@@ -0,0 +1,271 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Authors: The SOFA Team and external contributors (see Authors.txt) *
+* *
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+#pragma once
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace sofa::component::collision::response::contact
+{
+
+template
+BaseUnilateralContactResponse::BaseUnilateralContactResponse()
+ : BaseUnilateralContactResponse(nullptr, nullptr, nullptr)
+{
+}
+
+
+template
+BaseUnilateralContactResponse::BaseUnilateralContactResponse(CollisionModel1* model1, CollisionModel2* model2, Intersection* intersectionMethod)
+ : model1(model1)
+ , model2(model2)
+ , intersectionMethod(intersectionMethod)
+ , m_constraint(nullptr)
+ , parent(nullptr)
+ , d_tol (initData(&d_tol, 0.0, "tol", "tolerance for the constraints resolution (0 for default tolerance)"))
+{
+ selfCollision = ((core::CollisionModel*)model1 == (core::CollisionModel*)model2);
+ mapper1.setCollisionModel(model1);
+ if (!selfCollision) mapper2.setCollisionModel(model2);
+ contacts.clear();
+ mappedContacts.clear();
+
+ tol.setOriginalData(&d_tol);
+
+}
+
+template
+BaseUnilateralContactResponse::~BaseUnilateralContactResponse()
+{
+}
+
+template
+void BaseUnilateralContactResponse::cleanup()
+{
+ if (m_constraint)
+ {
+ m_constraint->cleanup();
+
+ if (parent != nullptr)
+ parent->removeObject(m_constraint);
+
+ parent = nullptr;
+ m_constraint.reset();
+
+ mapper1.cleanup();
+
+ if (!selfCollision)
+ mapper2.cleanup();
+ }
+
+ contacts.clear();
+ mappedContacts.clear();
+}
+
+
+template
+void BaseUnilateralContactResponse::setDetectionOutputs(OutputVector* o)
+{
+ TOutputVector& outputs = *static_cast(o);
+ // We need to remove duplicate contacts
+ constexpr double minDist2 = 0.00000001f;
+
+ contacts.clear();
+
+ if (model1->getContactStiffness(0) == 0 || model2->getContactStiffness(0) == 0)
+ {
+ msg_error() << "Disabled BaseUnilateralContactResponse with " << (outputs.size()) << " collision points.";
+ return;
+ }
+
+ contacts.reserve(outputs.size());
+
+ const int SIZE = outputs.size();
+
+ // the following procedure cancels the duplicated detection outputs
+ for (int cpt=0; cptpoint[0]-p->point[0]).norm2()+(detectionOutput->point[1]-p->point[1]).norm2() < minDist2)
+ found = true;
+ }
+
+ if (!found)
+ contacts.push_back(detectionOutput);
+ }
+
+ // DUPLICATED CONTACTS FOUND
+ msg_info_when(contacts.size()
+void BaseUnilateralContactResponse::activateMappers()
+{
+ if (!m_constraint)
+ {
+ // Get the mechanical model from mapper1 to fill the constraint vector
+ MechanicalState1* mmodel1 = mapper1.createMapping(getName().c_str());
+ // Get the mechanical model from mapper2 to fill the constraints vector
+ MechanicalState2* mmodel2;
+ if (selfCollision)
+ {
+ mmodel2 = mmodel1;
+ }
+ else
+ {
+ mmodel2 = mapper2.createMapping(getName().c_str());
+ }
+ setupConstraint(mmodel1,mmodel2);
+ m_constraint->setName( getName() );
+ setInteractionTags(mmodel1, mmodel2);
+ m_constraint->setCustomTolerance(d_tol.getValue() );
+ }
+
+ int size = contacts.size();
+ m_constraint->clear(size);
+ if (selfCollision)
+ mapper1.resize(2*size);
+ else
+ {
+ mapper1.resize(size);
+ mapper2.resize(size);
+ }
+ int i = 0;
+ const double d0 = intersectionMethod->getContactDistance() + model1->getProximity() + model2->getProximity(); // - 0.001;
+
+ mappedContacts.resize(contacts.size());
+ for (std::vector::const_iterator it = contacts.begin(); it!=contacts.end(); it++, i++)
+ {
+ sofa::core::collision::DetectionOutput* o = *it;
+ CollisionElement1 elem1(o->elem.first);
+ CollisionElement2 elem2(o->elem.second);
+ int index1 = elem1.getIndex();
+ int index2 = elem2.getIndex();
+
+ typename DataTypes1::Real r1 = 0.;
+ typename DataTypes2::Real r2 = 0.;
+
+ // Create mapping for first point
+ index1 = mapper1.addPointB(o->point[0], index1, r1);
+ // Create mapping for second point
+ if (selfCollision)
+ {
+ index2 = mapper1.addPointB(o->point[1], index2, r2);
+ }
+ else
+ {
+ index2 = mapper2.addPointB(o->point[1], index2, r2);
+ }
+ const double distance = d0 + r1 + r2;
+
+ mappedContacts[i].first.first = index1;
+ mappedContacts[i].first.second = index2;
+ mappedContacts[i].second = distance;
+ }
+
+ // Update mappings
+ mapper1.update();
+ mapper1.updateXfree();
+ if (!selfCollision) mapper2.update();
+ if (!selfCollision) mapper2.updateXfree();
+}
+
+template
+void BaseUnilateralContactResponse::createResponse(core::objectmodel::BaseContext* group)
+{
+
+ activateMappers();
+
+ if (m_constraint)
+ {
+ int i=0;
+ for (std::vector::const_iterator it = contacts.begin(); it!=contacts.end(); it++, i++)
+ {
+ const sofa::core::collision::DetectionOutput* o = *it;
+ const int index1 = mappedContacts[i].first.first;
+ const int index2 = mappedContacts[i].first.second;
+ const double distance = mappedContacts[i].second;
+
+ // Polynome de Cantor de NxN sur N bijectif f(x,y)=((x+y)^2+3x+y)/2
+ const long index = cantorPolynomia(o->id /*cantorPolynomia(index1, index2)*/,id);
+
+ const ConstraintParameters params = getParameterFromDatas();
+
+ // Add contact in unilateral constraint
+ m_constraint->addContact(params, o->normal, distance, index1, index2, index, o->id);
+ }
+
+ if (parent!=nullptr)
+ {
+ parent->removeObject(this);
+ parent->removeObject(m_constraint);
+ }
+
+ parent = group;
+ if (parent!=nullptr)
+ {
+ parent->addObject(this);
+ parent->addObject(m_constraint);
+ }
+ }
+}
+
+template
+void BaseUnilateralContactResponse::removeResponse()
+{
+ if (m_constraint)
+ {
+ mapper1.resize(0);
+ mapper2.resize(0);
+ if (parent!=nullptr)
+ {
+ parent->removeObject(this);
+ parent->removeObject(m_constraint);
+ }
+ parent = nullptr;
+ }
+}
+
+template
+void BaseUnilateralContactResponse::setInteractionTags(MechanicalState1* mstate1, MechanicalState2* mstate2)
+{
+ sofa::core::objectmodel::TagSet tagsm1 = mstate1->getTags();
+ sofa::core::objectmodel::TagSet tagsm2 = mstate2->getTags();
+ sofa::core::objectmodel::TagSet::iterator it;
+ for(it=tagsm1.begin(); it != tagsm1.end(); it++)
+ m_constraint->addTag(*it);
+ for(it=tagsm2.begin(); it!=tagsm2.end(); it++)
+ m_constraint->addTag(*it);
+}
+
+} //namespace sofa::component::collision::response::contact
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.cpp b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.cpp
index e405e4ff362..a3734fd4d83 100644
--- a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.cpp
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.cpp
@@ -19,8 +19,12 @@
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
+#include
+#include
+#include
#include
+
#include
#include
@@ -32,6 +36,7 @@ using namespace sofa::helper;
using namespace sofa::component::collision::geometry;
using simulation::Node;
+
Creator, PointCollisionModel> > PointPointFrictionContactClass("FrictionContactConstraint",true);
Creator, SphereCollisionModel> > LineSphereFrictionContactClass("FrictionContactConstraint",true);
Creator, PointCollisionModel> > LinePointFrictionContactClass("FrictionContactConstraint",true);
@@ -48,6 +53,23 @@ Creator, RigidSphereModel> > TriangleRigidSphereFrictionContactClass("FrictionContactConstraint",true);
Creator> > RigidSpherePointFrictionContactClass("FrictionContactConstraint",true);
+
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, SphereCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, LineCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, SphereCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, LineCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, TriangleCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, SphereCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, PointCollisionModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, RigidSphereModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, RigidSphereModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse, RigidSphereModel,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API BaseUnilateralContactResponse,constraint::lagrangian::model::UnilateralLagrangianContactParameters>;
+
template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API FrictionContact, PointCollisionModel>;
template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API FrictionContact, SphereCollisionModel>;
template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API FrictionContact, PointCollisionModel>;
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.h b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.h
index cebd6506a02..999831d9721 100644
--- a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.h
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.h
@@ -27,7 +27,7 @@
#include
#include
#include
-#include
+#include
#include
#include
@@ -35,65 +35,30 @@
namespace sofa::component::collision::response::contact
{
template
-class FrictionContact : public core::collision::Contact, public ContactIdentifier
+class FrictionContact : public BaseUnilateralContactResponse
{
-public:
- SOFA_CLASS(SOFA_TEMPLATE3(FrictionContact, TCollisionModel1, TCollisionModel2, ResponseDataTypes), core::collision::Contact);
- typedef TCollisionModel1 CollisionModel1;
- typedef TCollisionModel2 CollisionModel2;
- typedef core::collision::Intersection Intersection;
- typedef typename TCollisionModel1::DataTypes::CPos TVec1;
- typedef typename TCollisionModel1::DataTypes::CPos TVec2;
- typedef sofa::defaulttype::StdVectorTypes DataTypes1;
- typedef sofa::defaulttype::StdVectorTypes DataTypes2;
+ public:
+ SOFA_CLASS(SOFA_TEMPLATE3(FrictionContact, TCollisionModel1, TCollisionModel2, ResponseDataTypes), SOFA_TEMPLATE4(BaseUnilateralContactResponse, TCollisionModel1, TCollisionModel2,constraint::lagrangian::model::UnilateralLagrangianContactParameters, ResponseDataTypes));
+
+ typedef typename Inherit1::DataTypes1 DataTypes1;
+ typedef typename Inherit1::DataTypes2 DataTypes2;
+ typedef typename Inherit1::CollisionModel1 CollisionModel1;
+ typedef typename Inherit1::CollisionModel2 CollisionModel2;
+ typedef typename Inherit1::Intersection Intersection;
typedef core::behavior::MechanicalState MechanicalState1;
typedef core::behavior::MechanicalState MechanicalState2;
- typedef typename CollisionModel1::Element CollisionElement1;
- typedef typename CollisionModel2::Element CollisionElement2;
- typedef core::collision::DetectionOutputVector OutputVector;
- typedef core::collision::TDetectionOutputVector TOutputVector;
-
-protected:
- CollisionModel1* model1;
- CollisionModel2* model2;
- Intersection* intersectionMethod;
- bool selfCollision; ///< true if model1==model2 (in this case, only mapper1 is used)
- mapper::ContactMapper mapper1;
- mapper::ContactMapper mapper2;
-
- constraint::lagrangian::model::UnilateralLagrangianConstraint::SPtr m_constraint;
- core::objectmodel::BaseContext* parent;
-
- SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_RESPONSE_CONTACT()
- sofa::core::objectmodel::RenamedData mu;
-
- SOFA_ATTRIBUTE_DEPRECATED__RENAME_DATA_IN_COLLISION_RESPONSE_CONTACT()
- sofa::core::objectmodel::RenamedData tol;
- Data d_mu; ///< friction coefficient (0 for frictionless contacts)
- Data d_tol; ///< tolerance for the constraints resolution (0 for default tolerance)
- std::vector< sofa::core::collision::DetectionOutput* > contacts;
- std::vector< std::pair< std::pair, double > > mappedContacts;
-
- virtual void activateMappers();
-
- void setInteractionTags(MechanicalState1* mstate1, MechanicalState2* mstate2);
+ Data d_mu; ///< friction parameter
FrictionContact();
FrictionContact(CollisionModel1* model1, CollisionModel2* model2, Intersection* intersectionMethod);
- ~FrictionContact() override;
-public:
- void cleanup() override;
-
- std::pair getCollisionModels() override { return std::make_pair(model1,model2); }
-
- void setDetectionOutputs(OutputVector* outputs) override;
+ virtual ~FrictionContact() = default;
- void createResponse(core::objectmodel::BaseContext* group) override;
+ virtual constraint::lagrangian::model::UnilateralLagrangianContactParameters getParameterFromDatas() const override;
+ virtual void setupConstraint(MechanicalState1 *,MechanicalState2 *) override;
- void removeResponse() override;
};
} // namespace sofa::component::collision::response::contact
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.inl b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.inl
index a7fdd1fcce1..6ee9fe777ed 100644
--- a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.inl
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/FrictionContact.inl
@@ -41,235 +41,24 @@ FrictionContact::FrictionCo
template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
FrictionContact::FrictionContact(CollisionModel1* model1, CollisionModel2* model2, Intersection* intersectionMethod)
- : model1(model1)
- , model2(model2)
- , intersectionMethod(intersectionMethod)
- , m_constraint(nullptr)
- , parent(nullptr)
- , d_mu (initData(&d_mu, 0.8, "mu", "friction coefficient (0 for frictionless contacts)"))
- , d_tol (initData(&d_tol, 0.0, "tol", "tolerance for the constraints resolution (0 for default tolerance)"))
+ : BaseUnilateralContactResponse(model1,model2,intersectionMethod)
+ , d_mu (initData(&d_mu, 0.8, "mu", "friction coefficient (0 for frictionless contacts)"))
{
- selfCollision = ((core::CollisionModel*)model1 == (core::CollisionModel*)model2);
- mapper1.setCollisionModel(model1);
- if (!selfCollision) mapper2.setCollisionModel(model2);
- contacts.clear();
- mappedContacts.clear();
- mu.setOriginalData(&d_mu);
- tol.setOriginalData(&d_tol);
-
-}
-
-template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
-FrictionContact::~FrictionContact()
-{
-}
-
-template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
-void FrictionContact::cleanup()
-{
- if (m_constraint)
- {
- m_constraint->cleanup();
-
- if (parent != nullptr)
- parent->removeObject(m_constraint);
-
- parent = nullptr;
- m_constraint.reset();
-
- mapper1.cleanup();
-
- if (!selfCollision)
- mapper2.cleanup();
- }
-
- contacts.clear();
- mappedContacts.clear();
-}
-
-
-template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
-void FrictionContact::setDetectionOutputs(OutputVector* o)
-{
- TOutputVector& outputs = *static_cast(o);
- // We need to remove duplicate contacts
- constexpr double minDist2 = 0.00000001f;
-
- contacts.clear();
-
- if (model1->getContactStiffness(0) == 0 || model2->getContactStiffness(0) == 0)
- {
- msg_error() << "Disabled FrictionContact with " << (outputs.size()) << " collision points.";
- return;
- }
-
- contacts.reserve(outputs.size());
-
- const int SIZE = outputs.size();
-
- // the following procedure cancels the duplicated detection outputs
- for (int cpt=0; cptpoint[0]-p->point[0]).norm2()+(detectionOutput->point[1]-p->point[1]).norm2() < minDist2)
- found = true;
- }
-
- if (!found)
- contacts.push_back(detectionOutput);
- }
-
- // DUPLICATED CONTACTS FOUND
- msg_info_when(contacts.size()
-void FrictionContact::activateMappers()
+constraint::lagrangian::model::UnilateralLagrangianContactParameters FrictionContact::getParameterFromDatas() const
{
- if (!m_constraint)
- {
- // Get the mechanical model from mapper1 to fill the constraint vector
- MechanicalState1* mmodel1 = mapper1.createMapping(getName().c_str());
- // Get the mechanical model from mapper2 to fill the constraints vector
- MechanicalState2* mmodel2;
- if (selfCollision)
- {
- mmodel2 = mmodel1;
- }
- else
- {
- mmodel2 = mapper2.createMapping(getName().c_str());
- }
- m_constraint = sofa::core::objectmodel::New >(mmodel1, mmodel2);
- m_constraint->setName( getName() );
- setInteractionTags(mmodel1, mmodel2);
- m_constraint->setCustomTolerance(d_tol.getValue() );
- }
-
- int size = contacts.size();
- m_constraint->clear(size);
- if (selfCollision)
- mapper1.resize(2*size);
- else
- {
- mapper1.resize(size);
- mapper2.resize(size);
- }
- int i = 0;
- const double d0 = intersectionMethod->getContactDistance() + model1->getProximity() + model2->getProximity(); // - 0.001;
-
- mappedContacts.resize(contacts.size());
- for (std::vector::const_iterator it = contacts.begin(); it!=contacts.end(); it++, i++)
- {
- sofa::core::collision::DetectionOutput* o = *it;
- CollisionElement1 elem1(o->elem.first);
- CollisionElement2 elem2(o->elem.second);
- int index1 = elem1.getIndex();
- int index2 = elem2.getIndex();
-
- typename DataTypes1::Real r1 = 0.;
- typename DataTypes2::Real r2 = 0.;
-
- // Create mapping for first point
- index1 = mapper1.addPointB(o->point[0], index1, r1);
- // Create mapping for second point
- if (selfCollision)
- {
- index2 = mapper1.addPointB(o->point[1], index2, r2);
- }
- else
- {
- index2 = mapper2.addPointB(o->point[1], index2, r2);
- }
- const double distance = d0 + r1 + r2;
-
- mappedContacts[i].first.first = index1;
- mappedContacts[i].first.second = index2;
- mappedContacts[i].second = distance;
- }
-
- // Update mappings
- mapper1.update();
- mapper1.updateXfree();
- if (!selfCollision) mapper2.update();
- if (!selfCollision) mapper2.updateXfree();
+ return {d_mu.getValue()};
}
-template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
-void FrictionContact::createResponse(core::objectmodel::BaseContext* group)
-{
-
- activateMappers();
- const double mu_ = this->d_mu.getValue();
- // Checks if friction is considered
- if ( mu_ < 0.0 )
- msg_error() << "mu has to take positive values";
-
- if (m_constraint)
- {
- int i=0;
- for (std::vector::const_iterator it = contacts.begin(); it!=contacts.end(); it++, i++)
- {
- const sofa::core::collision::DetectionOutput* o = *it;
- const int index1 = mappedContacts[i].first.first;
- const int index2 = mappedContacts[i].first.second;
- const double distance = mappedContacts[i].second;
-
- // Polynome de Cantor de NxN sur N bijectif f(x,y)=((x+y)^2+3x+y)/2
- const long index = cantorPolynomia(o->id /*cantorPolynomia(index1, index2)*/,id);
-
- // Add contact in unilateral constraint
- m_constraint->addContact(mu_, o->normal, distance, index1, index2, index, o->id);
- }
-
- if (parent!=nullptr)
- {
- parent->removeObject(this);
- parent->removeObject(m_constraint);
- }
-
- parent = group;
- if (parent!=nullptr)
- {
- parent->addObject(this);
- parent->addObject(m_constraint);
- }
- }
-}
template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
-void FrictionContact::removeResponse()
+void FrictionContact::setupConstraint(MechanicalState1 * mmodel1,MechanicalState2 * mmodel2)
{
- if (m_constraint)
- {
- mapper1.resize(0);
- mapper2.resize(0);
- if (parent!=nullptr)
- {
- parent->removeObject(this);
- parent->removeObject(m_constraint);
- }
- parent = nullptr;
- }
+ this->m_constraint = sofa::core::objectmodel::New >(mmodel1, mmodel2);
}
-template < class TCollisionModel1, class TCollisionModel2, class ResponseDataTypes >
-void FrictionContact::setInteractionTags(MechanicalState1* mstate1, MechanicalState2* mstate2)
-{
- sofa::core::objectmodel::TagSet tagsm1 = mstate1->getTags();
- sofa::core::objectmodel::TagSet tagsm2 = mstate2->getTags();
- sofa::core::objectmodel::TagSet::iterator it;
- for(it=tagsm1.begin(); it != tagsm1.end(); it++)
- m_constraint->addTag(*it);
- for(it=tagsm2.begin(); it!=tagsm2.end(); it++)
- m_constraint->addTag(*it);
-}
} //namespace sofa::component::collision::response::contact
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/TetrahedronAugmentedLagrangianContact.cpp b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/TetrahedronAugmentedLagrangianContact.cpp
new file mode 100644
index 00000000000..d5fe12ce865
--- /dev/null
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/TetrahedronAugmentedLagrangianContact.cpp
@@ -0,0 +1,60 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Authors: The SOFA Team and external contributors (see Authors.txt) *
+* *
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+#include
+#include
+#include
+#include
+#include