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

Throw on box change #2031

Merged
merged 12 commits into from
Jul 13, 2018
Merged

Throw on box change #2031

merged 12 commits into from
Jul 13, 2018

Conversation

fweik
Copy link
Contributor

@fweik fweik commented Jun 18, 2018

Preliminary throw an error if the box size is changed with active constraints,
this does not work properly with all shapes and can have some non-intuiitive
side effects. Also removed CONSTRAINT feature and moved constraints out
of the short range loop.

@fweik fweik changed the title Throw on box change WIP: Throw on box change Jun 18, 2018
@jonaslandsgesell
Copy link
Member

Some test cases might still contain a check for the constraint feature. E.g. constraint_shape_based.py

@fweik fweik changed the title WIP: Throw on box change Throw on box change Jul 12, 2018
@fweik
Copy link
Contributor Author

fweik commented Jul 12, 2018

Ready for review.

@fweik fweik requested a review from KaiSzuttor July 12, 2018 22:06
void on_boxl_change() const {
if (not this->empty()) {
throw std::runtime_error("The box size can not be changed because there "
"are active constraints. " +
Copy link
Member

Choose a reason for hiding this comment

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

Can you please change the order of the strings, we get a nicer error message then.

Copy link
Member

@KaiSzuttor KaiSzuttor left a comment

Choose a reason for hiding this comment

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

LGTM besides comment

@codecov
Copy link

codecov bot commented Jul 13, 2018

Codecov Report

❗ No coverage uploaded for pull request base (python@2812a92). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             python   #2031   +/-   ##
========================================
  Coverage          ?     63%           
========================================
  Files             ?     443           
  Lines             ?   28239           
  Branches          ?       0           
========================================
  Hits              ?   17791           
  Misses            ?   10448           
  Partials          ?       0
Impacted Files Coverage Δ
src/core/ObjectRegistry.hpp 100% <ø> (ø)
src/core/forces_inline.hpp 68% <ø> (ø)
src/core/constraints/ShapeBasedConstraint.hpp 80% <ø> (ø)
src/core/lb.cpp 68% <ø> (ø)
src/script_interface/constraints/initialize.cpp 100% <ø> (ø)
src/core/energy_inline.hpp 54% <ø> (ø)
src/core/polymer.cpp 27% <ø> (ø)
src/core/constraints/Constraint.hpp 50% <100%> (ø)
src/core/constraints/Constraints.hpp 100% <100%> (ø)
src/core/constraints.cpp 100% <100%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2812a92...ab5b6d0. Read the comment docs.

@fweik fweik merged commit af8bb35 into espressomd:python Jul 13, 2018
@fweik fweik deleted the throw_on_box_change branch July 13, 2018 12:45
kodiakhq bot added a commit that referenced this pull request Aug 25, 2023
Description of changes:
- Resizing the box now throws a runtime error if there are constraints present, since constraint preconditions might no longer be fulfilled (e.g. a wall constraint might end up outside the box boundaries when the box shrinks)
- This feature was originally introduced in ESPResSo 4.0.0 (#2031), but never actually worked because the PR accidentally removed the event function call during merge conflict resolution
jngrad pushed a commit to jngrad/espresso that referenced this pull request Dec 5, 2023
Description of changes:
- Resizing the box now throws a runtime error if there are constraints present, since constraint preconditions might no longer be fulfilled (e.g. a wall constraint might end up outside the box boundaries when the box shrinks)
- This feature was originally introduced in ESPResSo 4.0.0 (espressomd#2031), but never actually worked because the PR accidentally removed the event function call during merge conflict resolution
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.

3 participants