Back

Gravity

The **Gravity** component in SOFA is responsible for applying gravitational force to the simulation within world coordinates. It allows users to override the default gravity settings and specify custom gravity values. This component inherits from `ContextObject` and defines an essential data field, `f_gravity`, which represents the gravity vector in the world coordinate system. ### Role and Purpose: The Gravity component provides a means to simulate gravitational effects on objects within the simulation environment. It is particularly useful for scenarios where realistic physical interactions are required, such as simulating falling objects or the influence of gravity on soft tissues. ### Interactions with Other Components: The `Gravity` component interacts with the simulation context through its `apply()` method. This method modifies the gravity setting in the node's context, affecting how other mechanical components within the scene respond to gravitational forces. The interaction is indirect; the gravity value set by this component influences how mechanical objects and constraints behave during the simulation. ### Practical Usage Guidance: - Use the `gravity` data field (`f_gravity`) to specify the desired gravity vector in world coordinates. - This component should be added to a node within the SOFA scene graph where gravitational effects need to be applied. The specified gravity will affect all mechanical components under that node's context.

abstract
The Gravity component applies a specified gravitational force vector in world coordinates to mechanical objects within the simulation, allowing users to override default gravity settings.
sheet
# Gravity **Overview:** The **Gravity** component is responsible for applying a specified gravitational force vector \\( \vec{g} \\), defined in world coordinates, to all mechanical objects within its context. This allows users to customize the gravitational effects on the simulation environment. **Mathematical Model:* The gravitational force applied to an object with mass \\( m \\) is given by: egin{equation} \vec{F}_g = m \cdot \vec{g}, \end{equation} where \\( \vec{g} \\) is the gravitational acceleration vector in world coordinates. This force acts as an external body force influencing the motion and deformation of mechanical objects within the simulation. **Parameters and Data:* - **f_gravity (gravity):** - *Type:* `sofa::type::Vec3` - *Description:* Specifies the gravity vector in world coordinates. The default value is `[0, -9.81, 0]`, representing Earth's gravitational acceleration pointing downwards.
description
The **Gravity** component in SOFA is responsible for applying gravitational force to the simulation within world coordinates. It allows users to override the default gravity settings and specify custom gravity values. This component inherits from `ContextObject` and defines an essential data field, `f_gravity`, which represents the gravity vector in the world coordinate system. ### Role and Purpose: The Gravity component provides a means to simulate gravitational effects on objects within the simulation environment. It is particularly useful for scenarios where realistic physical interactions are required, such as simulating falling objects or the influence of gravity on soft tissues. ### Interactions with Other Components: The `Gravity` component interacts with the simulation context through its `apply()` method. This method modifies the gravity setting in the node's context, affecting how other mechanical components within the scene respond to gravitational forces. The interaction is indirect; the gravity value set by this component influences how mechanical objects and constraints behave during the simulation. ### Practical Usage Guidance: - Use the `gravity` data field (`f_gravity`) to specify the desired gravity vector in world coordinates. - This component should be added to a node within the SOFA scene graph where gravitational effects need to be applied. The specified gravity will affect all mechanical components under that node's context.
maths
<maths_description> ### Governing Equations or Operators: The **Gravity** component in SOFA modifies the gravitational force acting on mechanical objects within a simulation. The gravitational force is typically represented as a constant acceleration vector \(\vec{g}\) in world coordinates, which influences the motion of all mechanical components under its context. #### Gravitational Force: The gravitational force applied to an object with mass \(m\) can be expressed as: egin{equation} \vec{F}_g = m \cdot \vec{g}, ag{1} displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) displayed math equation (numbered) where \(\vec{g}\) is the gravitational acceleration vector in world coordinates, which can be specified as a 3D vector (e.g., \([0, -9.81, 0]\) for Earth's gravity pointing downwards). ### Constitutive Relations: The **Gravity** component does not introduce any additional constitutive relations beyond the standard gravitational force equation described above. ### Role in FEM or Other Numerical Methods: In the context of finite element methods (FEM) or other numerical integration schemes, the gravitational force acts as an external body force that influences the motion and deformation of mechanical objects. The force is typically applied to all nodal points within a domain, affecting their position and velocity over time. ### Role in FSI Simulations: The **Gravity** component plays a critical role in fluid-structure interaction (FSI) simulations by providing an external body force that influences the motion of both fluids and structures. In such simulations, gravity can affect the distribution of forces within the system and lead to coupled dynamic responses. ### Summary of Role: The **Gravity** component modifies the gravitational acceleration vector \(\vec{g}\), which is then used in subsequent computations involving mechanical objects' dynamics and interactions within a simulation environment. This external force affects the overall motion, deformation, and interaction behavior of the simulated system, particularly in gravity-sensitive scenarios such as fluid-structure interactions. </maths_description>
{
  "name": "Gravity",
  "main": {
    "name": "Gravity",
    "namespace": "sofa::component::mechanicalload",
    "module": "Sofa.Component.MechanicalLoad",
    "include": "sofa/component/mechanicalload/Gravity.h",
    "doc": "Gravity in world coordinates.\n\nOverride the default gravity */",
    "inherits": [
      "ContextObject"
    ],
    "templates": [],
    "data_fields": [
      {
        "name": "f_gravity",
        "type": "sofa::type::Vec3",
        "xmlname": "gravity",
        "help": "Gravity in the world coordinate system"
      }
    ],
    "links": [],
    "methods": [
      {
        "name": "apply",
        "return_type": "void",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      }
    ]
  },
  "desc": {
    "description": "The **Gravity** component in SOFA is responsible for applying gravitational force to the simulation within world coordinates. It allows users to override the default gravity settings and specify custom gravity values. This component inherits from `ContextObject` and defines an essential data field, `f_gravity`, which represents the gravity vector in the world coordinate system.\n\n### Role and Purpose:\nThe Gravity component provides a means to simulate gravitational effects on objects within the simulation environment. It is particularly useful for scenarios where realistic physical interactions are required, such as simulating falling objects or the influence of gravity on soft tissues.\n\n### Interactions with Other Components:\nThe `Gravity` component interacts with the simulation context through its `apply()` method. This method modifies the gravity setting in the node's context, affecting how other mechanical components within the scene respond to gravitational forces. The interaction is indirect; the gravity value set by this component influences how mechanical objects and constraints behave during the simulation.\n\n### Practical Usage Guidance:\n- Use the `gravity` data field (`f_gravity`) to specify the desired gravity vector in world coordinates.\n- This component should be added to a node within the SOFA scene graph where gravitational effects need to be applied. The specified gravity will affect all mechanical components under that node's context."
  },
  "maths": {
    "maths": "<maths_description>\n\n### Governing Equations or Operators:\n\nThe **Gravity** component in SOFA modifies the gravitational force acting on mechanical objects within a simulation. The gravitational force is typically represented as a constant acceleration vector \\(\\vec{g}\\) in world coordinates, which influences the motion of all mechanical components under its context.\n\n#### Gravitational Force:\nThe gravitational force applied to an object with mass \\(m\\) can be expressed as:\n\n\begin{equation}\n    \\vec{F}_g = m \\cdot \\vec{g},\n\tag{1}\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\ndisplayed math equation (numbered)\n\nwhere \\(\\vec{g}\\) is the gravitational acceleration vector in world coordinates, which can be specified as a 3D vector (e.g., \\([0, -9.81, 0]\\) for Earth's gravity pointing downwards).\n\n### Constitutive Relations:\nThe **Gravity** component does not introduce any additional constitutive relations beyond the standard gravitational force equation described above.\n\n### Role in FEM or Other Numerical Methods:\nIn the context of finite element methods (FEM) or other numerical integration schemes, the gravitational force acts as an external body force that influences the motion and deformation of mechanical objects. The force is typically applied to all nodal points within a domain, affecting their position and velocity over time.\n\n### Role in FSI Simulations:\nThe **Gravity** component plays a critical role in fluid-structure interaction (FSI) simulations by providing an external body force that influences the motion of both fluids and structures. In such simulations, gravity can affect the distribution of forces within the system and lead to coupled dynamic responses.\n\n### Summary of Role:\nThe **Gravity** component modifies the gravitational acceleration vector \\(\\vec{g}\\), which is then used in subsequent computations involving mechanical objects' dynamics and interactions within a simulation environment. This external force affects the overall motion, deformation, and interaction behavior of the simulated system, particularly in gravity-sensitive scenarios such as fluid-structure interactions.\n\n</maths_description>"
  },
  "summary": {
    "abstract": "The Gravity component applies a specified gravitational force vector in world coordinates to mechanical objects within the simulation, allowing users to override default gravity settings.",
    "sheet": "# Gravity\n\n**Overview:**\n\nThe **Gravity** component is responsible for applying a specified gravitational force vector \\\\( \\vec{g} \\\\), defined in world coordinates, to all mechanical objects within its context. This allows users to customize the gravitational effects on the simulation environment.\n\n**Mathematical Model:*\n\nThe gravitational force applied to an object with mass \\\\( m \\\\) is given by:\n\n\begin{equation}\n    \\vec{F}_g = m \\cdot \\vec{g},\n\\end{equation}\n\nwhere \\\\( \\vec{g} \\\\) is the gravitational acceleration vector in world coordinates. This force acts as an external body force influencing the motion and deformation of mechanical objects within the simulation.\n\n**Parameters and Data:*\n\n- **f_gravity (gravity):**\n  - *Type:* `sofa::type::Vec3`\n  - *Description:* Specifies the gravity vector in world coordinates. The default value is `[0, -9.81, 0]`, representing Earth's gravitational acceleration pointing downwards."
  }
}