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

Implicitly call update!(ch) in close!(ch). #459

Merged
merged 1 commit into from
Dec 22, 2022
Merged

Conversation

fredrikekre
Copy link
Member

@fredrikekre fredrikekre commented Jun 30, 2022

Fixes #207, closes #213, closes #435.

@termi-official
Copy link
Member

Maybe the feature conflict can be resolved by putting a reference to p into the constraint handler?

@fredrikekre fredrikekre marked this pull request as ready for review December 21, 2022 17:25
@fredrikekre fredrikekre reopened this Dec 21, 2022
@fredrikekre
Copy link
Member Author

I updated this PR a bit and intend to merge it. It now adds the call to update!(ch) in close!(ch), but also allows specifying function of the form f(x) for the common case where they don't depend on time.

@fredrikekre
Copy link
Member Author

Regarding #435, if one needs something like that it can be managed by using a closure over a mutable state.

@fredrikekre fredrikekre changed the title Implicitly call update!(ch, 0) in close!(ch). Implicitly call update!(ch) in close!(ch). Dec 21, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2022

Codecov Report

Base: 92.91% // Head: 92.92% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (0bc5e29) compared to base (b2f5868).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #459   +/-   ##
=======================================
  Coverage   92.91%   92.92%           
=======================================
  Files          27       27           
  Lines        4109     4111    +2     
=======================================
+ Hits         3818     3820    +2     
  Misses        291      291           
Impacted Files Coverage Δ
src/Dofs/ConstraintHandler.jl 95.93% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

This patch adds an implicit call to update! when closing the
ConstraintHandler. This step is easy to forget, in particular if your
problem doesn't depend on time at all. In addition, it is now possible
to specify constraint functions of the form f(x) directly.

Fixes #207, closes #213, closes #435.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Having to send a time into the function for constraints is a design failure.
3 participants