Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8c30ba8
[Framework] Apply template method design pattern to BaseMass
hugtalbot May 12, 2025
46aea63
Add all associated warning comments
hugtalbot May 12, 2025
d77c426
fix warnings
hugtalbot May 12, 2025
1be30df
Pursue rest of the API
hugtalbot May 12, 2025
ac64d77
[Framework] Apply template method design pattern to BaseForceField - …
hugtalbot May 13, 2025
f53eec9
Apply pattern : addDForce
hugtalbot May 13, 2025
a5d8846
Apply pattern : getPotentialEnergy
hugtalbot May 13, 2025
ef76b8d
Move all functions in BaseForceField.cpp and add comment message
hugtalbot May 14, 2025
24065fd
continue but compilation of TrianglePressureForceField and SurfacePre…
hugtalbot May 15, 2025
e7557fe
Fix compilation for SOFA, TODO: plugins
hugtalbot May 15, 2025
59f8466
[Engine.Select] Automatically find topology in MeshBoundaryROI (#5116)
alxbilger May 12, 2025
e2e5f6a
[Core] Rename BaseConstraint to BaseLagrangianConstraint (#5423)
alxbilger May 13, 2025
799f7c2
Move all functions in BaseMass.cpp and add comment message
hugtalbot May 14, 2025
0e38542
Fix compilation CUDA
hugtalbot May 14, 2025
62e691d
fix CUDA compilation on doGetElementMass
hugtalbot May 15, 2025
b9da001
Apply changes on SofaDistanceGrid
hugtalbot May 27, 2025
22d0f33
202601 attempt to merge with master
hugtalbot Jan 6, 2026
794fe86
update version of change
hugtalbot Jan 6, 2026
0adb8dd
remove forgotten unresolved conflicts
hugtalbot Jan 6, 2026
2bb4443
Update master, fix conflicts and cover new files
hugtalbot Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ class PenalityContactForceField : public core::behavior::PairInteractionForceFie

void addDForce(const sofa::core::MechanicalParams* mparams, DataVecDeriv& data_df1, DataVecDeriv& data_df2, const DataVecDeriv& data_dx1, const DataVecDeriv& data_dx2) override;

void addKToMatrix(const sofa::core::MechanicalParams* mparams, const sofa::core::behavior::MultiMatrixAccessor* matrix) override;
void buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;
void doAddKToMatrix(const sofa::core::MechanicalParams* mparams, const sofa::core::behavior::MultiMatrixAccessor* matrix) override;

void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;

void buildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final;
void doBuildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final;

using Inherit::getPotentialEnergy;
SReal getPotentialEnergy(const sofa::core::MechanicalParams*, const DataVecCoord&, const DataVecCoord& ) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void PenalityContactForceField<DataTypes>::addDForce(const sofa::core::Mechanica
}

template <class DataTypes>
void PenalityContactForceField<DataTypes>::addKToMatrix(const sofa::core::MechanicalParams* mparams,
void PenalityContactForceField<DataTypes>::doAddKToMatrix(const sofa::core::MechanicalParams* mparams,
const sofa::core::behavior::MultiMatrixAccessor* matrix)
{
static constexpr auto N = DataTypes::spatial_dimensions;
Expand Down Expand Up @@ -200,7 +200,7 @@ void PenalityContactForceField<DataTypes>::addKToMatrix(const sofa::core::Mechan
}

template <class DataTypes>
void PenalityContactForceField<DataTypes>::buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
void PenalityContactForceField<DataTypes>::doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
{
const type::vector<Contact>& cc = contacts.getValue();

Expand Down Expand Up @@ -257,7 +257,7 @@ void PenalityContactForceField<DataTypes>::buildStiffnessMatrix(core::behavior::
}

template <class DataTypes>
void PenalityContactForceField<DataTypes>::buildDampingMatrix(core::behavior::DampingMatrix*)
void PenalityContactForceField<DataTypes>::doBuildDampingMatrix(core::behavior::DampingMatrix*)
{
// No damping in this ForceField
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ class TetrahedronDiffusionFEMForceField : public core::behavior::ForceField<Data
/// Forcefield functions for Matrix system. Adding derivate force to global forcefield vector.
void addDForce(const sofa::core::MechanicalParams* /*mparams*/ /* PARAMS FIRST */, DataVecDeriv& dF , const DataVecDeriv& dX) override;
/// Forcefield functions for Matrix system. Adding derivate force to global forcefield vector. (direct solver)
void addKToMatrix(const core::MechanicalParams* mparams, const sofa::core::behavior::MultiMatrixAccessor* matrix) override;
void addKToMatrix(sofa::linearalgebra::BaseMatrix * matrix, SReal kFact, unsigned int &offset) override;

void buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;
void buildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;
void doBuildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}

/// Return Potential energy of the mesh.
SReal getPotentialEnergy(const core::MechanicalParams* /*mparams*/, const DataVecCoord& x) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,22 +357,17 @@ void TetrahedronDiffusionFEMForceField<DataTypes>::addDForce(const sofa::core::M


template <class DataTypes>
void TetrahedronDiffusionFEMForceField<DataTypes>::addKToMatrix(const core::MechanicalParams* mparams, const sofa::core::behavior::MultiMatrixAccessor* matrix)
void TetrahedronDiffusionFEMForceField<DataTypes>::addKToMatrix(sofa::linearalgebra::BaseMatrix * matrix, SReal kFactor, unsigned int &offset)
{
SCOPED_TIMER("addKToMatrix");
const auto N = defaulttype::DataTypeInfo<Deriv>::size();
sofa::core::behavior::MultiMatrixAccessor::MatrixRef r = matrix->getMatrix(this->mstate);
sofa::linearalgebra::BaseMatrix* mat = r.matrix;

if((sofa::Size)(mat->colSize()) != (m_topology->getNbPoints()*N) || (sofa::Size)(mat->rowSize()) != (m_topology->getNbPoints()*N))
if((sofa::Size)(matrix->colSize()) != (m_topology->getNbPoints()*N) || (sofa::Size)(matrix->rowSize()) != (m_topology->getNbPoints()*N))
{
msg_error()<<"Wrong size of the input Matrix: need resize in addKToMatrix function.";
mat->resize(m_topology->getNbPoints()*N,m_topology->getNbPoints()*N);
matrix->resize(m_topology->getNbPoints()*N,m_topology->getNbPoints()*N);
}

Real kFactor = mparams->kFactor();
unsigned int &offset = r.offset;

sofa::Index v0,v1;

const auto& edges = m_topology->getEdges();
Expand All @@ -381,15 +376,15 @@ void TetrahedronDiffusionFEMForceField<DataTypes>::addKToMatrix(const core::Mech
v0 = edges[i][0];
v1 = edges[i][1];

mat->add(offset+N*v1, offset+N*v0, -kFactor * edgeDiffusionCoefficient[i]);
mat->add(offset+N*v0, offset+N*v1, -kFactor * edgeDiffusionCoefficient[i]);
mat->add(offset+N*v0, offset+N*v0, kFactor * edgeDiffusionCoefficient[i]);
mat->add(offset+N*v1, offset+N*v1, kFactor * edgeDiffusionCoefficient[i]);
matrix->add(offset+N*v1, offset+N*v0, -kFactor * edgeDiffusionCoefficient[i]);
matrix->add(offset+N*v0, offset+N*v1, -kFactor * edgeDiffusionCoefficient[i]);
matrix->add(offset+N*v0, offset+N*v0, kFactor * edgeDiffusionCoefficient[i]);
matrix->add(offset+N*v1, offset+N*v1, kFactor * edgeDiffusionCoefficient[i]);
}
}

template <class DataTypes>
void TetrahedronDiffusionFEMForceField<DataTypes>::buildStiffnessMatrix(
void TetrahedronDiffusionFEMForceField<DataTypes>::doBuildStiffnessMatrix(
core::behavior::StiffnessMatrix* matrix)
{
constexpr auto N = DataTypes::deriv_total_size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ template<class DataTypes>
public:
SOFA_CLASS(BuggyForceField, sofa::core::behavior::ForceField<DataTypes>);

void buildStiffnessMatrix(sofa::core::behavior::StiffnessMatrix* matrix) override
void doBuildStiffnessMatrix(sofa::core::behavior::StiffnessMatrix* matrix) override
{
auto dfdx = matrix->getForceDerivativeIn(this->mstate).withRespectToPositionsIn(this->mstate);
dfdx(10, 20) += 0.;
Expand Down
10 changes: 5 additions & 5 deletions Sofa/Component/Mass/src/sofa/component/mass/DiagonalMass.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ class DiagonalMass : public core::behavior::Mass<DataTypes>, public virtual sofa

/// Add Mass contribution to global Matrix assembling
void addMToMatrix(sofa::linearalgebra::BaseMatrix * mat, SReal mFact, unsigned int &offset) override;
void buildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices) override;
void buildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override {}
void buildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}
void doBuildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices) override;
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override {}
void doBuildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}

SReal getElementMass(sofa::Index index) const override;
void getElementMass(sofa::Index, linearalgebra::BaseMatrix *m) const override;
SReal doGetElementMass(sofa::Index index) const override;
void doGetElementMass(sofa::Index, linearalgebra::BaseMatrix *m) const override;

bool isDiagonal() const override {return true;}

Expand Down
6 changes: 3 additions & 3 deletions Sofa/Component/Mass/src/sofa/component/mass/DiagonalMass.inl
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ void DiagonalMass<DataTypes, GeometricalTypes>::addMToMatrix(sofa::linearalgebra
}

template <class DataTypes, class GeometricalTypes>
void DiagonalMass<DataTypes, GeometricalTypes>::buildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices)
void DiagonalMass<DataTypes, GeometricalTypes>::doBuildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices)
{
const MassVector &masses= d_vertexMass.getValue();
static constexpr auto N = Deriv::total_size;
Expand All @@ -641,15 +641,15 @@ void DiagonalMass<DataTypes, GeometricalTypes>::buildMassMatrix(sofa::core::beha


template <class DataTypes, class GeometricalTypes>
SReal DiagonalMass<DataTypes, GeometricalTypes>::getElementMass(sofa::Index index) const
SReal DiagonalMass<DataTypes, GeometricalTypes>::doGetElementMass(sofa::Index index) const
{
return SReal(d_vertexMass.getValue()[index]);
}


//TODO: special case for Rigid Mass
template <class DataTypes, class GeometricalTypes>
void DiagonalMass<DataTypes, GeometricalTypes>::getElementMass(sofa::Index index, linearalgebra::BaseMatrix *m) const
void DiagonalMass<DataTypes, GeometricalTypes>::doGetElementMass(sofa::Index index, linearalgebra::BaseMatrix *m) const
{
static const linearalgebra::BaseMatrix::Index dimension = linearalgebra::BaseMatrix::Index(defaulttype::DataTypeInfo<Deriv>::size());
if (m->rowSize() != dimension || m->colSize() != dimension) m->resize(dimension,dimension);
Expand Down
10 changes: 5 additions & 5 deletions Sofa/Component/Mass/src/sofa/component/mass/MeshMatrixMass.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ class MeshMatrixMass : public core::behavior::Mass<DataTypes>, public virtual co
/// Add Mass contribution to global Matrix assembling
using Inherited::addMToMatrix;
void addMToMatrix(sofa::linearalgebra::BaseMatrix * mat, SReal mFact, unsigned int &offset) override;
void buildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices) override;
void buildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override {}
void buildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}
void doBuildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices) override;
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override {}
void doBuildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}

SReal getElementMass(Index index) const override;
void getElementMass(Index index, linearalgebra::BaseMatrix *m) const override;
SReal doGetElementMass(Index index) const override;
void doGetElementMass(Index index, linearalgebra::BaseMatrix *m) const override;

void draw(const core::visual::VisualParams* vparams) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,7 @@ void MeshMatrixMass<DataTypes, GeometricalTypes>::addMToMatrix(sofa::linearalgeb
}

template <class DataTypes, class GeometricalTypes>
void MeshMatrixMass<DataTypes, GeometricalTypes>::buildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices)
void MeshMatrixMass<DataTypes, GeometricalTypes>::doBuildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices)
{
const MassVector &vertexMass= d_vertexMass.getValue();
const MassVector &edgeMass= d_edgeMass.getValue();
Expand Down Expand Up @@ -2299,7 +2299,7 @@ void MeshMatrixMass<DataTypes, GeometricalTypes>::buildMassMatrix(sofa::core::be


template <class DataTypes, class GeometricalTypes>
SReal MeshMatrixMass<DataTypes, GeometricalTypes>::getElementMass(Index index) const
SReal MeshMatrixMass<DataTypes, GeometricalTypes>::doGetElementMass(Index index) const
{
const auto &vertexMass= d_vertexMass.getValue();
const SReal mass = vertexMass[index] * m_massLumpingCoeff;
Expand All @@ -2310,7 +2310,7 @@ SReal MeshMatrixMass<DataTypes, GeometricalTypes>::getElementMass(Index index) c

//TODO: special case for Rigid Mass
template <class DataTypes, class GeometricalTypes>
void MeshMatrixMass<DataTypes, GeometricalTypes>::getElementMass(Index index, linearalgebra::BaseMatrix *m) const
void MeshMatrixMass<DataTypes, GeometricalTypes>::doGetElementMass(Index index, linearalgebra::BaseMatrix *m) const
{
static const linearalgebra::BaseMatrix::Index dimension = linearalgebra::BaseMatrix::Index(defaulttype::DataTypeInfo<Deriv>::size());
if (m->rowSize() != dimension || m->colSize() != dimension) m->resize(dimension,dimension);
Expand Down
10 changes: 5 additions & 5 deletions Sofa/Component/Mass/src/sofa/component/mass/UniformMass.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ class UniformMass : public core::behavior::Mass<DataTypes>, public virtual core:

using Inherited::addMToMatrix;
void addMToMatrix(sofa::linearalgebra::BaseMatrix * mat, SReal mFact, unsigned int &offset) override; /// Add Mass contribution to global Matrix assembling
void buildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices) override;
void buildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override {}
void buildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}
void doBuildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices) override;
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override {}
void doBuildDampingMatrix(core::behavior::DampingMatrix* /* matrices */) override {}

SReal getElementMass(sofa::Index index) const override;
void getElementMass(sofa::Index index, linearalgebra::BaseMatrix *m) const override;
SReal doGetElementMass(sofa::Index index) const override;
void doGetElementMass(sofa::Index index, linearalgebra::BaseMatrix *m) const override;

bool isDiagonal() const override {return true;}

Expand Down
6 changes: 3 additions & 3 deletions Sofa/Component/Mass/src/sofa/component/mass/UniformMass.inl
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ void UniformMass<DataTypes>::addMToMatrix (sofa::linearalgebra::BaseMatrix * mat
}

template <class DataTypes>
void UniformMass<DataTypes>::buildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices)
void UniformMass<DataTypes>::doBuildMassMatrix(sofa::core::behavior::MassMatrixAccumulator* matrices)
{
if (!this->isComponentStateValid())
{
Expand All @@ -593,14 +593,14 @@ void UniformMass<DataTypes>::buildMassMatrix(sofa::core::behavior::MassMatrixAcc


template <class DataTypes>
SReal UniformMass<DataTypes>::getElementMass (sofa::Index ) const
SReal UniformMass<DataTypes>::doGetElementMass (sofa::Index ) const
{
return (SReal ( d_vertexMass.getValue() ));
}


template <class DataTypes>
void UniformMass<DataTypes>::getElementMass (sofa::Index index, BaseMatrix *m ) const
void UniformMass<DataTypes>::doGetElementMass (sofa::Index index, BaseMatrix *m ) const
{
SOFA_UNUSED(index);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ class ConicalForceField : public core::behavior::ForceField<DataTypes>

void addForce(const sofa::core::MechanicalParams* /*mparams*/, DataVecDeriv & dataF, const DataVecCoord & dataX , const DataVecDeriv & dataV ) override;
void addDForce(const sofa::core::MechanicalParams* /*mparams*/, DataVecDeriv& datadF , const DataVecDeriv& datadX ) override;
void buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;
void doBuildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final;

SReal getPotentialEnergy(const core::MechanicalParams* /*mparams*/, const DataVecCoord& /* x */) const override
{
msg_warning() << "Method getPotentialEnergy not implemented yet.";
return 0.0;
}
void buildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final;


virtual void updateStiffness( const VecCoord& x );

virtual bool isIn(Coord p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void ConicalForceField<DataTypes>::addDForce(const sofa::core::MechanicalParams*
}

template <class DataTypes>
void ConicalForceField<DataTypes>::buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
void ConicalForceField<DataTypes>::doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
{
auto dfdx = matrix->getForceDerivativeIn(this->mstate)
.withRespectToPositionsIn(this->mstate);
Expand All @@ -174,7 +174,7 @@ void ConicalForceField<DataTypes>::buildStiffnessMatrix(core::behavior::Stiffnes
}

template <class DataTypes>
void ConicalForceField<DataTypes>::buildDampingMatrix(core::behavior::DampingMatrix*)
void ConicalForceField<DataTypes>::doBuildDampingMatrix(core::behavior::DampingMatrix*)
{
// No damping in this ForceField
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ class ConstantForceField : public core::behavior::ForceField<DataTypes>
/// Constant force has null variation
virtual void addKToMatrix(const sofa::core::behavior::MultiMatrixAccessor* /*matrix*/, SReal /*kFact*/) ;

void buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;

void doBuildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final
{
// No damping in this ForceField
}

SReal getPotentialEnergy(const core::MechanicalParams* params, const DataVecCoord& x) const override;

void draw(const core::visual::VisualParams* vparams) override;
Expand All @@ -97,10 +102,7 @@ class ConstantForceField : public core::behavior::ForceField<DataTypes>
using Inherit::addAlias ;
using Inherit::addKToMatrix;

void buildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final
{
// No damping in this ForceField
}



protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void ConstantForceField<DataTypes>::addKToMatrix(const sofa::core::behavior::Mul
}

template <class DataTypes>
void ConstantForceField<DataTypes>::buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
void ConstantForceField<DataTypes>::doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
{
SOFA_UNUSED(matrix);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ class DiagonalVelocityDampingForceField : public core::behavior::ForceField<Data
void addDForce(const core::MechanicalParams* mparams, DataVecDeriv& d_df , const DataVecDeriv& d_dx) override;

void addKToMatrix(sofa::linearalgebra::BaseMatrix * /*m*/, SReal /*kFactor*/, unsigned int &/*offset*/) override {}
void buildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override;
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override;

void addBToMatrix(sofa::linearalgebra::BaseMatrix * mat, SReal bFact, unsigned int& offset) override;
void buildDampingMatrix(core::behavior::DampingMatrix* matrix) override;
void doBuildDampingMatrix(core::behavior::DampingMatrix* matrix) override;

SReal getPotentialEnergy(const core::MechanicalParams* params, const DataVecCoord& x) const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void DiagonalVelocityDampingForceField<DataTypes>::addDForce(const core::Mechani
}

template <class DataTypes>
void DiagonalVelocityDampingForceField<DataTypes>::buildStiffnessMatrix(core::behavior::StiffnessMatrix*)
void DiagonalVelocityDampingForceField<DataTypes>::doBuildStiffnessMatrix(core::behavior::StiffnessMatrix*)
{
// DiagonalVelocityDampingForceField is a pure damping component: stiffness is not computed
}
Expand Down Expand Up @@ -126,7 +126,7 @@ void DiagonalVelocityDampingForceField<DataTypes>::addBToMatrix(sofa::linearalge
}

template <class DataTypes>
void DiagonalVelocityDampingForceField<DataTypes>::buildDampingMatrix(core::behavior::DampingMatrix* matrix)
void DiagonalVelocityDampingForceField<DataTypes>::doBuildDampingMatrix(core::behavior::DampingMatrix* matrix)
{
const auto& coefs = d_dampingCoefficients.getValue();
const std::size_t nbDampingCoeff = coefs.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class EdgePressureForceField : public core::behavior::ForceField<DataTypes>
void setNormal(const Coord n) { d_normal.setValue(n);}
void setPressure(Deriv _pressure) { this->d_pressure = _pressure; updateEdgeInformation(); }

void buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) final;
void buildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final;
void doBuildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) final;
void doBuildDampingMatrix(core::behavior::DampingMatrix* /*matrix*/) final;

protected :
void selectEdgesAlongPlane();
Expand Down
Loading
Loading