Back

MechanicalResetForceVisitor

sofa::simulation::mechanicalvisitor::MechanicalResetForceVisitor
BaseMechanicalVisitor
Doc (from source)

Reset the force in all the MechanicalModel This action is typically applied before accumulating all the forces.

Abstract (AI generated)

Resets the force vector in all MechanicalModels before accumulating new forces, ensuring proper initialization during simulation steps.

Metadata
module
Sofa.framework.Simulation.Core
namespace
sofa::simulation::mechanicalvisitor
include
sofa/simulation/mechanicalvisitor/MechanicalResetForceVisitor.h
inherits
  • BaseMechanicalVisitor
description

The MechanicalResetForceVisitor is a visitor component within the SOFA framework that resets forces in all MechanicalModels before accumulating new forces during the simulation process. This ensures proper initialization and accumulation of forces, maintaining numerical consistency throughout the simulation.

Governing Equations or Operators:

  • Force Reset: The MechanicalResetForceVisitor does not directly implement any governing equations or operators but instead contributes to resetting the force vector in mechanical models. Mathematically, this operation can be described as setting all force components to zero before new forces are accumulated.

Constitutive or Kinematic Laws Involved:

  • None: The MechanicalResetForceVisitor does not involve any constitutive or kinematic laws directly. It is purely a procedural component designed to reset the force vector in mechanical states before applying other forces (e.g., internal and external forces).

Role in the Global FEM Pipeline:

  • Assembly Phase: This visitor operates during the assembly phase of the simulation pipeline, specifically before any new forces are accumulated. By resetting forces, it ensures that only the most recent force contributions are considered.
  • Time Integration: Although not directly involved in time integration schemes (such as implicit Euler or Newmark), this component supports the consistency of the overall numerical process by ensuring proper initialization of forces at each timestep.

Numerical Methods or Discretization Choices Encoded:

  • None: The MechanicalResetForceVisitor does not encode any specific numerical methods or discretization choices. Its primary function is to reset force vectors, which is a preparatory step for subsequent operations involving internal and external forces.

Fit into the Broader Variational / Lagrangian Mechanics Framework:

  • Preparation for Forces Accumulation: Within the broader variational and Lagrangian mechanics framework of FEM simulations, this visitor ensures that force accumulation starts from zero at each simulation step. This is crucial for maintaining physical consistency and numerical stability throughout the simulation.

In summary, the MechanicalResetForceVisitor plays a critical role in ensuring that forces are properly initialized before any new forces (e.g., internal or external) are accumulated during the FEM simulation process.

Methods
Result fwdMechanicalState (simulation::Node * , sofa::core::behavior::BaseMechanicalState * mm) virtual
Result fwdMappedMechanicalState (simulation::Node * , sofa::core::behavior::BaseMechanicalState * mm) virtual
int getInfos ()
bool isThreadSafe () virtual
{
  "name": "MechanicalResetForceVisitor",
  "namespace": "sofa::simulation::mechanicalvisitor",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/mechanicalvisitor/MechanicalResetForceVisitor.h",
  "doc": "Reset the force in all the MechanicalModel\nThis action is typically applied before accumulating all the forces.",
  "inherits": [
    "BaseMechanicalVisitor"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "fwdMechanicalState",
      "return_type": "Result",
      "params": [
        {
          "name": "",
          "type": "simulation::Node *"
        },
        {
          "name": "mm",
          "type": "sofa::core::behavior::BaseMechanicalState *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "fwdMappedMechanicalState",
      "return_type": "Result",
      "params": [
        {
          "name": "",
          "type": "simulation::Node *"
        },
        {
          "name": "mm",
          "type": "sofa::core::behavior::BaseMechanicalState *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getInfos",
      "return_type": "int",
      "params": [],
      "is_virtual": false,
      "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 `MechanicalResetForceVisitor` is part of the SOFA framework's simulation core module and is responsible for resetting the force in all MechanicalModels. This action typically occurs before accumulating forces, ensuring that forces are properly initialized. It inherits from `BaseMechanicalVisitor`, indicating its role in visiting mechanical states within a simulation.\n\n**Interactions with Other Components: **\n- The component interacts with `simulation::Node` and `sofa::core::behavior::BaseMechanicalState` to apply force reset operations through the methods `fwdMechanicalState` and `fwdMappedMechanicalState`. These methods override the corresponding virtual functions from `BaseMechanicalVisitor`, ensuring that forces are correctly reset during simulation steps.\n- It is thread-safe, as indicated by the `isThreadSafe` method returning `true`, allowing for parallel execution when needed.\n\n**Practical Usage Guidance: **\n- This component is automatically invoked within the SOFA framework's mechanical pipeline. No explicit user interaction is required beyond setting up the simulation environment correctly.\n- The `onlyMapped` flag can be used to specify whether only mapped states should have their forces reset.",
  "maths": "The `MechanicalResetForceVisitor` is a visitor component within the SOFA framework that resets forces in all MechanicalModels before accumulating new forces during the simulation process. This ensures proper initialization and accumulation of forces, maintaining numerical consistency throughout the simulation.\n\n### Governing Equations or Operators:\n- **Force Reset:** The `MechanicalResetForceVisitor` does not directly implement any governing equations or operators but instead contributes to resetting the force vector in mechanical models. Mathematically, this operation can be described as setting all force components to zero before new forces are accumulated.\n\n### Constitutive or Kinematic Laws Involved:\n- **None:** The `MechanicalResetForceVisitor` does not involve any constitutive or kinematic laws directly. It is purely a procedural component designed to reset the force vector in mechanical states before applying other forces (e.g., internal and external forces).\n\n### Role in the Global FEM Pipeline:\n- **Assembly Phase:** This visitor operates during the assembly phase of the simulation pipeline, specifically before any new forces are accumulated. By resetting forces, it ensures that only the most recent force contributions are considered.\n- **Time Integration:** Although not directly involved in time integration schemes (such as implicit Euler or Newmark), this component supports the consistency of the overall numerical process by ensuring proper initialization of forces at each timestep.\n\n### Numerical Methods or Discretization Choices Encoded:\n- **None:** The `MechanicalResetForceVisitor` does not encode any specific numerical methods or discretization choices. Its primary function is to reset force vectors, which is a preparatory step for subsequent operations involving internal and external forces.\n\n### Fit into the Broader Variational / Lagrangian Mechanics Framework:\n- **Preparation for Forces Accumulation:** Within the broader variational and Lagrangian mechanics framework of FEM simulations, this visitor ensures that force accumulation starts from zero at each simulation step. This is crucial for maintaining physical consistency and numerical stability throughout the simulation.\n\nIn summary, the `MechanicalResetForceVisitor` plays a critical role in ensuring that forces are properly initialized before any new forces (e.g., internal or external) are accumulated during the FEM simulation process.",
  "abstract": "Resets the force vector in all MechanicalModels before accumulating new forces, ensuring proper initialization during simulation steps.",
  "sheet": "# MechanicalResetForceVisitor\n\n## Overview\nThe `MechanicalResetForceVisitor` is a visitor component within the SOFA framework that resets the force vector in all MechanicalModels before accumulating new forces. This ensures proper initialization and accumulation of forces at each timestep.\n\n## Dependencies and Connections\nThis component interacts with `simulation::Node` and `sofa::core::behavior::BaseMechanicalState` through methods such as `fwdMechanicalState` and `fwdMappedMechanicalState`. It is typically invoked within the SOFA framework's mechanical pipeline to reset forces before new forces are accumulated."
}