Back

MappedObject

sofa::component::statecontainer::MappedObject
State
Doc (from source)

Mapped state vectors

Abstract (AI generated)

`MappedObject` manages position and velocity vectors for simulation entities, serving as a critical state container in the SOFA framework.

Metadata
module
Sofa.Component.StateContainer
namespace
sofa::component::statecontainer
include
sofa/component/statecontainer/MappedObject.h
inherits
  • State
templates
  • sofa::defaulttype::Rigid2Types
  • sofa::defaulttype::Rigid3Types
  • sofa::defaulttype::Vec1Types
description

The MappedObject in the SOFA framework is primarily concerned with managing state vectors for simulation entities, specifically position and velocity. It does not directly contribute to governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc., but rather serves as a container for these states which are utilized by other components in the FEM pipeline.

Governing Equations and Operators Contribution:

  • Mass Matrix ($M$): Not directly implemented; mass matrix contributions would come from force fields or other components that use MappedObject's position and velocity vectors.
  • Stiffness Matrix ($K$): Similarly, the stiffness matrix is not computed within this component but by force fields using the state data stored in MappedObject.
  • Internal Force ($f_{int}$): Internal forces are calculated by force fields that depend on the position and velocity vectors managed by MappedObject.
  • Residual ($R$): The residual is assembled from contributions of various components, including those which utilize state data from MappedObject, but MappedObject itself does not compute this directly.

Constitutive or Kinematic Laws Involved:

  • This component primarily manages position $\mathbf{x}$ and velocity $\mathbf{v}$ vectors. It does not involve any specific constitutive laws (e.g., stress-strain relations) nor kinematic laws beyond storing these state variables.

Role in the Global FEM Pipeline:

  • Assembly Phase: Provides access to position and velocity data for assembly of system matrices and forces.
  • Time Integration: Position $\mathbf{x}$ and velocity $\mathbf{v}$ vectors are used by time integrators that update these states based on computed accelerations or velocities from force fields and other components.
  • Nonlinear Solution: MappedObject stores the states at each iteration, but does not directly handle the nonlinear solution process.
  • Linear Solve: Stores results of linear solves (updated positions and velocities) for further use by simulation components.

Numerical Methods or Discretization Choices:

  • The component itself does not encode any specific numerical methods beyond resizing state vectors. It primarily serves as a container for the state vectors which are then used in various discretized formulations by other components.

Fit into the Broader Variational / Lagrangian Mechanics Framework:

  • MappedObject plays a crucial role in storing and providing access to the generalized coordinates $q$ (positions) and their time derivatives $\dot{q}$ (velocities). These quantities are fundamental in variational mechanics formulations, particularly when deriving weak forms for finite element methods.

In summary, while MappedObject does not directly participate in the computation of FEM operators or constitutive laws, it is a critical component that stores and manages state information essential to these computations. It ensures that position and velocity data are consistently available for use by other components within the SOFA framework.

