-
Notifications
You must be signed in to change notification settings - Fork 2
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 bug on non-diagonal tensor components of prisms #27
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The non-diagonal tensor components of the prism have a bug due to a wrong evaluation of the logarithmic function. Add two tests that catch the bug on the g_en component.
Implement a modified version of the log function proposed by Fukushima (2020). It now takes both the shifted coordinate and the distance r (instead of the whole argument of the log function) since it returns slightly different things based on the value of those parameters.
santisoler
changed the title
Solve bug on non-diagonal tensor components of prisms
Fix bug on non-diagonal tensor components of prisms
Dec 2, 2022
After evaluating the limit of g_en on points above the vertices I found that it can be written as ln(|z1| / |z2|) which translates into [- ln(|z2|) ] - [- ln(|z1|)]. So for x < 0 and r = -x i the safe_log returns -ln(|x|).
Apply the new derived formula not from the limit, but directly from inverting the z axis.
Instead of checking through directions, check with observation points around the observation point that could have wrong results.
santisoler
commented
Dec 12, 2022
santisoler
commented
Dec 12, 2022
The additional tests corroborate that this PR fixes the bug. I'm merging this 🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix a bug on the non-diagonal tensor components of the prism due to a wrong
evaluation of the logarithmic function. Add two tests that catch the bug on the
g_en component. Correctly evaluate the log function present in the non-diagonal
tensor components when the shifted coordinate
x
of the vertex is negative andit's equal to the negative of the distance
r
between the vertex and thecomputation point. In that case the
log(x + r)
can be replaced by-log(2|x|)
. Also, implement a modified version of the log function proposedby Fukushima (2020) for cases where the shifted coordinate of the node is
negative but different than the negative of the distance: improves the accuracy
when evaluating the log function on very small values. Now the
_safe_log
function takes two arguments instead of one: the shifted coordinate
x
and thedistance
r
.