Back

SimulationStopEvent

sofa::simulation::SimulationStopEvent
Event
Doc (from source)

Event fired when needed to stop the animation.

Abstract (AI generated)

`SimulationStopEvent` is an event class in SOFA that signals when it is necessary to stop ongoing animations or simulations.

Metadata
module
Sofa.framework.Simulation.Core
namespace
sofa::simulation
include
sofa/simulation/events/SimulationStopEvent.h
inherits
  • Event
description

The VisualModel in the SOFA framework is an interface that all visual models must implement to be visible within simulations. Its primary role is to handle the rendering and updating of graphical representations, rather than contributing to the physical or mechanical aspects of the simulation. Therefore, it does not directly involve governing equations such as the mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, or constitutive laws related to material behavior. Instead, its methods are focused on visual aspects and transformations.

Governing Equations and Operators

The VisualModel does not contribute to the governing equations of FEM. It is concerned with rendering and updating graphical representations rather than solving the mechanical system.

Constitutive or Kinematic Laws Involved

There are no constitutive laws involved in this component, as it deals purely with visual representation rather than material properties or kinematics. The transformations such as translation, rotation, and scaling (via applyTranslation, applyRotation, and applyScale) do not affect the mechanical state but instead change the graphical position, orientation, and size of the object.

Role in the Global FEM Pipeline

In the global FEM pipeline, the
- Rendering the visual representation (klzzwxh:0010).
- Updating internal data like normals after each simulation timestep (klzzwxh:0011).
- Initializing graphical resources (klzzwxh:0012).
- Clearing graphical resources when necessary (klzzwxh:0013).drawTransparent plays a role outside of the core mechanics. Its primary responsibilities are:), and pre/post rendering operations (

Numerical Methods or Discretization Choices

The VisualModel does not involve numerical methods related to discretization. Its methods are concerned with rendering and transformation, which do not require numerical integration or matrix assembly.

Fitting into the Broader Variational / Lagrangian Mechanics Framework

Since this component is focused on visualization rather than mechanics, it does not fit directly into the variational or Lagrangian framework of FEM. Its methods ensure that the visual representation of objects remains consistent with the mechanical state derived from the simulation.

Key Methods and Their Roles:

  • drawVisual: Renders the object based on the current state and visualization parameters (vparams).

  • updateVisual: Updates internal data (such as normals) after each timestep to ensure that the visual representation remains consistent with the mechanical state.

  • initVisual: Initializes graphical resources, such as textures and other graphical assets. Called once before the first frame is drawn or when the graphical context is recreated.

  • clearVisual: Cleans up any allocated graphical resources, typically called before deletion.

The component provides methods for managing various aspects of rendering, including shadows (drawShadow), transparency (drawTransparent plays a role outside of the core mechanics. Its primary responsibilities are:), and pre/post rendering operations (fwdDraw, bwdDraw). These ensure that the visual representation adheres to the intended display settings and context.

Methods
int getEventTypeIndex ()
bool checkEventType (const Event * event)
const char * GetClassName ()
{
  "name": "SimulationStopEvent",
  "namespace": "sofa::simulation",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/events/SimulationStopEvent.h",
  "doc": "Event fired when needed to stop the animation.",
  "inherits": [
    "Event"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "getEventTypeIndex",
      "return_type": "int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "checkEventType",
      "return_type": "bool",
      "params": [
        {
          "name": "event",
          "type": "const Event *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": true,
      "access": "public"
    },
    {
      "name": "GetClassName",
      "return_type": "const char *",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": true,
      "access": "public"
    }
  ],
  "description": "The `SimulationStopEvent` is an event in the SOFA framework, specifically within the `sofa::simulation` namespace. It inherits from the base `Event` class and serves to signal when it is necessary to stop the ongoing animation or simulation process.\n\nThis component primarily interacts with other components that handle events within the SOFA simulation loop. The event can be checked using the static method `checkEventType`, which takes an event pointer as input and returns a boolean indicating whether the given event is of type `SimulationStopEvent`. Additionally, it provides a method to retrieve its class name through `GetClassName`.\n\nPractical usage involves handling or checking for this specific event in the simulation loop to determine when the animation should be stopped. The component itself does not have any data fields but relies on methods to identify and handle event types.",
  "maths": "The `SimulationStopEvent` is an event class in the SOFA framework, designed to signal when it is necessary to stop ongoing animations or simulations. This component does not directly contribute to any governing equations, constitutive laws, kinematic models, or numerical methods associated with the Finite Element Method (FEM) simulation pipeline. Instead, its role is primarily within the event handling system of SOFA's simulation loop.\n\n**Mathematical and Physical Description:**\n\n- **Governing Equations/Operators:** None.\n  - The `SimulationStopEvent` does not implement or contribute to any specific mathematical operators or governing equations such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), residual \\(R\\), etc. It is purely a signaling mechanism within the simulation framework.\n\n- **Constitutive Laws/Kinematic Models:** None.\n  - The component does not involve any constitutive laws, strain measures, stress tensors, hyperelastic potentials, or kinematic models relevant to FEM formulations.\n\n- **Role in Global FEM Pipeline:**\n  - **Event Handling:** It is used within the event-driven architecture of SOFA. Its primary role is to signal when a simulation should be stopped.\n\n- **Numerical Methods/Discretization Choices:** None.\n  - The component does not encode any numerical methods or discretization choices relevant to FEM or other computational mechanics techniques.\n\n- **Integration into Variational/Lagrangian Mechanics Framework:**\n  - It integrates seamlessly into SOFA's broader framework by leveraging its event handling system. This ensures that the simulation loop can be halted at specific points as needed, facilitating user control and efficient management of complex simulations.\n\n**Summary: The `SimulationStopEvent` component is a signaling mechanism within the SOFA simulation architecture, designed to halt animations or simulations when necessary. It does not directly contribute to the mathematical or physical aspects of FEM simulations but plays a crucial role in event-driven simulation control.",
  "abstract": "`SimulationStopEvent` is an event class in SOFA that signals when it is necessary to stop ongoing animations or simulations.",
  "sheet": "\n# SimulationStopEvent\n\n## Overview\n\nThe `SimulationStopEvent` is a specialized event within the SOFA framework, specifically designed to signal the need to halt ongoing animations or simulations. It inherits from the base `Event` class and integrates seamlessly into SOFA's event-driven architecture.\n\n## Practical Notes\n\nThis component does not have any data fields or numerical parameters. Its primary role is to facilitate event handling within the simulation loop, allowing for controlled stopping of animations or simulations. The static method `checkEventType` can be used to verify if an incoming event is a `SimulationStopEvent`, and `GetClassName` provides its class name."
}