chrono::vsg3d::ChModalVisualizationVSG Class Reference

Description

VSG plugin for the run-time display of the mode shapes of an assembly.

At each frame, the plugin sets the positions of the assembly to

   x(t) = x0 + A (Re(u) sin(w t) + Im(u) cos(w t))

and its velocities to zero. Here x0 is the initial state of the assembly, u the eigenvector of the selected mode (its velocity-level part, normalized to unit length), A the amplitude, w = 2 pi f s, with f the frequency of the mode (or 1, see SetFixedFrequency) and s the speed factor, and t the wall-clock time in seconds. A GUI panel selects the mode, sets the amplitude, the speed factor and the fixed frequency, and shows the frequency and, if available, the damping ratio of the selected mode. The modes typically come from ChModalAnalysisUndamped (real eigenvectors) or ChModalAnalysisDamped (complex eigenvectors).

#include <ChModalVisualizationVSG.h>

Inheritance diagram for chrono::vsg3d::ChModalVisualizationVSG:
Collaboration diagram for chrono::vsg3d::ChModalVisualizationVSG:

Public Member Functions

void AttachAssembly (const ChAssembly &assembly, const ChMatrixDynamic< double > &eigvects, const ChVectorDynamic< double > &freq)
 Attach the assembly whose modes are displayed, with real eigenvectors and their frequencies. More...
 
void AttachAssembly (const ChAssembly &assembly, const ChMatrixDynamic< std::complex< double >> &eigvects, const ChVectorDynamic< double > &freq)
 Attach the assembly whose modes are displayed, with complex eigenvectors and their frequencies. More...
 
void UpdateModes (const ChMatrixDynamic< double > &eigvects, const ChVectorDynamic< double > &freq)
 Replace the modes with real eigenvectors and their frequencies.
 
void UpdateModes (const ChMatrixDynamic< std::complex< double >> &eigvects, const ChVectorDynamic< double > &freq)
 Replace the modes with complex eigenvectors and their frequencies.
 
void UpdateModes (const ChMatrixDynamic< std::complex< double >> &eigvects, const ChVectorDynamic< double > &freq, const ChVectorDynamic< double > &damping_ratios)
 Replace the modes with complex eigenvectors, their frequencies, and their damping ratios.
 
void SetMode (int mode)
 Select the mode to display, with a 1-based index.
 
void SetAmplitude (double amplitude)
 Set the amplitude A of the animation (default: 1).
 
void SetSpeedFactor (double speed_factor)
 Set the speed factor s of the animation (default: 1).
 
void SetFixedFrequency (bool val)
 Animate every mode with f = 1, so that only the speed factor sets the animation frequency (default: false).
 
void ResetInitialState ()
 Take the current state of the assembly as the state about which the modes are animated.
 
void ResetTimer ()
 Restart the animation from t = 0.
 
int GetNumModes () const
 Get the number of modes.
 
int GetMode () const
 Get the selected mode, with a 1-based index.
 
- Public Member Functions inherited from chrono::vsg3d::ChVisualSystemVSGPlugin
void AddEventHandler (std::shared_ptr< ChEventHandlerVSG > eh)
 TODO - remove AddEventHandler? A plugin can call the VSG system's AddEventHandler in its OnAttach() function. More...
 
ChVisualSystemVSG & GetVisualSystemVSG () const
 Get a reference to the VSG visual system to which the plugin was attached.
 

Friends

class ChModalGuiComponentVSG
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::vsg3d::ChVisualSystemVSGPlugin
virtual void OnAttach ()
 Allow this plugin to perform any operations when it is attached to a VSG visual system. More...
 
virtual void OnBindAssets ()
 Allow this plugin to perform any pre-binding operations. More...
 
- Protected Attributes inherited from chrono::vsg3d::ChVisualSystemVSGPlugin
std::vector< std::shared_ptr< ChEventHandlerVSG > > m_evhandler
 list of all additional event handlers
 
ChVisualSystemVSG * m_vsys
 associated VSG visual system
 

Member Function Documentation

◆ AttachAssembly() [1/2]

void chrono::vsg3d::ChModalVisualizationVSG::AttachAssembly ( const ChAssembly &  assembly,
const ChMatrixDynamic< double > &  eigvects,
const ChVectorDynamic< double > &  freq 
)

Attach the assembly whose modes are displayed, with real eigenvectors and their frequencies.

The current state of the assembly becomes the state about which the modes are animated. An assembly attached before is first returned to its initial state.

◆ AttachAssembly() [2/2]

void chrono::vsg3d::ChModalVisualizationVSG::AttachAssembly ( const ChAssembly &  assembly,
const ChMatrixDynamic< std::complex< double >> &  eigvects,
const ChVectorDynamic< double > &  freq 
)

Attach the assembly whose modes are displayed, with complex eigenvectors and their frequencies.

The current state of the assembly becomes the state about which the modes are animated. An assembly attached before is first returned to its initial state.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_vsg/plugins/ChModalVisualizationVSG.h
  • /builds/uwsbel/chrono/src/chrono_vsg/plugins/ChModalVisualizationVSG.cpp