-
Notifications
You must be signed in to change notification settings - Fork 8
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
An mpr improvements #109
An mpr improvements #109
Conversation
if isnan(centroidA[1]) || isnan(centroidB[1]) || | ||
isnan(centroidA[2]) || isnan(centroidB[2]) || | ||
isnan(centroidA[3]) || isnan(centroidB[3]) | ||
error("MPR: One of the absolute position or translation is NaN. Look at $(Modia3D.fullName(shapeA)): r_abs = $(shapeA.r_abs), R_abs = $(shapeA.R_abs) and $(Modia3D.fullName(shapeB)): r_abs = $(shapeB.r_abs), R_abs = $(shapeB.R_abs).") |
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.
Do you mean "position or orientation"?
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.
In this special case r_abs is NaN. I'm not sure if it is possible, that R_abs is NaN as well.
@GerhardHippmann What should I write?
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.
I don't know the problem, but "position or translation" does not make sense.
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.
The issue seems to be that function
@inline getCentroid(obj::Composition.Object3D)::SVector{3,Modia3D.MPRFloatType} = SVector{3,Modia3D.MPRFloatType}(obj.r_abs + obj.R_abs'*obj.centroid)
returns NaN. This in turn means that obj.centroid has NaN. This should not be the case. Please, figure out, why obj.centroid has NaN
In any case, please figure out why NaN appears (e.g. by introducing more NaN check statements, until you find the source). The NaN source must be fixed, not the error message.
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.
In this case obj.r_abs is NaN.
obj.centroid is computed and set once at the beginning of simulation. It does not change.
No description provided.