#include <RotationMethodsContainer.h>
A container for rotation computation methods in corotational formulations. More...

A container for rotation computation methods in corotational formulations.
This class provides a flexible mechanism to select and execute different rotation computation strategies for elements in corotational finite element simulations. The rotation methods calculate the element's rotation relative to its initial configuration, which is essential for corotational force fields.
| DataTypes | The data type used throughout the simulation (e.g., sofa::defaulttype::Vec3Types for 3D) |
| ElementType | The element type (e.g., sofa::geometry::Triangle, sofa::geometry::Tetrahedron) |
| Methods... | A pack of rotation method classes implementing the computeRotation interface |
Key Features:
Technical Details:
m_rotationComputer (std::variant)d_rotationMethod data object (index-based)selectRotationMethod function updates the active method based on the selected indexMAKE_SELECTABLE_ITEMS macro generates GUI items for method selectionWhy Multiple Methods? Corotational formulations often require different rotation strategies depending on computational efficiency requirements.
This container enables seamless switching between methods without reconfiguring the entire simulation.
Classes | |
| struct | RotationMethodsItems |
Public Attributes | |
| sofa::Data< RotationMethodsItems > | d_rotationMethod |
Static Public Attributes | |
| static constexpr auto | NumberOfMethods = std::variant_size_v<decltype(m_rotationComputer)> |
| static constexpr std::size_t | NumberOfNodesInElement = ElementType::NumberOfNodes |
Public Member Functions | |
| RotationMethodsContainer (sofa::core::objectmodel::BaseObject *parent) | |
| void | computeRotation (RotationMatrix &rotationMatrix, const RotationMatrix &initialRotationMatrix, const std::array< sofa::Coord_t< DataTypes >, NumberOfNodesInElement > &nodesPosition, const std::array< sofa::Coord_t< DataTypes >, NumberOfNodesInElement > &nodesRestPosition) |
| void | selectRotationMethod () |
| sofa::Data< RotationMethodsItems > sofa::component::solidmechanics::fem::elastic::RotationMethodsContainer< DataTypes, ElementType, Methods >::d_rotationMethod |
|
staticconstexpr |
|
staticconstexpr |
|
inlineexplicit |
|
inline |
Computes the current rotation state relative to the initial configuration.
| rotationMatrix | Output: Current rotation matrix (relative to initial config) |
| initialRotationMatrix | Initial rotation matrix (for reference) |
| nodesPosition | Current positions of element nodes |
| nodesRestPosition | Rest positions of element nodes (initial configuration) |
|
inline |
Selects the rotation method based on the current index