Back

MechanicalBeginIntegrationVisitor

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

Visitor used to prepare a time integration step. Typically, does nothing.

Abstract (AI generated)

The MechanicalBeginIntegrationVisitor prepares a time integration step in SOFA simulations by invoking the `beginIntegration(dt)` method on each encountered BaseMechanicalState.

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

The MechanicalBeginIntegrationVisitor is part of the SOFA simulation framework and is designed to prepare for a time integration step in mechanical simulations. It does not directly implement any governing equations, constitutive laws, or discretization methods itself. Instead, its role is procedural within the global FEM pipeline.

Role in the Global FEM Pipeline:

The MechanicalBeginIntegrationVisitor operates during the time integration phase of the simulation process. Specifically, it invokes the beginIntegration(dt) method on each encountered BaseMechanicalState. This method call signals that a new time step is about to begin and allows for any necessary preparation or initialization within the mechanical states.

Constitutive Laws and Governing Equations:

The visitor itself does not contribute directly to governing equations such as the mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc. Instead, it ensures that these components are appropriately prepared for the upcoming time step.

Numerical Methods and Discretization Choices:

The MechanicalBeginIntegrationVisitor does not implement any numerical methods or discretization choices directly. Its function is to prepare the mechanical states by calling beginIntegration(dt), which may internally involve setting up the necessary matrices, forces, and other data structures for subsequent operations like assembly of global operators, nonlinear solve, linear solve, etc.

Thread Safety:

The visitor is designed to be thread-safe (isThreadSafe() returns true), allowing it to operate in parallel environments without causing race conditions or other concurrency issues. This is particularly useful in large-scale simulations where parallel processing can significantly speed up the simulation process.

Constraint Handling and Mappings:

The stopAtMechanicalMapping() method indicates that this visitor will traverse through all mechanical mappings (return false), ensuring that it operates on all relevant parts of the scene graph without stopping prematurely at any mapping nodes. This ensures comprehensive preparation for time integration across the entire simulation domain.

Summary:

The MechanicalBeginIntegrationVisitor plays a preparatory role in the SOFA framework, signaling and preparing mechanical states for the upcoming time step during the time integration phase of the FEM simulation pipeline. Its main function is to call beginIntegration(dt) on each encountered mechanical state, ensuring that all necessary preparations are made before advancing to subsequent steps like assembly, nonlinear solve, linear solve, etc.

