Back

SceneCheckMapping

sofa::scenechecking::SceneCheckMapping
SceneCheck
Doc (from source)

This SceneCheck is motivated by the visitor mechanism that assumes: If both a mechanical state and a mapping are present in a Node, the state is considered mapped, no matter if they are related or not.

Abstract (AI generated)

The `SceneCheckMapping` component verifies that mappings and states within Nodes are correctly paired according to SOFA's visitor logic, ensuring proper configuration before simulation initialization.

Metadata
module
applications.projects.SceneChecking
namespace
sofa::scenechecking
include
SceneChecking/SceneCheckMapping.h
inherits
  • SceneCheck
description

The SceneCheckMapping component in the SOFA framework is designed to ensure that mappings and states within a Node are consistent according to the visitor logic used by the framework. This check addresses common configuration issues where both mechanical state and mapping may be present but not necessarily related or properly configured.

**Governing Equations / Operators: **
- The component does not directly implement any governing equations, constitutive laws, or operators typically associated with the Finite Element Method (FEM). Instead, it is a diagnostic tool that verifies the structural consistency of mappings and states within Nodes.

Constitutive / Kinematic Laws Involved:
- No specific constitutive or kinematic laws are involved. The component relies on the logical consistency between mappings and states rather than physical equations or material properties.

**Role in the Global FEM Pipeline: **
- SceneCheckMapping plays a role in the initialization phase of simulations by ensuring that Nodes are correctly configured before simulation starts. It checks for proper pairing of mechanical states and mappings within each Node to ensure they comply with expected visitor behavior within SOFA simulations.

**Numerical Methods or Discretization Choices: **
- The component does not involve any numerical methods, discretizations, or solution techniques related to FEM. Its role is purely diagnostic.

Fit into the Broader Variational / Lagrangian Mechanics Framework:
- SceneCheckMapping operates at a higher level of abstraction and ensures that the structural configuration of Nodes adheres to the framework's expectations regarding mappings and states. This indirectly supports the variational and Lagrangian mechanics framework by ensuring that the simulation setup is logically consistent.

**Summary: **
- The component performs verification on Nodes containing mappings and states to ensure they are correctly paired. It helps identify configurations that do not comply with expected visitor behavior within SOFA simulations. This ensures proper initialization of the FEM pipeline, although it does not directly contribute to any physical or mathematical modeling aspects.

