-
Notifications
You must be signed in to change notification settings - Fork 374
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
remove the exact integration in cube_to_target to avoid negative weights #6854
base: master
Are you sure you want to change the base?
remove the exact integration in cube_to_target to avoid negative weights #6854
Conversation
Can you describe what the PR does without referring to other github issues? |
@rljacob thanks for the suggestion, the description has been updated |
@@ -850,7 +850,8 @@ subroutine side_integral(& | |||
|
|||
if (xseg(1).EQ.xseg(2))then | |||
slope = bignum | |||
else if (abs(yseg(1) -yseg(2))<fuzzy_width) then | |||
!else if (abs(yseg(1) -yseg(2))<fuzzy_width) then !remove the exact integration |
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.
@jsbamboo let's change the wording on the comment on both of the commented lines to something more verbose and clear, I'm thinking:
"this will enable exact integration, which was found to create problematic negative weights"
A better solution would be to just add a logical switch controlled by a flag, but I'm fine with this solution as well.
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.
thanks! will push a commit with the first solution
@mt5555 is this ready? |
This is to fix the negative weights in cube_to_target.
In the experience of using the cube_to_target for regionally refined meshes, we encountered issues with large negative values for terr_target. This generally happened when the dx of the target mesh was comparable/smaller than the dx of the base cube.
@PeterHjortLauritzen helped us to identify the underlying reasons for the negative weights and suggested a solution. The current practice is to keep the exact integration algorithm, but never enable it—
Since the original version of the judgement condition is rich in semantics, the original judgement was not deleted but annotated.