Data Fields
NameTypeDefaultHelp
data DataTypes
d_X VecCoord position vector
d_V VecDeriv velocity vector
Methods
void init ()
void resize (int vsize)
VecCoord * getX ()
VecDeriv * getV ()
int getSize ()
Data<VecCoord> * write (core::VecCoordId v)
const Data<VecCoord> * read (core::ConstVecCoordId v)
Data<VecDeriv> * write (core::VecDerivId v)
const Data<VecDeriv> * read (core::ConstVecDerivId v)
Data<MatrixDeriv> * write (core::MatrixDerivId )
const Data<MatrixDeriv> * read (core::ConstMatrixDerivId )
{
  "name": "MappedObject",
  "namespace": "sofa::component::statecontainer",
  "module": "Sofa.Component.StateContainer",
  "include": "sofa/component/statecontainer/MappedObject.h",
  "doc": "Mapped state vectors",
  "inherits": [
    "State"
  ],
  "templates": [
    "sofa::defaulttype::Rigid2Types",
    "sofa::defaulttype::Rigid3Types",
    "sofa::defaulttype::Vec1Types"
  ],
  "data_fields": [
    {
      "name": "data",
      "type": "DataTypes"
    },
    {
      "name": "d_X",
      "type": "VecCoord",
      "xmlname": "position",
      "help": "position vector"
    },
    {
      "name": "d_V",
      "type": "VecDeriv",
      "xmlname": "velocity",
      "help": "velocity vector"
    }
  ],
  "links": [],
  "methods": [
    {
      "name": "init",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "resize",
      "return_type": "void",
      "params": [
        {
          "name": "vsize",
          "type": "int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getX",
      "return_type": "VecCoord *",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getV",
      "return_type": "VecDeriv *",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getSize",
      "return_type": "int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "write",
      "return_type": "Data<VecCoord> *",
      "params": [
        {
          "name": "v",
          "type": "core::VecCoordId"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "read",
      "return_type": "const Data<VecCoord> *",
      "params": [
        {
          "name": "v",
          "type": "core::ConstVecCoordId"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "write",
      "return_type": "Data<VecDeriv> *",
      "params": [
        {
          "name": "v",
          "type": "core::VecDerivId"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "read",
      "return_type": "const Data<VecDeriv> *",
      "params": [
        {
          "name": "v",
          "type": "core::ConstVecDerivId"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "write",
      "return_type": "Data<MatrixDeriv> *",
      "params": [
        {
          "name": "",
          "type": "core::MatrixDerivId"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "read",
      "return_type": "const Data<MatrixDeriv> *",
      "params": [
        {
          "name": "",
          "type": "core::ConstMatrixDerivId"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `MappedObject` is a state container in the SOFA framework, specifically designed to manage position and velocity vectors for simulation entities. It inherits from `State`, which indicates that it plays a role in maintaining and updating the mechanical state within a scene graph. This component supports multiple data types through templates (`Vec1Types`, `Vec2Types`, etc.), enabling flexibility in representing different kinds of physical properties.\n\n`MappedObject` interacts with other components by providing methods to access and modify its internal position (`d_X`) and velocity (`d_V`) vectors, as well as methods for resizing the state container. It also implements the required interfaces from `core::State`, such as `init()`, which initializes the size of the position vector based on the context's mechanical state.\n\nThe component's main functionality includes:\n- Managing position and velocity data with methods like `getX()` and `getV()` for editing or retrieving these vectors.\n- Handling resizing of internal state containers through `resize()` to accommodate changes in the number of entities.\n- Initializing state based on context mechanical states, ensuring consistency across simulation components.\n\nThe `MappedObject` is registered in SOFA's object factory, indicating it can be instantiated and used within a larger simulation setup.",
  "maths": "The `MappedObject` in the SOFA framework is primarily concerned with managing state vectors for simulation entities, specifically position and velocity. It does not directly contribute to governing equations or operators such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc., but rather serves as a container for these states which are utilized by other components in the FEM pipeline.\n\n### Governing Equations and Operators Contribution:\n- **Mass Matrix ($M$)**: Not directly implemented; mass matrix contributions would come from force fields or other components that use `MappedObject`'s position and velocity vectors.\n- **Stiffness Matrix ($K$)**: Similarly, the stiffness matrix is not computed within this component but by force fields using the state data stored in `MappedObject`.\n- **Internal Force ($f_{int}$)**: Internal forces are calculated by force fields that depend on the position and velocity vectors managed by `MappedObject`.\n- **Residual ($R$)**: The residual is assembled from contributions of various components, including those which utilize state data from `MappedObject`, but `MappedObject` itself does not compute this directly.\n\n### Constitutive or Kinematic Laws Involved:\n- This component primarily manages position $\\mathbf{x}$ and velocity $\\mathbf{v}$ vectors. It does not involve any specific constitutive laws (e.g., stress-strain relations) nor kinematic laws beyond storing these state variables.\n\n### Role in the Global FEM Pipeline:\n- **Assembly Phase**: Provides access to position and velocity data for assembly of system matrices and forces.\n- **Time Integration**: Position $\\mathbf{x}$ and velocity $\\mathbf{v}$ vectors are used by time integrators that update these states based on computed accelerations or velocities from force fields and other components.\n- **Nonlinear Solution**: `MappedObject` stores the states at each iteration, but does not directly handle the nonlinear solution process.\n- **Linear Solve**: Stores results of linear solves (updated positions and velocities) for further use by simulation components.\n\n### Numerical Methods or Discretization Choices:\n- The component itself does not encode any specific numerical methods beyond resizing state vectors. It primarily serves as a container for the state vectors which are then used in various discretized formulations by other components.\n\n### Fit into the Broader Variational / Lagrangian Mechanics Framework:\n- `MappedObject` plays a crucial role in storing and providing access to the generalized coordinates $q$ (positions) and their time derivatives $\\dot{q}$ (velocities). These quantities are fundamental in variational mechanics formulations, particularly when deriving weak forms for finite element methods.\n\nIn summary, while `MappedObject` does not directly participate in the computation of FEM operators or constitutive laws, it is a critical component that stores and manages state information essential to these computations. It ensures that position and velocity data are consistently available for use by other components within the SOFA framework.",
  "abstract": "`MappedObject` manages position and velocity vectors for simulation entities, serving as a critical state container in the SOFA framework.",
  "sheet": "# MappedObject\n\n## Overview\n\n`MappedObject` is a state container that manages position and velocity vectors for simulation entities. It inherits from `State`, indicating its role in maintaining mechanical states within the SOFA framework. The component supports multiple data types through templates (`Vec1Types`, `Rigid2Types`, `Rigid3Types`) to represent different kinds of physical properties.\n\n## Parameters and Data\n\n- **Data**: Manages the state vectors for simulation entities.\n  - `d_X`: Position vector (`VecCoord`), representing the positions of entities in the simulation.\n  - `d_V`: Velocity vector (`VecDeriv`), representing the velocities of entities in the simulation."
}