Back

TopologyChangeVisitor

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

The `TopologyChangeVisitor` manages and propagates topological structure changes within a SOFA simulation by traversing nodes and objects to ensure consistency across dependent components.

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

The TopologyChangeVisitor in the SOFA framework is designed to handle changes in topological structures within a simulation. This visitor class ensures that any modifications made to the topology, such as adding or removing elements, are correctly propagated through the system. The primary role of this component is to process these topology changes and update dependent components accordingly.

Governing Equations and Operators

The TopologyChangeVisitor does not directly contribute to the governing equations like mass matrix $M$, stiffness matrix $K$, internal force vector $f_{int}$, or residual $R$. Instead, it manages the topological structure changes that can indirectly affect these matrices and vectors by modifying the connectivity and element configurations in the mesh.

Constitutive or Kinematic Laws Involved

While the TopologyChangeVisitor itself does not implement constitutive laws such as strain measures, stress tensors, hyperelastic potentials, or constraint Jacobians, it ensures that any changes to these topological structures are correctly applied. This includes updating mappings and constraints that may be influenced by topology modifications.

Role in the Global FEM Pipeline

In the context of the global Finite Element Method (FEM) pipeline, TopologyChangeVisitor plays a crucial role during the assembly phase. Specifically:

  1. Assembly Phase
  2. The visitor traverses nodes and objects to process any topology changes.
  3. These changes can affect element connectivity, which impacts the assembly of global matrices such as $M$ and $K$.
  4. Dependent components (e.g., mappings and constraints) are updated to ensure consistency with the new topological structure.

Numerical Methods or Discretization Choices Encoded

The TopologyChangeVisitor does not directly encode any specific numerical methods or discretization choices. However, it ensures that topology changes are correctly applied within the simulation framework, which can indirectly affect the choice of discretization schemes used in subsequent steps such as spatial discretization and time integration.

Fit into Broader Variational / Lagrangian Mechanics Framework

While TopologyChangeVisitor does not directly contribute to variational formulations or Lagrangian mechanics equations, it supports these frameworks by maintaining the consistency of topological structures. This ensures that any changes in topology do not disrupt the physical consistency and numerical stability required for accurate simulation.

Summary

The TopologyChangeVisitor is primarily responsible for managing and propagating topological structure changes within a SOFA simulation. It does this by traversing nodes and objects, applying necessary updates to mappings and constraints, and ensuring that any modifications are correctly reflected across the system. This component plays a crucial role in maintaining the integrity of the mesh and associated matrices during dynamic simulations.

