Back

UpdateLinksVisitor

sofa::simulation::UpdateLinksVisitor
Visitor
Abstract (AI generated)

The `UpdateLinksVisitor` updates links between objects within simulation nodes to ensure proper setup and maintenance of constraints and mappings.

Metadata
module
Sofa.framework.Simulation.Core
namespace
sofa::simulation
include
sofa/simulation/UpdateLinksVisitor.h
inherits
  • Visitor
description

The OglVariable class in the SOFA framework is an abstract base class that defines uniform variables for use with shaders (OpenGL programs). This class does not directly contribute to the governing equations, operators, constitutive laws, or kinematic laws typically associated with finite element method (FEM) simulations. Instead, its role is purely related to visualization and rendering aspects of the simulation, which are necessary but do not involve mathematical operations on physical systems.

The OglVariable class supports various data types including integers (int, ivec2, ivec3, ivec4) and floating-point numbers (float, vec2, vec3, vec4), along with their vector counterparts. The key methods include:

  • setValue(const DataTypes &v): Sets the value of a uniform variable.

  • pushValue(): Abstract method that must be implemented by derived classes to push values onto the shader.

The class also includes initialization and update methods such as init, reinit, doInitVisual, and doUpdateVisual which ensure proper setup and updating during the visualization pipeline. These methods are part of the visual model framework in SOFA, ensuring that the graphical representation is consistent with the simulation state.


In summary, OglVariable does not contribute to the mathematical or physical aspects of FEM simulations but provides essential support for rendering and visualization within the SOFA framework.


Methods
void processObject (core::objectmodel::BaseObject * obj)
Result processNodeTopDown (simulation::Node * node) virtual
void processNodeBottomUp (simulation::Node * node) virtual
bool isThreadSafe () virtual
{
  "name": "UpdateLinksVisitor",
  "namespace": "sofa::simulation",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/UpdateLinksVisitor.h",
  "doc": "",
  "inherits": [
    "Visitor"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "processObject",
      "return_type": "void",
      "params": [
        {
          "name": "obj",
          "type": "core::objectmodel::BaseObject *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "processNodeTopDown",
      "return_type": "Result",
      "params": [
        {
          "name": "node",
          "type": "simulation::Node *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "processNodeBottomUp",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "simulation::Node *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "isThreadSafe",
      "return_type": "bool",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `UpdateLinksVisitor` is a visitor in the SOFA framework used to update links between objects within the simulation nodes. It inherits from the base `Visitor` class and primarily iterates over all objects in a node, calling their `updateLinks()` method during the top-down traversal of the scene graph. The `isThreadSafe()` method indicates that this visitor is thread-safe, meaning it can be safely used in parallelized contexts.\n\nIn terms of interactions within SOFA, `UpdateLinksVisitor` processes each object by invoking `processObject`, which updates its internal links. It also handles nodes via `processNodeTopDown` and `processNodeBottomUp` methods. The top-down method iterates through all objects in the node to update their links.\n\nPractical usage involves leveraging this visitor for ensuring that all relevant inter-object connections are correctly maintained during simulation, particularly after changes in the scene graph structure or object configurations.",
  "maths": "The `UpdateLinksVisitor` is a visitor class in the SOFA framework that does not directly contribute to any governing equations or operators such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), residual \\(R\\), etc. Instead, it plays an essential role in maintaining the integrity of the simulation graph and ensuring consistency among interconnected objects within nodes.\n\n### Role in FEM Pipeline\n- **Assembly Phase**: The `UpdateLinksVisitor` ensures that all necessary links between mechanical objects (e.g., constraints, mappings) are properly set up. This is crucial for correct assembly of global system matrices and forces.\n- **Constraint Handling**: It helps maintain the proper application of constraints by updating inter-object relationships.\n\n### Numerical Methods or Discretization Choices\nThe `UpdateLinksVisitor` does not encode any specific numerical methods or discretization choices but ensures that these are applied correctly. The visitor iterates through all objects in a node and calls their `updateLinks()` method, which is typically responsible for setting up constraints and mappings between mechanical objects.\n\n### Variational / Lagrangian Mechanics Framework\nWhile the `UpdateLinksVisitor` itself does not directly involve variational or Lagrangian mechanics formulations, it supports these frameworks by ensuring that all inter-object interactions are correctly set up. This includes maintaining consistent boundary conditions, constraint relationships, and force mappings necessary for solving the system of equations derived from variational principles.\n\n### Mathematical Content\nThe `UpdateLinksVisitor` does not have significant mathematical content; its primary function is to ensure proper setup and maintenance of links between objects in the simulation graph.",
  "abstract": "The `UpdateLinksVisitor` updates links between objects within simulation nodes to ensure proper setup and maintenance of constraints and mappings.",
  "sheet": "# UpdateLinksVisitor\n\n## Overview\nThe `UpdateLinksVisitor` is a visitor in the SOFA framework that iterates over all objects in a node, calling their `updateLinks()` method during top-down traversal. It ensures consistency among interconnected objects within nodes.\n\n## Dependencies and Connections\nThis component typically requires interaction with mechanical objects (e.g., constraints, mappings) to update inter-object relationships. It fits into the scene graph by traversing nodes and updating links between objects.\n\n## Practical Notes\nThe `UpdateLinksVisitor` is thread-safe and can be safely used in parallelized contexts. Ensure that all relevant inter-object connections are correctly maintained during simulation, particularly after changes in the scene graph structure or object configurations."
}