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

An mpr improvements #109

Merged
merged 8 commits into from
Apr 5, 2022
Merged

An mpr improvements #109

merged 8 commits into from
Apr 5, 2022

Conversation

AndreaNeumayr
Copy link
Member

No description provided.

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).")
Copy link
Collaborator

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"?

Copy link
Member Author

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?

Copy link
Collaborator

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.

Copy link
Member

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.

Copy link
Member Author

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.

@AndreaNeumayr AndreaNeumayr merged commit bef2493 into main Apr 5, 2022
@AndreaNeumayr AndreaNeumayr deleted the an_mprImprovements branch May 6, 2022 11:33
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