Methods
void processTopologyChange (simulation::Node * node, sofa::core::objectmodel::BaseObject * obj) virtual
Result processNodeTopDown (simulation::Node * node) virtual
void processNodeBottomUp (simulation::Node * node) virtual
bool isThreadSafe () virtual
const char * getCategoryName () virtual
int getInfos ()
{
  "name": "TopologyChangeVisitor",
  "namespace": "sofa::simulation",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/TopologyChangeVisitor.h",
  "doc": "",
  "inherits": [
    "Visitor"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "processTopologyChange",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "simulation::Node *"
        },
        {
          "name": "obj",
          "type": "sofa::core::objectmodel::BaseObject *"
        }
      ],
      "is_virtual": true,
      "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"
    },
    {
      "name": "getCategoryName",
      "return_type": "const char *",
      "params": [],
      "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"
    }
  ],
  "description": "The `TopologyChangeVisitor` is a class in the SOFA framework, specifically within the `sofa::simulation` namespace. It inherits from the `Visitor` class and is defined in the header file `sofa/simulation/TopologyChangeVisitor.h`. This component plays a role in managing changes to topological structures during simulations by traversing nodes and objects in the simulation tree. Its primary purpose is to process topology changes, ensuring that these changes are propagated correctly through the system.\n\n**Role and Purpose:**\n`TopologyChangeVisitor` handles updates and changes in the topological mappings of objects within a SOFA simulation. It ensures that any modifications made to the topology (such as adding or removing elements) are appropriately reflected across all dependent components, including other mappings and nodes.\n\n**Interactions with Other Components:*\nThe `TopologyChangeVisitor` interacts with various SOFA components through its methods:\n- `processTopologyChange`: This method processes changes in topology for a given node and object.\n- `processNodeTopDown` and `processNodeBottomUp`: These methods perform operations on nodes, allowing the visitor to traverse the simulation tree in both top-down and bottom-up directions. The `processNodeTopDown` method also updates topological mappings as needed.\n- `isThreadSafe`: Indicates whether the action can be safely parallelized.\n\n**Practical Usage Guidance:**\nThe class operates by visiting nodes and objects, applying changes to their topology, and updating dependent components accordingly. This visitor is particularly useful in scenarios where dynamic changes to a simulation's structure are required, such as adding or removing elements during a simulation run.",
  "maths": "The `TopologyChangeVisitor` in the SOFA framework is designed to handle changes in topological structures within a simulation. This visitor class ensures that any modifications made to the topology, such as adding or removing elements, are correctly propagated through the system. The primary role of this component is to process these topology changes and update dependent components accordingly.\n\n### Governing Equations and Operators\n\nThe `TopologyChangeVisitor` does not directly contribute to the governing equations like mass matrix \\(M\\), stiffness matrix \\(K\\), internal force vector \\(f_{int}\\), or residual \\(R\\). Instead, it manages the topological structure changes that can indirectly affect these matrices and vectors by modifying the connectivity and element configurations in the mesh.\n\n### Constitutive or Kinematic Laws Involved\n\nWhile the `TopologyChangeVisitor` itself does not implement constitutive laws such as strain measures, stress tensors, hyperelastic potentials, or constraint Jacobians, it ensures that any changes to these topological structures are correctly applied. This includes updating mappings and constraints that may be influenced by topology modifications.\n\n### Role in the Global FEM Pipeline\n\nIn the context of the global Finite Element Method (FEM) pipeline, `TopologyChangeVisitor` plays a crucial role during the assembly phase. Specifically:\n\n1. **Assembly Phase**\n   - The visitor traverses nodes and objects to process any topology changes.\n   - These changes can affect element connectivity, which impacts the assembly of global matrices such as \\(M\\) and \\(K\\).\n   - Dependent components (e.g., mappings and constraints) are updated to ensure consistency with the new topological structure.\n\n### Numerical Methods or Discretization Choices Encoded\n\nThe `TopologyChangeVisitor` does not directly encode any specific numerical methods or discretization choices. However, it ensures that topology changes are correctly applied within the simulation framework, which can indirectly affect the choice of discretization schemes used in subsequent steps such as spatial discretization and time integration.\n\n### Fit into Broader Variational / Lagrangian Mechanics Framework\n\nWhile `TopologyChangeVisitor` does not directly contribute to variational formulations or Lagrangian mechanics equations, it supports these frameworks by maintaining the consistency of topological structures. This ensures that any changes in topology do not disrupt the physical consistency and numerical stability required for accurate simulation.\n\n### Summary\n\nThe `TopologyChangeVisitor` is primarily responsible for managing and propagating topological structure changes within a SOFA simulation. It does this by traversing nodes and objects, applying necessary updates to mappings and constraints, and ensuring that any modifications are correctly reflected across the system. This component plays a crucial role in maintaining the integrity of the mesh and associated matrices during dynamic simulations.",
  "abstract": "The `TopologyChangeVisitor` manages and propagates topological structure changes within a SOFA simulation by traversing nodes and objects to ensure consistency across dependent components.",
  "sheet": "# TopologyChangeVisitor\n\n**Overview:**\nThe `TopologyChangeVisitor` is a visitor component in the SOFA framework designed to handle topology changes during simulations. It ensures that any modifications made to the topological structure are correctly propagated through the system, maintaining consistency among dependent components such as mappings and constraints.\n\n**Dependencies and Connections:**\nThe `TopologyChangeVisitor` interacts with various SOFA components by traversing nodes and objects in a simulation tree. Its primary methods include:\n- `processTopologyChange`: Processes changes in topology for a given node and object.\n- `processNodeTopDown`: Performs operations on nodes in a top-down direction, updating topological mappings as needed.\n- `processNodeBottomUp`: Performs operations on nodes in a bottom-up direction.\n- `isThreadSafe`: Indicates whether the action can be safely parallelized.\n\nThese methods ensure that any changes to the topology are correctly applied and reflected across all dependent components."
}