Run-time visualization

Description

Collaboration diagram for Run-time visualization:

Classes

class  chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >
 Customized Chrono Irrlicht visualization for modal analaysis. More...
 
class  chrono::modal::ChModalEventReceiver< ScalarType >
 Custom Irrlicht event receiver for modal analysis visualization. More...
 

Functions

 chrono::modal::ChModalEventReceiver< ScalarType >::ChModalEventReceiver (ChModalVisualSystemIrrlicht< ScalarType > *vsys)
 
virtual bool chrono::modal::ChModalEventReceiver< ScalarType >::OnEvent (const irr::SEvent &event)
 
virtual void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::Initialize () override
 Initialize the visualization system.
 
virtual void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::BeginScene (bool backBuffer, bool zBuffer, ChColor color) override
 Clean the canvas at the beginning of each rendering frame.
 
virtual void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::Render () override
 Render the Irrlicht scene and additional visual elements.
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetMode (int mode)
 Set the mode to be visualized. More...
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::ResetTimer ()
 Reset the timer used to generate the mode shape animation.
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetAmplitude (double amplitude)
 Set the amplitude of the mode shape animation. More...
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetSpeedFactor (double speed_factor)
 Set the speed factor of the mode shape animation. More...
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetFixedFrequency (bool val)
 Fix the frequency of the mode shape animation. More...
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::ResetInitialState ()
 Reset the initial state by retrieving the current state of the assembly.
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::AttachAssembly (const ChAssembly &assembly, const ChMatrixDynamic< ScalarType > &eigvects, const ChVectorDynamic< double > &freq)
 Attach the assembly to be visualized. More...
 
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::UpdateModes (const ChMatrixDynamic< ScalarType > &eigvects, const ChVectorDynamic< double > &freq)
 Update the eigenvectors and frequencies.
 
template<typename U = ScalarType>
std::enable_if< std::is_same< U, std::complex< double > >::value, void >::type chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::UpdateModes (const ChMatrixDynamic< ScalarType > &eigvects, const ChVectorDynamic< double > &freq, const ChVectorDynamic< double > &damping_ratios)
 Update the eigenvectors, frequencies, and damping ratios.
 
template<typename U = ScalarType>
std::enable_if< std::is_same< U, double >::value, ChVectorDynamic< double > >::type chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::GetModeShape (const ChVectorDynamic< double > &eigv, double angle)
 Get the mode shape at a specified angle from an eigenvector (real eigvect).
 
template<typename U = ScalarType>
std::enable_if< std::is_same< U, std::complex< double > >::value, ChVectorDynamic< double > >::type chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::GetModeShape (const ChVectorDynamic< std::complex< double >> &eigv, double angle)
 Get the mode shape at a specified angle from an eigenvector (complex eigvect).
 

Variables

ChAssemblychrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_assembly = nullptr
 
const ChMatrixDynamic< ScalarType > * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_eigvects = nullptr
 
const ChVectorDynamic< double > * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_freq = nullptr
 
const ChVectorDynamic< double > * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_damping_ratios = nullptr
 
int chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_selected_mode = 0
 currently selected mode
 
ChTimer chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_timer
 timer for mode shape animation
 
ChState chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_assembly_initial_state
 initial state of the assembly
 
double chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_amplitude = 1.0
 amplitude scaling of the mode shape animation
 
double chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_speed_factor = 1.0
 speed factor of the mode shape animation
 
bool chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_fixed_frequency = false
 fix the frequency of the animation
 
irr::gui::IGUIScrollBar * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::g_selected_mode
 
irr::gui::IGUIStaticText * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::g_selected_mode_info
 
irr::gui::IGUIEditBox * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::g_amplitude
 
irr::gui::IGUIEditBox * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::g_speed_factor
 
irr::gui::IGUICheckBox * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::g_fixed_frequency
 
ChModalEventReceiver< ScalarType > * chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::m_receiver
 

Function Documentation

◆ AttachAssembly()

template<typename ScalarType >
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::AttachAssembly ( const ChAssembly assembly,
const ChMatrixDynamic< ScalarType > &  eigvects,
const ChVectorDynamic< double > &  freq 
)

Attach the assembly to be visualized.

This function must be called before starting the simulation loop. The eigenvectors and frequencies must be provided, typically through ChModalSolverUndamped or ChModalSolverDamped.

◆ SetAmplitude()

template<typename ScalarType >
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetAmplitude ( double  amplitude)

Set the amplitude of the mode shape animation.

Eigenvectors are normalized and then multiplied by this amplitude.

◆ SetFixedFrequency()

template<typename ScalarType >
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetFixedFrequency ( bool  val)

Fix the frequency of the mode shape animation.

The frequency is then fixed to 1 Hz. This is useful to visualize the mode shape without the frequency effect. The speed factor is still applied.

◆ SetMode()

template<typename ScalarType >
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetMode ( int  mode)

Set the mode to be visualized.

The mode is specified as a 1-based index.

◆ SetSpeedFactor()

template<typename ScalarType >
void chrono::modal::ChModalVisualSystemIrrlicht< ScalarType >::SetSpeedFactor ( double  speed_factor)

Set the speed factor of the mode shape animation.

The frequency is multiplied by this factor.