Back

UpdateMappingVisitor

sofa::simulation::UpdateMappingVisitor
Visitor
Doc (from source)

propagating position and velocity through non-mechanical mappings (while MechanicalPropagateOnlyPositionAndVelocityVisitor is propagating mechanical mappings)

Abstract (AI generated)

The `UpdateMappingVisitor` propagates position and velocity through non-mechanical mappings within the SOFA framework, ensuring consistent state updates across different parts of the scene graph.

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

The UpdateMappingVisitor is a visitor component in the SOFA framework that handles the propagation of position and velocity updates through non-mechanical mappings. It does not directly contribute to the governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc., but rather ensures consistency in the state update phase of the FEM pipeline.

Role in the Global FEM Pipeline

  • Assembly Phase: The UpdateMappingVisitor does not contribute to the assembly process, which involves constructing global mass and force matrices from element contributions.
  • Time Integration: During time integration, position and velocity updates are propagated through mappings using this visitor.
  • Nonlinear Solve: This component is not directly involved in solving nonlinear systems of equations.
  • Linear Solve: The visitor does not participate in linear solvers or preconditioning steps.
  • Constraint Handling: It ensures that constraints on positions and velocities are properly updated across different parts of the scene graph through mappings.
  • State Update: The UpdateMappingVisitor is critical for updating the state (positions and velocities) after a time step, ensuring consistency in the simulation.

Numerical Methods or Discretization Choices

The processMapping method applies mappings to update positions and velocities. Specifically, it uses the following operations:
- Position Update:
$$ x_s = P(x_m) $$

where $x_s$ is the slave DOF position and $x_m$ is the master DOF position.
- Velocity Update:
$$ v_s = J(P)^{-1}v_m $$

where $J(P)$ is the Jacobian of the mapping function $P$.

Mathematical Content and Physical Laws Involved

The UpdateMappingVisitor does not directly involve constitutive laws, strain measures, stress tensors, or hyperelastic potentials. Instead, it ensures that mappings (which may represent geometric constraints, multi-resolution couplings, attachments, etc.) are correctly applied to maintain consistency in the simulation state.

Variational / Lagrangian Mechanics Framework

While UpdateMappingVisitor does not directly contribute to variational formulations or Lagrangian mechanics principles, it supports the broader framework by ensuring that position and velocity updates are consistently propagated through the scene graph. This is crucial for maintaining mechanical invariants across different parts of the simulation.

Methods
void processMapping (simulation::Node * node, core::BaseMapping * obj)
void processMechanicalMapping (simulation::Node * , core::BaseMapping * obj)
Result processNodeTopDown (simulation::Node * node) virtual
const char * getCategoryName () virtual
bool isThreadSafe () virtual
{
  "name": "UpdateMappingVisitor",
  "namespace": "sofa::simulation",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/UpdateMappingVisitor.h",
  "doc": "propagating position and velocity through non-mechanical mappings\n(while MechanicalPropagateOnlyPositionAndVelocityVisitor is propagating mechanical mappings)",
  "inherits": [
    "Visitor"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "processMapping",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "simulation::Node *"
        },
        {
          "name": "obj",
          "type": "core::BaseMapping *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "processMechanicalMapping",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "simulation::Node *"
        },
        {
          "name": "obj",
          "type": "core::BaseMapping *"
        }
      ],
      "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": "getCategoryName",
      "return_type": "const char *",
      "params": [],
      "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 `UpdateMappingVisitor` is a visitor component in the SOFA framework that propagates position and velocity through non-mechanical mappings, while `MechanicalPropagateOnlyPositionAndVelocityVisitor` handles mechanical mappings. It processes nodes top-down to apply mappings and update positions and velocities accordingly.\n\n**Interactions with other components:**\nThe component interacts primarily with nodes and mappings within the SOFA scenegraph structure. Specifically, it uses the `processMapping` method for non-mechanical mappings and the `processMechanicalMapping` method for mechanical mappings. It leverages the visitor pattern to traverse and update elements in the simulation.\n\n**Practical Usage:**\nThe component is used internally by the SOFA framework to ensure that position and velocity updates are properly propagated through various mappings within a scene. Users typically do not need to interact directly with this component but can rely on its functionality as part of the broader simulation pipeline.",
  "maths": "The `UpdateMappingVisitor` is a visitor component in the SOFA framework that handles the propagation of position and velocity updates through non-mechanical mappings. It does not directly contribute to the governing equations or operators such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), residual \\(R\\), etc., but rather ensures consistency in the state update phase of the FEM pipeline.\n\n### Role in the Global FEM Pipeline\n- **Assembly Phase:** The `UpdateMappingVisitor` does not contribute to the assembly process, which involves constructing global mass and force matrices from element contributions.\n- **Time Integration:** During time integration, position and velocity updates are propagated through mappings using this visitor.\n- **Nonlinear Solve:** This component is not directly involved in solving nonlinear systems of equations.\n- **Linear Solve:** The visitor does not participate in linear solvers or preconditioning steps.\n- **Constraint Handling:** It ensures that constraints on positions and velocities are properly updated across different parts of the scene graph through mappings.\n- **State Update:** The `UpdateMappingVisitor` is critical for updating the state (positions and velocities) after a time step, ensuring consistency in the simulation.\n\n### Numerical Methods or Discretization Choices\nThe `processMapping` method applies mappings to update positions and velocities. Specifically, it uses the following operations:\n- **Position Update:**\n  \\[ x_s = P(x_m) \\]\n  where \\(x_s\\) is the slave DOF position and \\(x_m\\) is the master DOF position.\n- **Velocity Update:**\n  \\[ v_s = J(P)^{-1}v_m \\]\n  where \\(J(P)\\) is the Jacobian of the mapping function \\(P\\).\n\n### Mathematical Content and Physical Laws Involved\nThe `UpdateMappingVisitor` does not directly involve constitutive laws, strain measures, stress tensors, or hyperelastic potentials. Instead, it ensures that mappings (which may represent geometric constraints, multi-resolution couplings, attachments, etc.) are correctly applied to maintain consistency in the simulation state.\n\n### Variational / Lagrangian Mechanics Framework\nWhile `UpdateMappingVisitor` does not directly contribute to variational formulations or Lagrangian mechanics principles, it supports the broader framework by ensuring that position and velocity updates are consistently propagated through the scene graph. This is crucial for maintaining mechanical invariants across different parts of the simulation.",
  "abstract": "The `UpdateMappingVisitor` propagates position and velocity through non-mechanical mappings within the SOFA framework, ensuring consistent state updates across different parts of the scene graph.",
  "sheet": "# UpdateMappingVisitor\n\n**Overview:**\nThe `UpdateMappingVisitor` is a visitor component in the SOFA framework that propagates position and velocity through non-mechanical mappings. It ensures consistency in the state update phase by applying mappings to nodes within the simulation.\n\n**Dependencies and Connections:**\nThe component interacts with nodes and mappings within the SOFA scene graph structure, specifically using the `processMapping` method for non-mechanical mappings and the `processMechanicalMapping` method for mechanical mappings. It leverages the visitor pattern to traverse and update elements in the simulation.\n\n**Practical Notes:**\nThe component is used internally by the SOFA framework to ensure that position and velocity updates are properly propagated through various mappings within a scene. Users typically do not need to interact directly with this component but can rely on its functionality as part of the broader simulation pipeline."
}