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

[MechanicalLoad] Add buildStiffnessMatrix to TrianglePressureForceField #4294

Conversation

damienmarchal
Copy link
Contributor

Related to #3967

I was not able to not unify a bit the behavior and clean some part of the code.

The non constant computation of the pressure is not valid as all the derivatives are zero in addDForce, addKtoMatrix... it is also not consistant with QuadPressureForceField.

Moving to the situation with a valid non constant computation on both Triangle and Quad requires more work, so for the moment I prefer to just deprecate the non constant situation.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

…trix & deprecate non constant mode

The non constant computation of the pressure is not valid as all the derivatives are
zero in addDForce, addKtoMatrix... it is also not consistant with QuadPressureForceField.

Moving to the situation with a valid non constant computation on both Triangle and Quad requires more
work, so for the moment I prefer to just deprecate the non constant situation.
@hugtalbot hugtalbot added pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code STC#16 Tasks for STC#16 coding sprint labels Nov 16, 2023
Copy link
Contributor

@epernod epernod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one collateral damage to remove

@@ -182,6 +182,7 @@ class SPHFluidForceField : public sofa::core::behavior::ForceField<DataTypes>
void addDForce(const core::MechanicalParams* mparams, DataVecDeriv& d_df, const DataVecDeriv& d_dx) override;
SReal getPotentialEnergy(const core::MechanicalParams* /* mparams */, const DataVecCoord& /* d_x */) const override;

void buildStiffnessMatrix(core::behavior::StiffnessMatrix* matrix) override;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hugtalbot
Copy link
Contributor

Discrepancy between disabling and deprecating.
The PR could have been split in two: add the buildStiffnessMatrix and deprecated the data for non-constant forces. This latter topic should rediscussed.

@hugtalbot hugtalbot added this to the v24.06 milestone Nov 22, 2023
@hugtalbot hugtalbot changed the title [Sofa/MechanicalLoad/TrianglePressureForceField] Add buildStiffnessMatrix to TrianglePressureForceField [MechanicalLoad] Add buildStiffnessMatrix to TrianglePressureForceField Nov 29, 2023
@fredroy fredroy added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean Cleaning the code pr: status wip Development in the pull-request is still in progress STC#16 Tasks for STC#16 coding sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants