Back

RigidContactMapper

sofa::component::collision::response::mapper::RigidContactMapper
BaseContactMapper
Doc (from source)

Base class for all mappers using RigidMapping

Abstract (AI generated)

The `RigidContactMapper` manages mappings between rigid body models and their corresponding mechanical states in SOFA simulations, ensuring consistency during contact and collision responses.

Metadata
module
Sofa.Component.Collision.Response.Mapper
namespace
sofa::component::collision::response::mapper
include
sofa/component/collision/response/mapper/RigidContactMapper.h
inherits
  • BaseContactMapper
No description data.

The RigidContactMapper is a class in the SOFA framework that serves as a base for all mappers using RigidMapping. It plays a role in contact and collision response by facilitating the mapping between rigid body models and their corresponding mechanical states.

Governing Equations or Operators:

  • Role: The RigidContactMapper does not directly contribute to the governing equations such as mass matrix $ M $, stiffness matrix $ K $, internal force $ f_{int} $, or residual $ R $. Its primary function is to manage the creation and updating of mappings between different models.: While not directly tied to variational or Lagrangian mechanics principles, this visitor provides general utility in evaluating vector magnitudes which can be part of larger mechanical systems described by such principles.

Constitutive or Kinematic Laws Involved:

  • Kinematics: The component handles kinematic transformations necessary for mapping points from a rigid body model to another mechanical state. Specifically, it uses orientation and position data provided by the collision model (e.g., sphere or cylinder) to compute transformed coordinates.
  • For spheres: $ cP = P - rCenter.getCenter() $
  • Orientation correction: $ cP' = ori.inverseRotate(cP) $

Role in the Global FEM Pipeline:

  • Assembly: It does not directly contribute to assembly phases of mass and force matrices.
  • Time Integration: The component is primarily used for updating mechanical states during the simulation loop, which involves applying mappings between different models. This can indirectly affect time integration by ensuring that the mechanical state remains consistent with the collision model.

Numerical Methods or Discretization Choices:

  • Mapping Creation and Update: It creates a mapping object (e.g., RigidMapping) if needed, which facilitates point-wise transformations from one coordinate system to another. This is done through methods like createMapping, update, and addPoint.
  • Discretization: The component uses the provided orientation and position data for discretizing points in rigid body models, ensuring that each point is correctly mapped to its corresponding mechanical state.

Variational / Lagrangian Mechanics Framework:

The RigidContactMapper operates within the broader framework of SOFA, where it ensures consistency between collision models (rigid bodies) and their associated mechanical states. By managing these mappings, it indirectly supports variational mechanics by ensuring that all transformations are geometrically consistent with the rigid body kinematics.

Summary:

  • Function: The RigidContactMapper is a utility for managing contact points in collision models, enabling consistent mapping between different mechanical states during simulation. It ensures that the orientation and position data of rigid bodies are correctly transformed and applied to maintain physical consistency.
