Back

DefaultMultiMatrixAccessor

The `DefaultMultiMatrixAccessor` is a class in the SOFA framework responsible for managing the global matrix setup, which includes contributions from multiple mechanical states and interactions between them. It extends the `MultiMatrixAccessor` interface to handle scenarios with multiple real Mechanical States and their interactions on a simulation scene without mappings. It interacts with other SOFA components through methods like `addMechanicalState`, `addMechanicalMapping`, `setGlobalMatrix`, and `computeGlobalMatrix`. These methods are used for registering mechanical states, mappings, setting up the global matrix, and computing contributions to the global stiffness matrix. This component is useful in scenarios where there are multiple real Mechanical States on a simulation scene that interact with each other. It ensures proper setup and management of these interactions, especially when there are no mapped states involved. Practical usage involves registering mechanical states and mappings through its methods and ensuring that the global matrix reflects all necessary stiffness contributions.

abstract
`DefaultMultiMatrixAccessor` manages the global matrix setup in SOFA simulations by aggregating contributions from multiple mechanical states without mappings. It ensures accurate representation of physical phenomena within the simulation.
sheet
# DefaultMultiMatrixAccessor ## Overview The `DefaultMultiMatrixAccessor` is a key class within the SOFA framework, designed to manage the global matrix setup for multi-body dynamics simulations involving multiple real mechanical states without mappings. This component registers and aggregates contributions from these states to form an overall system stiffness matrix. ## Mathematical Model Each mechanical state contributes to the global stiffness matrix, denoted as \( K_{global} \). If there are no mappings, the contributions are straightforward: - For a single mechanical state with stiffness matrix \( K_i \) (where \( i \) is an index for each state): - The overall contribution to the global matrix can be expressed as \( K_{global}(i,j) = K_i(i,j) \). When two mechanical states interact, their interaction stiffness matrices are denoted as \( I_{ij} \), where: - \( i \) and \( j \) are indices for the interacting states. - These interactions are often represented by off-diagonal blocks in the global matrix setup. The process of assembling the global stiffness matrix involves summing contributions from all mechanical states and their interactions. This can be formalized as: \[ K_{global} = \sum_i K_i + \sum_{i,j, i\neq j} I_{ij} \] where each term represents the individual stiffness matrices of states and interaction terms between states. ## Parameters and Data The `DefaultMultiMatrixAccessor` does not expose any significant Data fields. Its functionality is primarily driven by its methods for managing mechanical states and interactions. ## Practical Notes This component ensures accurate representation of physical phenomena within the simulation, facilitating precise dynamics calculations. It is useful in scenarios where there are multiple real Mechanical States on a simulation scene that interact with each other without mappings.
description
The `DefaultMultiMatrixAccessor` is a class in the SOFA framework responsible for managing the global matrix setup, which includes contributions from multiple mechanical states and interactions between them. It extends the `MultiMatrixAccessor` interface to handle scenarios with multiple real Mechanical States and their interactions on a simulation scene without mappings. It interacts with other SOFA components through methods like `addMechanicalState`, `addMechanicalMapping`, `setGlobalMatrix`, and `computeGlobalMatrix`. These methods are used for registering mechanical states, mappings, setting up the global matrix, and computing contributions to the global stiffness matrix. This component is useful in scenarios where there are multiple real Mechanical States on a simulation scene that interact with each other. It ensures proper setup and management of these interactions, especially when there are no mapped states involved. Practical usage involves registering mechanical states and mappings through its methods and ensuring that the global matrix reflects all necessary stiffness contributions.
maths
# Mathematical and Physical Description of `DefaultMultiMatrixAccessor` ## Overview The `DefaultMultiMatrixAccessor` is a key class within the SOFA (Simulation Open Framework Architecture) framework, designed to manage the global matrix setup in multi-body dynamics simulations. It specifically handles scenarios with multiple real mechanical states and their interactions on a simulation scene without mappings. This component plays a critical role in setting up and managing contributions from various mechanical states to form an overall system stiffness matrix. ## Core Concepts ### Mechanical States and Mappings - **Mechanical States:** Represent physical entities or bodies in the simulation, each with its own local degrees of freedom (DOFs). - **Mappings:** Define relationships between mechanical states, often used for transferring forces and deformations. However, `DefaultMultiMatrixAccessor` is designed to handle scenarios without mappings. ### Global Matrix Setup The global matrix is a composite stiffness matrix that aggregates contributions from all mechanical states and interactions within the simulation scene. This matrix is crucial for solving the system's dynamics equations accurately. ## Mathematical Formulation ### Stiffness Contributions Each mechanical state contributes to the global stiffness matrix, denoted as \( K_{global} \). If there are no mappings, the contributions are straightforward: - For a single mechanical state with stiffness matrix \( K_i \) (where \( i \) is an index for each state): - The overall contribution to the global matrix can be expressed as \( K_{global}(i,j) = K_i(i,j) \). ### Interaction Matrices When two mechanical states interact, their interaction stiffness matrices are denoted as \( I_{ij} \), where: - \( i \) and \( j \) are indices for the interacting states. - These interactions are often represented by off-diagonal blocks in the global matrix setup. ### Global Matrix Assembly The process of assembling the global stiffness matrix involves summing contributions from all mechanical states and their interactions. This can be formalized as: \[ K_{global} = \sum_i K_i + \sum_{i,j, i\neq j} I_{ij} \] where each term represents the individual stiffness matrices of states and interaction terms between states. ## Implementation Details ### Methods and Operations - **`addMechanicalState`:** Registers a new mechanical state with its local degrees of freedom to the system. This updates the global matrix size accordingly. - **`setGlobalMatrix`:** Sets up the global stiffness matrix, ensuring it accommodates contributions from all registered states. - **`computeGlobalMatrix`:** Computes the final global stiffness matrix by aggregating individual state matrices and interaction terms. ### Handling Interactions Interactions between mechanical states are managed through interaction matrices \( I_{ij} \). These matrices capture the influence of one state on another, often due to physical constraints or forces. The interactions are propagated and updated in the global stiffness matrix using specific operations that handle off-diagonal blocks. ### Example Scenario Consider a simulation scene with two mechanical states (A and B) interacting: - State A has stiffness matrix \( K_A \). - State B has stiffness matrix \( K_B \). - Interaction between A and B is represented by matrices \( I_{AB} \) and \( I_{BA} \). The global stiffness matrix would be assembled as: \[ K_{global} = egin{bmatrix} K_A & I_{AB} \\ I_{BA} & K_B dot{end{bmatrix} \] ## Conclusion `DefaultMultiMatrixAccessor` effectively manages the global stiffness matrix in multi-body dynamics simulations by aggregating contributions from multiple mechanical states and their interactions. This ensures accurate representation of physical phenomena within the simulation, facilitating precise dynamics calculations.
{
  "name": "DefaultMultiMatrixAccessor",
  "main": {
    "name": "DefaultMultiMatrixAccessor",
    "namespace": "sofa::core::behavior",
    "module": "Sofa.framework.Core",
    "include": "sofa/core/behavior/DefaultMultiMatrixAccessor.h",
    "doc": "",
    "inherits": [
      "MultiMatrixAccessor"
    ],
    "templates": [],
    "data_fields": [],
    "links": [],
    "methods": [
      {
        "name": "clear",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setGlobalMatrix",
        "return_type": "void",
        "params": [
          {
            "name": "matrix",
            "type": "linearalgebra::BaseMatrix *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addMechanicalState",
        "return_type": "void",
        "params": [
          {
            "name": "mstate",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addMechanicalMapping",
        "return_type": "void",
        "params": [
          {
            "name": "mapping",
            "type": "sofa::core::BaseMapping *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "addMappedMechanicalState",
        "return_type": "void",
        "params": [
          {
            "name": "mstate",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "setupMatrices",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getGlobalDimension",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getGlobalOffset",
        "return_type": "int",
        "params": [
          {
            "name": "mstate",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getMatrix",
        "return_type": "MatrixRef",
        "params": [
          {
            "name": "mstate",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getMatrix",
        "return_type": "InteractionMatrixRef",
        "params": [
          {
            "name": "mstate1",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          },
          {
            "name": "mstate2",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "computeGlobalMatrix",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "createMatrix",
        "return_type": "linearalgebra::BaseMatrix *",
        "params": [
          {
            "name": "mstate1",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          },
          {
            "name": "mstate2",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": true,
        "access": "public"
      },
      {
        "name": "createMatrixImpl",
        "return_type": "linearalgebra::BaseMatrix *",
        "params": [
          {
            "name": "mstate1",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          },
          {
            "name": "mstate2",
            "type": "const sofa::core::behavior::BaseMechanicalState *"
          },
          {
            "name": "doPrintInfo",
            "type": "bool"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": true,
        "access": "public"
      },
      {
        "name": "setDoPrintInfo",
        "return_type": "void",
        "params": [
          {
            "name": "value",
            "type": "bool"
          }
        ],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      }
    ]
  },
  "desc": {
    "description": "The `DefaultMultiMatrixAccessor` is a class in the SOFA framework responsible for managing the global matrix setup, which includes contributions from multiple mechanical states and interactions between them. It extends the `MultiMatrixAccessor` interface to handle scenarios with multiple real Mechanical States and their interactions on a simulation scene without mappings. \n\nIt interacts with other SOFA components through methods like `addMechanicalState`, `addMechanicalMapping`, `setGlobalMatrix`, and `computeGlobalMatrix`. These methods are used for registering mechanical states, mappings, setting up the global matrix, and computing contributions to the global stiffness matrix.\n\nThis component is useful in scenarios where there are multiple real Mechanical States on a simulation scene that interact with each other. It ensures proper setup and management of these interactions, especially when there are no mapped states involved. Practical usage involves registering mechanical states and mappings through its methods and ensuring that the global matrix reflects all necessary stiffness contributions."
  },
  "maths": {
    "maths": "# Mathematical and Physical Description of `DefaultMultiMatrixAccessor`\n\n## Overview\nThe `DefaultMultiMatrixAccessor` is a key class within the SOFA (Simulation Open Framework Architecture) framework, designed to manage the global matrix setup in multi-body dynamics simulations. It specifically handles scenarios with multiple real mechanical states and their interactions on a simulation scene without mappings. This component plays a critical role in setting up and managing contributions from various mechanical states to form an overall system stiffness matrix.\n\n## Core Concepts\n### Mechanical States and Mappings\n- **Mechanical States:** Represent physical entities or bodies in the simulation, each with its own local degrees of freedom (DOFs).\n- **Mappings:** Define relationships between mechanical states, often used for transferring forces and deformations. However, `DefaultMultiMatrixAccessor` is designed to handle scenarios without mappings.\n\n### Global Matrix Setup\nThe global matrix is a composite stiffness matrix that aggregates contributions from all mechanical states and interactions within the simulation scene. This matrix is crucial for solving the system's dynamics equations accurately.\n\n## Mathematical Formulation\n### Stiffness Contributions\nEach mechanical state contributes to the global stiffness matrix, denoted as \\( K_{global} \\). If there are no mappings, the contributions are straightforward:\n- For a single mechanical state with stiffness matrix \\( K_i \\) (where \\( i \\) is an index for each state):\n  - The overall contribution to the global matrix can be expressed as \\( K_{global}(i,j) = K_i(i,j) \\).\n\n### Interaction Matrices\nWhen two mechanical states interact, their interaction stiffness matrices are denoted as \\( I_{ij} \\), where:\n- \\( i \\) and \\( j \\) are indices for the interacting states.\n- These interactions are often represented by off-diagonal blocks in the global matrix setup.\n\n### Global Matrix Assembly\nThe process of assembling the global stiffness matrix involves summing contributions from all mechanical states and their interactions. This can be formalized as:\n\\[\nK_{global} = \\sum_i K_i + \\sum_{i,j, i\\neq j} I_{ij}\n\\]\nwhere each term represents the individual stiffness matrices of states and interaction terms between states.\n\n## Implementation Details\n### Methods and Operations\n- **`addMechanicalState`:** Registers a new mechanical state with its local degrees of freedom to the system. This updates the global matrix size accordingly.\n- **`setGlobalMatrix`:** Sets up the global stiffness matrix, ensuring it accommodates contributions from all registered states.\n- **`computeGlobalMatrix`:** Computes the final global stiffness matrix by aggregating individual state matrices and interaction terms.\n\n### Handling Interactions\nInteractions between mechanical states are managed through interaction matrices \\( I_{ij} \\). These matrices capture the influence of one state on another, often due to physical constraints or forces. The interactions are propagated and updated in the global stiffness matrix using specific operations that handle off-diagonal blocks.\n\n### Example Scenario\nConsider a simulation scene with two mechanical states (A and B) interacting:\n- State A has stiffness matrix \\( K_A \\).\n- State B has stiffness matrix \\( K_B \\).\n- Interaction between A and B is represented by matrices \\( I_{AB} \\) and \\( I_{BA} \\).\n\nThe global stiffness matrix would be assembled as:\n\\[\nK_{global} = \begin{bmatrix}\nK_A & I_{AB} \\\\\nI_{BA} & K_B\n\ndot{end{bmatrix}\n\\]\n\n## Conclusion\n`DefaultMultiMatrixAccessor` effectively manages the global stiffness matrix in multi-body dynamics simulations by aggregating contributions from multiple mechanical states and their interactions. This ensures accurate representation of physical phenomena within the simulation, facilitating precise dynamics calculations."
  },
  "summary": {
    "abstract": "`DefaultMultiMatrixAccessor` manages the global matrix setup in SOFA simulations by aggregating contributions from multiple mechanical states without mappings. It ensures accurate representation of physical phenomena within the simulation.",
    "sheet": "# DefaultMultiMatrixAccessor\n\n## Overview\nThe `DefaultMultiMatrixAccessor` is a key class within the SOFA framework, designed to manage the global matrix setup for multi-body dynamics simulations involving multiple real mechanical states without mappings. This component registers and aggregates contributions from these states to form an overall system stiffness matrix.\n\n## Mathematical Model\nEach mechanical state contributes to the global stiffness matrix, denoted as \\( K_{global} \\). If there are no mappings, the contributions are straightforward:\n- For a single mechanical state with stiffness matrix \\( K_i \\) (where \\( i \\) is an index for each state):\n  - The overall contribution to the global matrix can be expressed as \\( K_{global}(i,j) = K_i(i,j) \\).\n\nWhen two mechanical states interact, their interaction stiffness matrices are denoted as \\( I_{ij} \\), where:\n- \\( i \\) and \\( j \\) are indices for the interacting states.\n- These interactions are often represented by off-diagonal blocks in the global matrix setup.\n\nThe process of assembling the global stiffness matrix involves summing contributions from all mechanical states and their interactions. This can be formalized as:\n\\[\nK_{global} = \\sum_i K_i + \\sum_{i,j, i\\neq j} I_{ij}\n\\]\nwhere each term represents the individual stiffness matrices of states and interaction terms between states.\n\n## Parameters and Data\nThe `DefaultMultiMatrixAccessor` does not expose any significant Data fields. Its functionality is primarily driven by its methods for managing mechanical states and interactions.\n\n## Practical Notes\nThis component ensures accurate representation of physical phenomena within the simulation, facilitating precise dynamics calculations. It is useful in scenarios where there are multiple real Mechanical States on a simulation scene that interact with each other without mappings."
  }
}