diff --git a/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl b/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl index 3e38df5da..cdac4a4a9 100644 --- a/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl +++ b/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl @@ -722,7 +722,8 @@ void AdaptiveBeamForceFieldAndMass::addKToMatrix(const MechanicalPara template void AdaptiveBeamForceFieldAndMass::buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) { - unsigned int numBeams = l_interpolation->getNumBeams(); + const unsigned int numBeams = l_interpolation->getNumBeams(); + auto dfdx = matrix->getForceDerivativeIn(this->mstate) .withRespectToPositionsIn(this->mstate);