Skip to content

Commit

Permalink
[Lagrangian] Remove unused data numericalTolerance in BLC (#5164)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugtalbot authored Dec 20, 2024
1 parent 3e508d3 commit 642cdc6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class BilateralLagrangianConstraintSpecialization<RigidImpl>
static void getConstraintResolution(BilateralLagrangianConstraint<T>& self,
const ConstraintParams* cParams,
std::vector<ConstraintResolution*>& resTab,
unsigned int& offset, SReal tolerance)
unsigned int& offset)
{
SOFA_UNUSED(cParams);
const unsigned minp = std::min(self.d_m1.getValue().size(),
Expand All @@ -100,7 +100,6 @@ class BilateralLagrangianConstraintSpecialization<RigidImpl>
resTab[offset] = new BilateralConstraintResolution3Dof();
offset += 3;
BilateralConstraintResolution3Dof* temp = new BilateralConstraintResolution3Dof();
temp->setTolerance(tolerance); // specific (smaller) tolerance for the rotation
resTab[offset] = temp;
offset += 3;
}
Expand Down Expand Up @@ -276,8 +275,7 @@ void BilateralLagrangianConstraint<Rigid3Types>::getConstraintResolution(
unsigned int& offset)
{
RigidBilateralLagrangianConstraint::getConstraintResolution(*this,
cParams, resTab, offset,
d_numericalTolerance.getValue());
cParams, resTab, offset);
}

template <> SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_MODEL_API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ class BilateralLagrangianConstraint : public PairInteractionConstraint<DataTypes
Data<VecDeriv> d_restVector; ///< Relative position to maintain between attached points (optional)
VecCoord initialDifference;

Data<SReal> d_numericalTolerance; ///< a real value specifying the tolerance during the constraint solving. (default=0.0001
SOFA_ATTRIBUTE_DEPRECATED__BILATERALREMOVEUNUSEDTOLERANCE() DeprecatedAndRemoved d_numericalTolerance; ///< a real value specifying the tolerance during the constraint solving. (default=0.0001

Data<bool> d_activate; ///< control constraint activation (true by default)
Data<bool> d_keepOrientDiff; ///< keep the initial difference in orientation (only for rigids)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ BilateralLagrangianConstraint<DataTypes>::BilateralLagrangianConstraint(Mechanic
, d_m1(initData(&d_m1, "first_point","index of the constraint on the first model (object1)"))
, d_m2(initData(&d_m2, "second_point","index of the constraint on the second model (object2)"))
, d_restVector(initData(&d_restVector, "rest_vector","Relative position to maintain between attached points (optional)"))
, d_numericalTolerance(initData(&d_numericalTolerance, 1e-4_sreal, "numericalTolerance",
"a real value specifying the tolerance during the constraint solving.") )
, d_activate( initData(&d_activate, true, "activate", "control constraint activation (true by default)"))
, d_keepOrientDiff(initData(&d_keepOrientDiff, false, "keepOrientationDifference", "keep the initial difference in orientation (only for rigids)"))
, l_topology1(initLink("topology1", "link to the first topology container"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,14 @@ namespace sofa::component::constraint::lagrangian::model
SOFA_ATTRIBUTE_DEPRECATED( \
"v24.06", "v24.12", \
"Data renamed according to the guidelines")
#endif


#ifdef SOFA_BUILD_SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_MODEL
#define SOFA_ATTRIBUTE_DEPRECATED__BILATERALREMOVEUNUSEDTOLERANCE()
#else
#define SOFA_ATTRIBUTE_DEPRECATED__BILATERALREMOVEUNUSEDTOLERANCE() \
SOFA_ATTRIBUTE_DEPRECATED( \
"v25.06", "v25.12", \
"Data \'d_numericalTolerance\' has been removed since it was actually not taken into account")
#endif

0 comments on commit 642cdc6

Please sign in to comment.