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

[SofaBoundaryCondition] ADD flag PROJECTVELOCITY #288

Merged

Conversation

adagolodjo
Copy link
Contributor

@adagolodjo adagolodjo commented Jun 6, 2017

In component FixeConstraint in function projectVelocity use Data flag instead of #define Flag to set velocity and free velocity to zero.
@digitaltrainers and @matthieu-nesme

Suggested label enhance


This PR:

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

Reviewers will merge only if all these checks are true.

@sofabot
Copy link
Collaborator

sofabot commented Jun 6, 2017

Thank you for your pull request!
Someone will soon check it and start the builds.

Copy link
Member

@matthieu-nesme matthieu-nesme left a comment

Choose a reason for hiding this comment

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

Ok to add a flag to filter the velocities.

If it is done in FixedConstraint, it also has to be done in PartialFixedConstraint.

Note that in the general case it is not necessary to project the velocity at each time step, it should be sufficient to do so only once when creating/modifying the mstate. (Or even better: never calling it by creating a valid state from the beginning!)

@@ -86,6 +87,7 @@ class FixedConstraint : public core::behavior::ProjectiveConstraintSet<DataTypes
Data<bool> f_fixAll;
Data<bool> f_showObject;
Data<SReal> f_drawSize;
Data<bool> f_activate_projectVelocity;
Copy link
Member

Choose a reason for hiding this comment

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

I would rename this data as "projectVelocity" (variable d_projectVelocity)

const SetIndexArray & indices = this->f_indices.getValue();
helper::WriteAccessor<DataVecDeriv> res ( mparams, vData );

if( this->f_fixAll.getValue()==true ) // fix everyting
{
for( unsigned i=0; i<res.size(); i++ )
res[i] = Deriv();
Copy link
Member

Choose a reason for hiding this comment

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

ok to filter freeVelocity BUT

  • it is not necessary to do it at each time step
  • to be coherent it should also be done when all dofs are fixed
  • the vector freeVelocity is not allocated in the general case
  • if this projective constraint is applied on freeVelocity, every other projective constraints should also be applied.

The clean way is to call the projectVelocity visitor on freeVelocity where needed (in general in the solver that allocates freeVelocity) but definitively not hard-coded in FixedConstraint::projectVelocity.

@guparan
Copy link
Contributor

guparan commented Jun 6, 2017

[ci-build]

@guparan guparan changed the title Fixe constraint features [SofaBoundaryCondition] ADD flag PROJECTVELOCITY Jun 6, 2017
@guparan guparan added enhancement About a possible enhancement pr: status to review To notify reviewers to review this pull-request labels Jun 6, 2017
@damienmarchal
Copy link
Contributor

damienmarchal commented Jun 6, 2017

Hi @younesssss

Thanks for your PR.

I strongly support removing the #define/#ifdef where-ever this is possible because #ifdef leads to code that is very hard to maintain and test in a CI. Your proposition is going toward that so I like it.

Matthieu suggested an alternative way to achieve the same result do you think you can do it or is it too far away from what you had in mind ?

@damienmarchal damienmarchal self-assigned this Jun 6, 2017
@adagolodjo
Copy link
Contributor Author

adagolodjo commented Jun 6, 2017 via email

@hugtalbot hugtalbot 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 Jun 7, 2017
@damienmarchal
Copy link
Contributor

damienmarchal commented Jun 13, 2017

Hi @younesssss,
Any news on this PR ?

EDIT: In your PR you use @damien-marchal instead @damienmarchal... if you spell it with the '-' it is not me :)

adagolodjo pushed a commit to mimesis-inria/sofa that referenced this pull request Jun 29, 2017
@guparan
Copy link
Contributor

guparan commented Jul 6, 2017

[ci-build]
@matthieu-nesme could you update your review?

Copy link
Member

@matthieu-nesme matthieu-nesme left a comment

Choose a reason for hiding this comment

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

inlined comments

  • to be coherent activate_projectVelocity should also be added to PartialFixedConstraint

const SetIndexArray & indices = this->d_indices.getValue();
helper::WriteAccessor<DataVecDeriv> res ( mparams, vData );
helper::WriteAccessor<DataVecDeriv> resFree ( mparams, vData );

Copy link
Member

Choose a reason for hiding this comment

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

resFree must be removed (the same as res)

@hugtalbot
Copy link
Contributor

please @younesssss finalise your PR

adagolodjo pushed a commit to mimesis-inria/sofa that referenced this pull request Jul 27, 2017
@adagolodjo
Copy link
Contributor Author

I don't understand this conflict because I have no conflict on my machine even when I took an update. I resolved then the conflict on github interface. Thanks

@marques-bruno marques-bruno added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Aug 18, 2017
guparan pushed a commit to mimesis-inria/sofa that referenced this pull request Aug 23, 2017
guparan pushed a commit to mimesis-inria/sofa that referenced this pull request Aug 23, 2017
@guparan
Copy link
Contributor

guparan commented Aug 23, 2017

Hi @younesssss, I just rebased your PR to remove the 5 merge commits. Let's [ci-build] now...

@marques-bruno
Copy link
Member

@younesssss, Looks like the last modifs broke the code. could you investigate?

@guparan guparan 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 Aug 29, 2017
adagolodjo pushed a commit to mimesis-inria/sofa that referenced this pull request Aug 31, 2017
@hugtalbot
Copy link
Contributor

Hey @younesssss only some small last fixes are to bring to your PR in order to compile with options. Just grep all codes depending FixedConstraint to make sure about your PR. You're almost there!

@hugtalbot
Copy link
Contributor

[ci-build]

adagolodjo pushed a commit to mimesis-inria/sofa that referenced this pull request Sep 5, 2017
adagolodjo pushed a commit to mimesis-inria/sofa that referenced this pull request Sep 5, 2017
@hugtalbot
Copy link
Contributor

[ci-build]

@guparan
Copy link
Contributor

guparan commented Sep 13, 2017

@younesssss, your PR has been wip for a long time. Could you have a look at the build errors please?

garciaguevara added a commit to mimesis-inria/sofa that referenced this pull request Oct 12, 2017
@guparan
Copy link
Contributor

guparan commented Oct 12, 2017

Thanks for your fix @garciaguevara
[ci-build]

@hugtalbot
Copy link
Contributor

[ci-build]

@guparan
Copy link
Contributor

guparan commented Oct 18, 2017

[ci-build]

@hugtalbot
Copy link
Contributor

@matthieu-nesme we finally corrected the PR, I propose to merge it.
About the PartialFixedConstraint, it has been discussed at the STC that only one code should remain. The Partial- and FixedConstraint should be merged. I will work on it if this is fine to you.

@hugtalbot hugtalbot added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Oct 19, 2017
@guparan guparan added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Oct 25, 2017
@hugtalbot hugtalbot merged commit d45114f into sofa-framework:master Oct 30, 2017
@untereiner untereiner deleted the FixeConstraint_Features branch October 30, 2017 20:03
@guparan guparan added this to the v17.12 milestone Dec 14, 2017
@sofa-framework sofa-framework deleted a comment from adagolodjo Oct 14, 2018
@sofa-framework sofa-framework deleted a comment from adagolodjo Oct 14, 2018
@sofa-framework sofa-framework deleted a comment from adagolodjo Oct 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement About a possible enhancement pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants