Description

Run-time visualization support for Chrono::FSI systems.

Requires the Chrono::OpenGL module; if not available, most ChVisualizationFsi functions are no-op.

Note that using run-time visualization for a Chrono::FSI system incurs the penalty of collecting positions of all particles every time the Render() function is invoked.

#include <ChVisualizationFsi.h>

Public Types

enum  RenderMode { POINTS, WIREFRAME, SOLID }
 Rendering mode for particles and mesh objects.
 

Public Member Functions

 ChVisualizationFsi (ChSystemFsi *sysFSI)
 Create a run-time FSI visualization object associated with a given Chrono::Fsi system.
 
void SetTitle (const std::string &title)
 Set title of the visualization window (default: "").
 
void SetSize (int width, int height)
 Set window dimensions (default: 1280x720).
 
void SetCameraPosition (const ChVector<> &pos, const ChVector<> &target)
 Set camera position and target (look at) point.
 
void SetCameraUpVector (const ChVector<> &up)
 Set camera up vector (default: Z).
 
void SetCameraMoveScale (float scale)
 Set scale for camera movement increments (default: 0.1).
 
void SetParticleRenderMode (double radius, RenderMode mode=RenderMode::POINTS)
 Set visualization radius for SPH particles (default: half initial spacing). More...
 
void SetRenderMode (RenderMode mode)
 Set rendering mode for mesh objects (default: WIREFRAME).
 
void EnableInfoOverlay (bool val)
 Enable/disable information overlay (default: false).
 
void EnableFluidMarkers (bool val)
 Enable/disable rendering of fluid SPH particles (default: true).
 
void EnableRigidBodyMarkers (bool val)
 Enable/disable rendering of rigid-body BCE markers (default: true).
 
void EnableFlexBodyMarkers (bool val)
 Enable/disable rendering of flex-body BCE markers (default: true).
 
void EnableBoundaryMarkers (bool val)
 Enable/disable rendering of boundary BCE markers (default: false).
 
void AttachSystem (ChSystem *system)
 Attach a user-provided Chrono system for rendering. More...
 
void AddProxyBody (std::shared_ptr< ChBody > body)
 Add additional proxy body to supplemental system. More...
 
void Initialize ()
 Initialize the run-time visualization system. More...
 
bool Render ()
 Render the current state of the Chrono::Fsi system. More...
 

Member Function Documentation

◆ AddProxyBody()

void chrono::fsi::ChVisualizationFsi::AddProxyBody ( std::shared_ptr< ChBody body)

Add additional proxy body to supplemental system.

Must be called before Initialize(). The provided body is set fixed to ground and it is the caller's responsibility to update the position of this body before a call to Render().

◆ AttachSystem()

void chrono::fsi::ChVisualizationFsi::AttachSystem ( ChSystem system)
inline

Attach a user-provided Chrono system for rendering.

By default, the FSI run-time visualization renders SPH particles and BCE markers. This function can be used to also render the mechanical system interacting with the SPH system.

◆ Initialize()

void chrono::fsi::ChVisualizationFsi::Initialize ( )

Initialize the run-time visualization system.

If the Chrono::OpenGL module is not available, this function is no-op.

◆ Render()

bool chrono::fsi::ChVisualizationFsi::Render ( )

Render the current state of the Chrono::Fsi system.

This function, typically invoked from within the main simulation loop, can only be called after construction of the FSI system was completed (i.e., the system was initialized). This function querries the positions of all particles in the FSI system in order to update the positions of the proxy bodies. Returns false if the visualization window was closed. If the Chrono::OpenGL module is not available, this function is no-op.

◆ SetParticleRenderMode()

void chrono::fsi::ChVisualizationFsi::SetParticleRenderMode ( double  radius,
RenderMode  mode = RenderMode::POINTS 
)

Set visualization radius for SPH particles (default: half initial spacing).

Must be called before Initialize().


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