Methods
SPtr newSPtr ()
const int getName ()
const int getDesc ()
void doInit (sofa::simulation::Node * node) virtual
void doCheckOn (sofa::simulation::Node * node) virtual
void doPrintSummary () virtual
{
  "name": "SceneCheckMapping",
  "namespace": "sofa::scenechecking",
  "module": "applications.projects.SceneChecking",
  "include": "SceneChecking/SceneCheckMapping.h",
  "doc": "This SceneCheck is motivated by the visitor mechanism that assumes:\nIf both a mechanical state and a mapping are present in a Node, the state is considered mapped,\nno matter if they are related or not.",
  "inherits": [
    "SceneCheck"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "newSPtr",
      "return_type": "SPtr",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": true,
      "access": "public"
    },
    {
      "name": "getName",
      "return_type": "const int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getDesc",
      "return_type": "const int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "doInit",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "sofa::simulation::Node *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "doCheckOn",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "sofa::simulation::Node *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "doPrintSummary",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `SceneCheckMapping` component in SOFA's SceneChecking module is designed to ensure that the mappings and states within a Node are consistent according to the visitor logic used by the framework. This check addresses a common issue where both mechanical state and mapping may be present, but not necessarily related or properly configured.\n\n**Role and Purpose:**\nThe `SceneCheckMapping` component performs verification on Nodes containing mappings and states to ensure they are correctly paired. It helps identify configurations that do not comply with the expected visitor behavior within SOFA simulations.\n\n**Interactions with Other Components:**\n- **Inheritance**: Inherits from `sofa::simulation::SceneCheck`, which means it can be registered in the main scene check registry (`SceneCheckMainRegistry`).\n- **Node Inspection**: It interacts closely with Nodes, examining their mechanical state and mapping configurations to determine consistency.\n\n**Practical Usage Guidance:**\nThe component is automatically registered during initialization. The `doInit` method clears internal storage vectors that track different types of inconsistent Node configurations. The `doCheckOn` method performs the actual checks on each Node by verifying if mappings are correctly associated with their states. If inconsistencies are detected, they are stored for later reporting in the `doPrintSummary` method.\n\n**Data Fields:**\nThe component maintains three vectors to store Nodes with different types of issues:\n- `m_nodesWithMappingNoState`: Stores Nodes containing a mapping but no state.\n- `m_nodesWithMappingWrongState`: Stores Nodes where states are present but not an output of the mapping.\n- `m_nodesWithMappingAndTwoStates`: Tracks Nodes having both mechanical and non-mechanical states, which can cause undefined behavior. \n\nThe primary methods include:\n- `newSPtr()`: Creates a shared pointer to a new instance of `SceneCheckMapping`.\n- `getName()`, `getDesc()`: Retrieve the name and description of the component.\n- `doInit()`, `doCheckOn()`, `doPrintSummary()`: Manage initialization, Node checking, and summary reporting respectively.",
  "maths": "The `SceneCheckMapping` component in the SOFA framework is designed to ensure that mappings and states within a Node are consistent according to the visitor logic used by the framework. This check addresses common configuration issues where both mechanical state and mapping may be present but not necessarily related or properly configured.\n\n**Governing Equations / Operators: **\n- The component does not directly implement any governing equations, constitutive laws, or operators typically associated with the Finite Element Method (FEM). Instead, it is a diagnostic tool that verifies the structural consistency of mappings and states within Nodes.\n\n**Constitutive / Kinematic Laws Involved:**\n- No specific constitutive or kinematic laws are involved. The component relies on the logical consistency between mappings and states rather than physical equations or material properties.\n\n**Role in the Global FEM Pipeline: **\n- `SceneCheckMapping` plays a role in the initialization phase of simulations by ensuring that Nodes are correctly configured before simulation starts. It checks for proper pairing of mechanical states and mappings within each Node to ensure they comply with expected visitor behavior within SOFA simulations.\n\n**Numerical Methods or Discretization Choices: **\n- The component does not involve any numerical methods, discretizations, or solution techniques related to FEM. Its role is purely diagnostic.\n\n**Fit into the Broader Variational / Lagrangian Mechanics Framework:**\n- `SceneCheckMapping` operates at a higher level of abstraction and ensures that the structural configuration of Nodes adheres to the framework's expectations regarding mappings and states. This indirectly supports the variational and Lagrangian mechanics framework by ensuring that the simulation setup is logically consistent.\n\n**Summary: **\n- The component performs verification on Nodes containing mappings and states to ensure they are correctly paired. It helps identify configurations that do not comply with expected visitor behavior within SOFA simulations. This ensures proper initialization of the FEM pipeline, although it does not directly contribute to any physical or mathematical modeling aspects.",
  "abstract": "The `SceneCheckMapping` component verifies that mappings and states within Nodes are correctly paired according to SOFA's visitor logic, ensuring proper configuration before simulation initialization.",
  "sheet": "# SceneCheckMapping\n\n## Overview\n\nThe `SceneCheckMapping` component is a diagnostic tool in the SOFA framework designed to ensure that mappings and mechanical states within Nodes are logically consistent. It inherits from `sofa::simulation::SceneCheck`, allowing it to be registered in the main scene check registry (`SceneCheckMainRegistry`). This component helps identify configurations where both mappings and states may be present but not properly paired, ensuring proper initialization of simulations.\n\n## Parameters and Data\n\nThe component maintains three vectors to store Nodes with different types of issues:\n- `m_nodesWithMappingNoState`: Stores Nodes containing a mapping but no state.\n- `m_nodesWithMappingWrongState`: Stores Nodes where states are present but not an output of the mapping.\n- `m_nodesWithMappingAndTwoStates`: Tracks Nodes having both mechanical and non-mechanical states, which can cause undefined behavior.\n\n## Dependencies and Connections\n\nThe component interacts closely with Nodes to examine their mechanical state and mapping configurations. It relies on the visitor mechanism used by SOFA simulations to ensure that mappings are correctly associated with their respective states within each Node.\n\n## Practical Notes\n\n- The `doInit` method clears internal storage vectors during initialization.\n- The `doCheckOn` method performs checks on each Node, identifying inconsistencies between mappings and states.\n- The `doPrintSummary` method reports any detected issues in the configuration of Nodes."
}