Methods
Result fwdMechanicalState (simulation::Node * , sofa::core::behavior::BaseMechanicalState * mm) virtual
Result fwdMappedMechanicalState (simulation::Node * , sofa::core::behavior::BaseMechanicalState * mm) virtual
bool stopAtMechanicalMapping (simulation::Node * , sofa::core::BaseMapping * ) virtual
bool isThreadSafe () virtual
{
  "name": "MechanicalBeginIntegrationVisitor",
  "namespace": "sofa::simulation::mechanicalvisitor",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.h",
  "doc": "Visitor used to prepare a time integration step. Typically, does nothing.",
  "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": "stopAtMechanicalMapping",
      "return_type": "bool",
      "params": [
        {
          "name": "",
          "type": "simulation::Node *"
        },
        {
          "name": "",
          "type": "sofa::core::BaseMapping *"
        }
      ],
      "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 `MechanicalBeginIntegrationVisitor` is part of the SOFA simulation framework and belongs to the `sofa::simulation::mechanicalvisitor` namespace within the `Sofa.framework.Simulation.Core` module. This visitor class prepares a time integration step in mechanical simulations by calling the `beginIntegration(dt)` method on each `BaseMechanicalState`. The component inherits from `BaseMechanicalVisitor`, making it a specialized visitor designed to interact with the mechanical state of simulation nodes.\n\nThe `MechanicalBeginIntegrationVisitor` interacts primarily with the following components:\n- **Node**: Represents a node in the scene graph, through which this visitor navigates.\n- **BaseMechanicalState**: This interface provides access to the mechanical state of objects within the simulation. The methods `fwdMechanicalState` and `fwdMappedMechanicalState` are overridden to call `beginIntegration(dt)` on each encountered `BaseMechanicalState`.\n\nThe visitor is thread-safe and does not stop at mechanical mappings, meaning it will traverse through all mappings during its visitation process. It requires no additional data fields or links beyond those inherited from the base class.",
  "maths": "The `MechanicalBeginIntegrationVisitor` is part of the SOFA simulation framework and is designed to prepare for a time integration step in mechanical simulations. It does not directly implement any governing equations, constitutive laws, or discretization methods itself. Instead, its role is procedural within the global FEM pipeline.\n\n### Role in the Global FEM Pipeline:\nThe `MechanicalBeginIntegrationVisitor` operates during the **time integration phase** of the simulation process. Specifically, it invokes the `beginIntegration(dt)` method on each encountered `BaseMechanicalState`. This method call signals that a new time step is about to begin and allows for any necessary preparation or initialization within the mechanical states.\n\n### Constitutive Laws and Governing Equations:\nThe visitor itself does not contribute directly to governing equations such as the mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), residual \\(R\\), etc. Instead, it ensures that these components are appropriately prepared for the upcoming time step.\n\n### Numerical Methods and Discretization Choices:\nThe `MechanicalBeginIntegrationVisitor` does not implement any numerical methods or discretization choices directly. Its function is to prepare the mechanical states by calling `beginIntegration(dt)`, which may internally involve setting up the necessary matrices, forces, and other data structures for subsequent operations like assembly of global operators, nonlinear solve, linear solve, etc.\n\n### Thread Safety:\nThe visitor is designed to be thread-safe (`isThreadSafe() returns true`), allowing it to operate in parallel environments without causing race conditions or other concurrency issues. This is particularly useful in large-scale simulations where parallel processing can significantly speed up the simulation process.\n\n### Constraint Handling and Mappings:\nThe `stopAtMechanicalMapping()` method indicates that this visitor will traverse through all mechanical mappings (`return false`), ensuring that it operates on all relevant parts of the scene graph without stopping prematurely at any mapping nodes. This ensures comprehensive preparation for time integration across the entire simulation domain.\n\n### Summary:\nThe `MechanicalBeginIntegrationVisitor` plays a preparatory role in the SOFA framework, signaling and preparing mechanical states for the upcoming time step during the **time integration phase** of the FEM simulation pipeline. Its main function is to call `beginIntegration(dt)` on each encountered mechanical state, ensuring that all necessary preparations are made before advancing to subsequent steps like assembly, nonlinear solve, linear solve, etc.",
  "abstract": "The MechanicalBeginIntegrationVisitor prepares a time integration step in SOFA simulations by invoking the `beginIntegration(dt)` method on each encountered BaseMechanicalState.",
  "sheet": "<h1>MechanicalBeginIntegrationVisitor</h1>\n\n<h2>Overview</h2>\n<p>The <code>MechanicalBeginIntegrationVisitor</code> is a visitor component in the SOFA framework that prepares for time integration steps. It inherits from <code>BaseMechanicalVisitor</code> and signals the beginning of a new time step by calling the <code>beginIntegration(dt)</code> method on each encountered <code>BaseMechanicalState</code>.</p>\n\n<h2>Dependencies and Connections</h2>\n<p>This visitor interacts with:</p>\n<ul>\n<li><strong>Node</strong>: Represents a node in the scene graph, through which this visitor navigates.</li>\n<li><strong>BaseMechanicalState</strong>: Provides access to the mechanical state of objects within the simulation. The methods <code>fwdMechanicalState</code> and <code>fwdMappedMechanicalState</code> are overridden to call <code>beginIntegration(dt)</code> on each encountered <code>BaseMechanicalState</code>.</li>\n</ul>"
}