Methods
void setCollisionModel (MCollisionModel * model)
void cleanup ()
MMechanicalState * createMapping (const char * name)
void resize (int size)
int addPoint (const Coord & P, int index, Real & )
void update ()
void updateXfree ()
{
  "name": "RigidContactMapper",
  "namespace": "sofa::component::collision::response::mapper",
  "module": "Sofa.Component.Collision.Response.Mapper",
  "include": "sofa/component/collision/response/mapper/RigidContactMapper.h",
  "doc": "Base class for all mappers using RigidMapping",
  "inherits": [
    "BaseContactMapper"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "setCollisionModel",
      "return_type": "void",
      "params": [
        {
          "name": "model",
          "type": "MCollisionModel *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "cleanup",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "createMapping",
      "return_type": "MMechanicalState *",
      "params": [
        {
          "name": "name",
          "type": "const char *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "resize",
      "return_type": "void",
      "params": [
        {
          "name": "size",
          "type": "int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addPoint",
      "return_type": "int",
      "params": [
        {
          "name": "P",
          "type": "const Coord &"
        },
        {
          "name": "index",
          "type": "int"
        },
        {
          "name": "",
          "type": "Real &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "update",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "updateXfree",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "The `RigidContactMapper` is a template class in the SOFA (Simulation Open Framework Architecture) framework designed to manage contact points for collision models, particularly those involving rigid bodies. This class serves as a base for handling various types of geometric shapes like spheres and cylinders under collision scenarios within simulations. It facilitates communication between different parts of the simulation engine by providing methods that enable setting up collision models, managing contact points, resizing based on the number of points involved in collisions, and updating positions and velocities accordingly.\n\n### Key Components:\n\n- **Template Parameters**\n  - `TCollisionModel`: Defines the type of collision model (e.g., sphere or cylinder).\n  - `DataTypes`: Represents the data types used for coordinates, vectors, etc., in the simulation.\n\n- **Public Attributes and Methods:*\n  - *`model`*: Pointer to the current collision model.\n  - *`child`*: Smart pointer to a node (`NodeSPtr`) that can be part of SOFA's scene graph structure.\n  - *`mapping`*: Smart pointer to a `RigidMapping` object, which is responsible for mapping rigid body transformations onto other components in the simulation.\n  - *`outmodel`*: Smart pointer to an output mechanical state model that represents how the mapped points behave in terms of positions and velocities.\n  - *`setCollisionModel(MCollisionModel* model)`*: Method for setting the collision model associated with this mapper.\n  - *`cleanup()`*: Cleans up resources used by the contact mapper, such as removing any created nodes or resetting mappings.\n  - *`createMapping(const char* name = ": ",contactPoints",
  "maths": "The `RigidContactMapper` is a class in the SOFA framework that serves as a base for all mappers using RigidMapping. It plays a role in contact and collision response by facilitating the mapping between rigid body models and their corresponding mechanical states.\n\n### Governing Equations or Operators:\n\n- **Role**: The `RigidContactMapper` does not directly contribute to the governing equations such as mass matrix \\( M \\), stiffness matrix \\( K \\), internal force \\( f_{int} \\), or residual \\( R \\). Its primary function is to manage the creation and updating of mappings between different models.\n\n### Constitutive or Kinematic Laws Involved:\n\n- **Kinematics**: The component handles kinematic transformations necessary for mapping points from a rigid body model to another mechanical state. Specifically, it uses orientation and position data provided by the collision model (e.g., sphere or cylinder) to compute transformed coordinates.\n  - For spheres: \\( cP = P - rCenter.getCenter() \\)\n  - Orientation correction: \\( cP' = ori.inverseRotate(cP) \\)\n\n### Role in the Global FEM Pipeline:\n\n- **Assembly**: It does not directly contribute to assembly phases of mass and force matrices.\n- **Time Integration**: The component is primarily used for updating mechanical states during the simulation loop, which involves applying mappings between different models. This can indirectly affect time integration by ensuring that the mechanical state remains consistent with the collision model.\n\n### Numerical Methods or Discretization Choices:\n\n- **Mapping Creation and Update**: It creates a mapping object (e.g., `RigidMapping`) if needed, which facilitates point-wise transformations from one coordinate system to another. This is done through methods like `createMapping`, `update`, and `addPoint`.\n- **Discretization**: The component uses the provided orientation and position data for discretizing points in rigid body models, ensuring that each point is correctly mapped to its corresponding mechanical state.\n\n### Variational / Lagrangian Mechanics Framework:\n\nThe `RigidContactMapper` operates within the broader framework of SOFA, where it ensures consistency between collision models (rigid bodies) and their associated mechanical states. By managing these mappings, it indirectly supports variational mechanics by ensuring that all transformations are geometrically consistent with the rigid body kinematics.\n\n### Summary:\n- **Function**: The `RigidContactMapper` is a utility for managing contact points in collision models, enabling consistent mapping between different mechanical states during simulation. It ensures that the orientation and position data of rigid bodies are correctly transformed and applied to maintain physical consistency.",
  "abstract": "The `RigidContactMapper` manages mappings between rigid body models and their corresponding mechanical states in SOFA simulations, ensuring consistency during contact and collision responses.",
  "sheet": "# RigidContactMapper\n\n## Overview\n\nThe `RigidContactMapper` is a base class for all mappers using RigidMapping. It facilitates the creation and updating of mappings between rigid body models and their corresponding mechanical states, ensuring that kinematic transformations are correctly applied during contact and collision responses.\n\n## Dependencies and Connections\n\nThis component typically requires interaction with other SOFA components such as `RigidMapping`, `CollisionModel`, and `MechanicalState`. It fits into the scene graph by managing mappings between rigid body models and their mechanical states, ensuring that all transformations are consistent with the collision model."
}