Skip to content

Commit 0f7fb45

Browse files
authored
[Solver] Deprecate computeResidual method as it is unused (#5737)
* [Solver] Remove `computeResidual` method as it is unused * Revert "[Solver] Remove `computeResidual` method as it is unused" This reverts commit eb015a0. * deprecate instead of removing
1 parent 63c701b commit 0f7fb45

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class SOFA_CORE_API BaseConstraintCorrection : public virtual objectmodel::BaseO
115115
/// Compute the residual in the newton iterations due to the constraints forces
116116
/// i.e. compute Vecid::force() += J^t lambda
117117
/// the result is accumulated in Vecid::force()
118+
SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL()
118119
virtual void computeResidual(const core::ExecParams* /*params*/, linearalgebra::BaseVector * /*lambda*/) ;
119120

120121
virtual void applyContactForce(const linearalgebra::BaseVector *f) = 0;

Sofa/framework/Core/src/sofa/core/behavior/ConstraintSolver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class SOFA_CORE_API ConstraintSolver : public virtual objectmodel::BaseObject
9090
/// Compute the residual in the newton iterations due to the constraints forces
9191
/// i.e. compute Vecid::force() += J^t lambda
9292
/// the result is accumulated in Vecid::force()
93+
SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL()
9394
virtual void computeResidual(const core::ExecParams* /*params*/)
9495
{
9596
dmsg_error() << "ComputeResidual is not implemented in " << this->getName() ;

Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class SOFA_CORE_API LinearSolver : public BaseLinearSolver
125125
/// Compute the residual in the newton iterations due to the constraints forces
126126
/// i.e. compute mparams->dF() = J^t lambda
127127
/// the result is written in mparams->dF()
128+
SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL()
128129
virtual void computeResidual(const core::ExecParams* /*params*/, linearalgebra::BaseVector* /*f*/) {
129130
msg_error() << "computeResidual has not been implemented.";
130131
}

Sofa/framework/Core/src/sofa/core/config.h.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,11 @@ SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "Use getContactDistance or setCont
153153
#else
154154
#define SOFA_ATTRIBUTE_RENAMED__COLLISIONMODEL_PROXIMITY() \
155155
SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "Data 'proximity' has been renamed to 'contactDistance'")
156-
#endif
156+
#endif
157+
158+
#ifdef SOFA_BUILD_SOFA_CORE
159+
#define SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL()
160+
#else
161+
#define SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL() \
162+
SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "The method computeResidual is not used")
163+
#endif

0 commit comments

Comments
 (0)