Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility layer for buildStiffnessMatrix #82

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -144,6 +144,7 @@ class HyperReducedHexahedronFEMForceField : public virtual HexahedronFEMForceFie
// getPotentialEnergy is implemented for polar method

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ void HyperReducedHexahedronFEMForceField<DataTypes>::addKToMatrix(const core::Me
}
}

template <class DataTypes>
void HyperReducedHexahedronFEMForceField<DataTypes>::buildStiffnessMatrix(
core::behavior::StiffnessMatrix* matrix)
{
core::behavior::ForceField<DataTypes>::buildStiffnessMatrix(matrix);
}


template<class DataTypes>
void HyperReducedHexahedronFEMForceField<DataTypes>::draw(const core::visual::VisualParams* vparams)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class HyperReducedRestShapeSpringsForceField : public virtual RestShapeSpringsFo
/// Brings ForceField contribution to the global system stiffness matrix.
virtual void addKToMatrix(const core::MechanicalParams* mparams, const sofa::core::behavior::MultiMatrixAccessor* matrix ) override;

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

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

const DataVecCoord* getExtPosition() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@ void HyperReducedRestShapeSpringsForceField<DataTypes>::addKToMatrix(const Mecha
}
}

template <class DataTypes>
void HyperReducedRestShapeSpringsForceField<DataTypes>::buildStiffnessMatrix(
core::behavior::StiffnessMatrix* matrix)
{
core::behavior::ForceField<DataTypes>::buildStiffnessMatrix(matrix);
}

} // namespace sofa::component::solidmechanics::spring


Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class HyperReducedTetrahedralCorotationalFEMForceField : public virtual Tetrahed
virtual void addDForce(const core::MechanicalParams* mparams, DataVecDeriv& d_df, const DataVecDeriv& d_dx) override;

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,4 +756,12 @@ void HyperReducedTetrahedralCorotationalFEMForceField<DataTypes>::addKToMatrix(s
}
}
}

template <class DataTypes>
void HyperReducedTetrahedralCorotationalFEMForceField<DataTypes>::
buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
{
core::behavior::ForceField<DataTypes>::buildStiffnessMatrix(matrix);
}

} // namespace sofa::component::solidmechanics::fem::elastic
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public :
virtual void addForce(const core::MechanicalParams* mparams /* PARAMS FIRST */, DataVecDeriv& d_f, const DataVecCoord& d_x, const DataVecDeriv& d_v) override;
virtual void addDForce(const core::MechanicalParams* mparams /* PARAMS FIRST */, DataVecDeriv& d_df, const DataVecDeriv& d_dx) override;
virtual void addKToMatrix(sofa::linearalgebra::BaseMatrix *mat, SReal k, unsigned int &offset) override;
void buildStiffnessMatrix(core::behavior::StiffnessMatrix* /* matrix */) override;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ void HyperReducedTetrahedronHyperelasticityFEMForceField<DataTypes>::addKToMatri
m_edgeInfo.endEdit();
}

template <class DataTypes>
void HyperReducedTetrahedronHyperelasticityFEMForceField<DataTypes>::
buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix)
{
core::behavior::ForceField<DataTypes>::buildStiffnessMatrix(matrix);
}


template<class DataTypes>
Expand Down
Loading