-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fix errors in LB+Lees-Edwards #4829
Conversation
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.
looks good but I'm no expert in lees edwards
if (normal_shift < -std::numeric_limits<double>::epsilon()) { | ||
vel_shift[le.shear_direction] += le.shear_velocity; | ||
} | ||
} |
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.
is it on purpose that nothing happens if the normal shift is inbetween -epsilon and epsilon?
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.
Yes. normal_shift contains multiples of box_l or 0. We basally just want +-1 or 0, but tollerant to rounding errors. However, in one of teh two instances, where this appears, that integer is directly available in the shift variable, so I used that instead. In the other instance, I tried to make it clear by renaming the variables.
|
||
int target_idx = cell[dir]; | ||
auto ghost_fold = [dim](FloatType x) { | ||
while (x > dim) { |
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.
this also looks a lot like a modulo
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.
It isn't, actually. A modulo would be x>=n or x<n. Here, it's x>n or x<-1. This is, ebcause Walberla uses -1 and n to address the ghost layers.
# across the Lees Edwads boundary conditoin | ||
# if offset ^1<.5, it couples to the left neighbor | ||
# otherwise to the right | ||
if (offset % 1) >= .5: extra = 1 |
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.
ternary operator would look nicer than if-else without indentation
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.
Replaced by round()
Your pull request does not meet our code formatting rules. To fix this, please do one of the following:
You can run Please note that there are often multiple ways to correctly format code. As I am just a robot, I sometimes fail to identify the most aesthetically pleasing way. So please look over my suggested changes and adapt them where the style does not make sense. |
Your pull request does not meet our code style rules. Pylint summary:
You can generate these warnings with |
I'm closing this in favor of a new pr |
contains #4827
This
Fixes #
Description of changes: