jgerstmayr / EXUDYN

Multibody Dynamics Simulation: Rigid and flexible multibody systems
https://www.youtube.com/channel/UCsQD2bIPBXB_4J23WtqKkVw/playlists
Other
166 stars 23 forks source link

Visualize Scaled Beam Deformations #71

Closed jgerstmayr closed 3 months ago

jgerstmayr commented 3 months ago

Discussed in https://github.com/jgerstmayr/EXUDYN/discussions/70

Originally posted by **SimonAndreas** June 19, 2024 Currently I am using 2D beam elements (ObjectBeamGeometricallyExact2D) and I would like to visualize scaled beam deformations (e.g. exaggerated beam deflection) such that it is easier to interpret small deformations using the SolutionsViewer(). Should I use “SC.visualizationSettings.bodies.deformationScaleFactor” for this purpose or does a different function exist? Namely, I tried the beforementioned function but unfortunately nothing changed in the visualization; the deformations were still very small. Is it possible that I made a mistake when using this setting? Thank you in advance.
jgerstmayr commented 3 months ago

the deformationScaleFactor is only available for FFRF and FFRFreducedOrder objects. If you like to draw your solution magnified, you have to do that manually using the solution data.

In a static solution, you can just scale the displacements of nodes by a certain factor (keeping the reference values unchanged). If you only have beams in your model, you could just do something like:

systemContainer=exudyn.SystemContainer()
mbs = systemContainer.AddSystem()

#Assemble, solve system
...

#get solution and magnify
u = mbs.systemData.GetODE2Coordinates() #take current solution

#magnify solution by factor 10:
mbs.systemData.SetODE2Coordinates(10*u, configuration=exudyn.ConfigurationType.Visualization)

exu.StartRenderer()
mbs.WaitForUserToContinue()
exu.StopRenderer()