Skip to content

Commit 65ccbee

Browse files
alxbilgerhugtalbot
andauthored
[FEM.Elastic] introduce virtual method called before force derivatives (sofa-framework#6139)
introduce function before force deriv Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
1 parent 2dd7c61 commit 65ccbee

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/FEMForceField.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ class FEMForceField :
106106
sofa::type::vector<ElementForce>& df,
107107
const sofa::VecDeriv_t<DataTypes>& dx);
108108

109+
virtual void beforeElementForceDeriv(const sofa::core::MechanicalParams* mparams) {}
110+
109111
virtual void computeElementsForcesDeriv(
110112
const sofa::simulation::Range<std::size_t>& range,
111113
const sofa::core::MechanicalParams* mparams,

Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/FEMForceField.inl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ void FEMForceField<DataTypes, ElementType>::computeElementsForcesDeriv(
164164
{
165165
SCOPED_TIMER("ElementForcesDeriv");
166166

167+
this->beforeElementForceDeriv(mparams);
168+
167169
const auto& elements = trait::FiniteElement::getElementSequence(*this->l_topology);
168170

169171
sofa::simulation::forEachRange(getExecutionPolicy(d_computeForceDerivStrategy), *this->m_taskScheduler,

0 commit comments

Comments
 (0)