RigidToQuatEngine
Transform a couple of Vec3 and Quaternion in Rigid.
The `RigidToQuatEngine` transforms rigid body representations into separate position and orientation components (Vec3 and Quaternion), facilitating easier handling and visualization of rigid bodies within SOFA simulations.
- module
- Sofa.Component.Engine.Transform
- namespace
- sofa::component::engine::transform
- include
- sofa/component/engine/transform/RigidToQuatEngine.h
- inherits
-
- DataEngine
- templates
-
- sofa::sofa::defaulttype::Vec3Types
- description
Governing Equations and Operators:
- Constraint Violation: The
PairInteractionConstraintcomputes constraint violations which represent how much the current state of the system violates the defined constraints. This is done via abstract methods that must be implemented by derived classes. Mathematically, if we denote $ p \$ as a constraint equation where $ p \\in \) and \( q \$ represents the DOFs, then the violation vector $ P = [p_1, p_2, ..., p_n] \$ can be written as:
- Jacobian Matrix: The Jacobian matrix $ p_i \$, which captures how constraints change with respect to changes in DOFs, is computed by derived classes implementing the
buildConstraintMatrixmethod. This matrix has entries:
method. These multipliers represent the forces required to enforce constraints and ensure mechanical equilibrium.
- Lagrange Multipliers: The Lagrange multipliers $.
- Orientations (Quaternion): A vector of orientations represented by quaternions, denoted as \( Q = [q_1, q_2, ..., q_n] \$ are stored using the
method. These multipliers represent the forces required to enforce constraints and ensure mechanical equilibrium.
Constitutive or Kinematic Laws:
This component does not directly specify any constitutive or kinematic laws but serves as a framework for enforcing interaction constraints between pairs of bodies. The actual computation of constraint violations and Jacobian matrices must be defined by derived classes based on specific physical interactions such as contacts, attachments, or multi-resolution coupling.
Role in the Global FEM Pipeline:
-
**Assembly Phase**: The `PairInteractionConstraint` contributes to the assembly phase by computing and storing contributions from constraints. This involves computing constraint violations <!--MATH8--> and Jacobian matrices <!--MATH9-->.
- Constraint Violations: These are assembled into a global vector of constraints.
- Jacobian Matrices: These are used to form the global tangent stiffness matrix.
-
**Time Integration**: Constraints affect time integration by modifying the dynamic equations. The Lagrange multipliers ensure that the constraints are satisfied at each timestep.
Numerical Methods and Discretization Choices:
The
-
**Variational Principles**: The constraint equations and their enforcement through Lagrange multipliers fit naturally into the variational framework of FEM. Constraints are enforced by augmenting the system’s Lagrangian with penalty terms involving Lagrange multipliers.
<!--MATH2-->
-
**Lagrangian Mechanics**: The constraints can be viewed as modifications to the generalized coordinates, leading to a modified set of equations of motion that include constraint forces.
In summary, `PairInteractionConstraint` serves as an abstract interface for defining and enforcing interaction constraints between pairs of bodies within the FEM simulation framework. It does not specify concrete physics but instead provides a mechanism for derived classes to implement specific interactions.
Methods
void
doUpdate
()
virtual
void
init
()
virtual
void
reinit
()
virtual
{
"name": "RigidToQuatEngine",
"namespace": "sofa::component::engine::transform",
"module": "Sofa.Component.Engine.Transform",
"include": "sofa/component/engine/transform/RigidToQuatEngine.h",
"doc": "Transform a couple of Vec3 and Quaternion in Rigid.",
"inherits": [
"DataEngine"
],
"templates": [
"sofa::sofa::defaulttype::Vec3Types"
],
"data_fields": [],
"links": [],
"methods": [
{
"name": "doUpdate",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "reinit",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `RigidToQuatEngine` is a SOFA engine that transforms rigid body representations into separate position and orientation components (Vec3 and Quaternion). It inherits from the `DataEngine` class, indicating it processes data transformations within the SOFA scene graph architecture. The component takes input as vectors of Rigid types (position + orientation) and outputs corresponding vectors of positions (Vec3), orientations (Quaternion), and Euler angles. This engine is useful for breaking down rigid body representations into more manageable components for further processing or visualization tasks. It provides methods to initialize (`init`), update (`doUpdate`), and reinitialize (`reinit`) the transformation process, ensuring it can adapt to changes in the simulation.",
"maths": "The `RigidToQuatEngine` is a computational engine in the SOFA framework that transforms rigid body representations into separate position and orientation components. This transformation does not involve any governing equations or constitutive laws from continuum mechanics, as it merely splits the combined rigid body representation into its constituent parts for further processing or visualization purposes.\n\n### Mathematical Description\n- **Input**: The input to this component is a vector of `RigidVec3` types, where each element represents both position and orientation of a rigid body in 3D space. Mathematically, each `RigidVec3` can be represented as:\n \\[ R = (p, q) \\]\n where \\( p \\\\) is the position vector (\\( p \\\\in \\\\[mathbb{R}^3 \\\\]) and \\( q \\\\) is the orientation quaternion.\n\n- **Output**:\n - Positions: A vector of positions, denoted as \\( P = [p_1, p_2, ..., p_n] \\\\) where each \\( p_i \\\\) is a position in \\(\\[mathbb{R}^3 \\\\].\n - Orientations (Quaternion): A vector of orientations represented by quaternions, denoted as \\( Q = [q_1, q_2, ..., q_n] \\\\) where each \\( q_i \\\\) is a quaternion.\n - Euler Angles: A vector of orientation components in Euler angle format, denoted as \\( E = [e_1, e_2, ..., e_n] \\\\) where each \\( e_i \\\\) represents the rotation angles about the axes (typically XYZ).\n\n### Transformation Process\nIn the `doUpdate` method, the engine performs the following steps for each rigid body representation:\n- Extracts the position component \\( p \\\\) from the rigid body vector and stores it in the output positions vector.\n- Extracts the orientation quaternion \\( q \\\\) from the rigid body vector and stores it in the orientations vector.\n- Converts the extracted quaternion to Euler angles using the method `toEulerVector` and stores them in the orientationsEuler vector.\n\n### Role in FEM Pipeline\nThe `RigidToQuatEngine` plays a role in data transformation rather than direct involvement in numerical solution methods or constitutive modeling. It is primarily used for separating rigid body representations into position and orientation components, facilitating easier handling and visualization of rigid bodies within the SOFA simulation framework.\n\n### Numerical Methods and Discretization Choices\nThe component does not encode any specific numerical methods or discretization schemes since it merely performs data transformations rather than solving equations. However, the conversion between quaternion to Euler angles involves standard trigonometric operations.\n\n### Variational / Lagrangian Mechanics Framework\nThis component does not directly contribute to the variational or Lagrangian mechanics framework as its primary function is to perform data transformations on rigid body representations.",
"abstract": "The `RigidToQuatEngine` transforms rigid body representations into separate position and orientation components (Vec3 and Quaternion), facilitating easier handling and visualization of rigid bodies within SOFA simulations.",
"sheet": "\n# RigidToQuatEngine\n\n## Overview\n\nThe `RigidToQuatEngine` is an engine component that processes data transformations in the SOFA scene graph architecture. It takes input as vectors of Rigid types (position + orientation) and outputs corresponding vectors of positions (Vec3), orientations (Quaternion), and Euler angles. This engine is useful for breaking down rigid body representations into more manageable components for further processing or visualization tasks.\n\n## Parameters and Data\n\nThe `RigidToQuatEngine` does not expose any significant Data fields, as it primarily handles internal data transformations without user-configurable parameters.\n\n## Practical Notes\n\nThis component is designed to handle the transformation of rigid body representations into separate position and orientation components. It does not involve numerical methods or discretization schemes beyond standard trigonometric operations for converting quaternions to Euler angles."
}