-
Notifications
You must be signed in to change notification settings - Fork 317
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
[SofaBoundaryCondition] ADD flag PROJECTVELOCITY #288
Conversation
Thank you for your pull request! |
There was a problem hiding this 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; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
.
[ci-build] |
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 ? |
Hi @damien-marchal,
Yes I will do it. Maybe just need to talk with @matthieu-nesme to
understand more his suggestions.
Thanks.
2017-06-06 15:03 GMT+02:00 Damien Marchal <notifications@github.com>:
… Hi @younesssss <https://github.com/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 ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#288 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXU08Yg8acAOCZtwUhU61g0EnlJ8Ck5Zks5sBU40gaJpZM4NxEC9>
.
--
Yinoussa ADAGOLODJO
Doctorant en Simulation Médicale
Laboratoire ICube - UMR 7357
IRCAD Hôpitaux Universitaires
1 place de l'hôpital F. 67091 Strasbourg Cedex
|
Hi @younesssss, EDIT: In your PR you use @damien-marchal instead @damienmarchal... if you spell it with the '-' it is not me :) |
[ci-build] |
There was a problem hiding this 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 ); | ||
|
There was a problem hiding this comment.
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
)
please @younesssss finalise your PR |
…traint component
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 |
e32397c
to
839cc0b
Compare
…traint component
Hi @younesssss, I just rebased your PR to remove the 5 merge commits. Let's [ci-build] now... |
@younesssss, Looks like the last modifs broke the code. could you investigate? |
…indices in FEMGridBehaviorModel.inl
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! |
[ci-build] |
…nstraint dependances
…nstraint dependencies
[ci-build] |
@younesssss, your PR has been wip for a long time. Could you have a look at the build errors please? |
Thanks for your fix @garciaguevara |
[ci-build] |
…velocity and free velocity
# Conflicts: # modules/SofaBoundaryCondition/FixedConstraint.h
…traint component
…indices in FEMGridBehaviorModel.inl
…nstraint dependencies
4f5df4e
to
950117f
Compare
[ci-build] |
@matthieu-nesme we finally corrected the PR, I propose to merge it. |
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:
Reviewers will merge only if all these checks are true.