Back

ParallelBruteForceBroadPhase

multithreading::component::collision::detection::algorithm::ParallelBruteForceBroadPhase
BruteForceBroadPhase, TaskSchedulerUser
Doc (from source)

Parallel version of the collision detection using extensive pair-wise tests performed concurrently. A parallel implementation of the component BruteForceBroadPhase The work is divided into n tasks executed in parallel. n is the number of threads available in the global thread pool.

Abstract (AI generated)

The `ParallelBruteForceBroadPhase` performs exhaustive pairwise collision detection using parallel computing techniques, enhancing simulation performance by dividing the workload into concurrent tasks.

Metadata
module
MultiThreading
namespace
multithreading::component::collision::detection::algorithm
include
MultiThreading/component/collision/detection/algorithm/ParallelBruteForceBroadPhase.h
inherits
  • BruteForceBroadPhase
  • TaskSchedulerUser
description
The `NNCGConstraintSolver` is designed to solve constrained dynamics problems formulated as Linear Complementarity Problems (LCPs) using the Non-smooth Non-linear Conjugate Gradient (NNS-NCG) method. This solver inherits from `BlockGaussSeidelConstraintSolver`, indicating that it performs iterative updates to achieve convergence on a solution that satisfies the constraints.

Governing Equations and Operators

Methods
void init () virtual
void addCollisionModel (sofa::core::CollisionModel * cm) virtual
void addCollisionModels (const int & v)
{
  "name": "ParallelBruteForceBroadPhase",
  "namespace": "multithreading::component::collision::detection::algorithm",
  "module": "MultiThreading",
  "include": "MultiThreading/component/collision/detection/algorithm/ParallelBruteForceBroadPhase.h",
  "doc": "Parallel version of the collision detection using extensive pair-wise tests performed concurrently.\n\nA parallel implementation of the component BruteForceBroadPhase\nThe work is divided into n tasks executed in parallel. n is the number of threads available in\nthe global thread pool.",
  "inherits": [
    "BruteForceBroadPhase",
    "TaskSchedulerUser"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "init",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addCollisionModel",
      "return_type": "void",
      "params": [
        {
          "name": "cm",
          "type": "sofa::core::CollisionModel *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addCollisionModels",
      "return_type": "void",
      "params": [
        {
          "name": "v",
          "type": "const int &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `ParallelBruteForceBroadPhase` is a component in SOFA's MultiThreading module that implements parallelized collision detection using exhaustive pairwise tests. It extends the standard `BruteForceBroadPhase`, distributing the workload across multiple threads to improve performance.\n\n**Role and Purpose:**\n- **Collision Detection:** This component performs exhaustive pairwise collision detection, ensuring all possible collisions are checked, but does so in a parallel fashion for efficiency.\n- **Parallel Execution:** It divides the task into smaller sub-tasks that can be executed concurrently using the available threads from the global thread pool. \n\n**Interactions with Other Components:*\n- The component inherits from `BruteForceBroadPhase` and `TaskSchedulerUser`, indicating its reliance on both collision detection algorithms and multithreading mechanisms.\n- It interacts with other components via methods like `addCollisionModel` and `addCollisionModels`, which register models for pairwise testing. These methods ensure that only relevant pairs are tested, thereby optimizing the process.\n\n**Usage Guidance:*\n- **Initialization:** The component initializes its thread pool during the `init()` method to prepare for parallel execution.\n- **Adding Collision Models:** Use `addCollisionModel` and `addCollisionModels` methods to register collision models that need to be tested against each other. These methods handle both self-collision detection and pairwise interactions.\n- **Parallel Tasks:** The component creates and manages tasks using the `TaskScheduler`, which divides the workload into smaller chunks for concurrent execution.",
  "maths": "The `ParallelBruteForceBroadPhase` is primarily concerned with collision detection in the context of FEM simulations within the SOFA framework. It extends the standard `BruteForceBroadPhase` by enabling parallel execution to improve computational efficiency. The mathematical and physical description focuses on its role in the broader simulation pipeline, rather than specific governing equations or operators related to continuum mechanics.\n\n### Role in Collision Detection:\n\n#### Governing Equations / Operators Involved:\n- **Collision Models**: This component operates at a higher level of abstraction compared to traditional FEM operators such as mass matrix \\(M\\), stiffness matrix \\(K\\), and internal force \\(f_{int}\\). Instead, it deals with collision models and their pairwise interactions. The primary goal is to detect intersections between pairs of collision models.\n\n#### Constitutive or Kinematic Laws Involved:\n- **Pair-Wise Tests**: It performs exhaustive pair-wise tests to determine if any collisions occur among the registered collision models. This involves checking for intersections using specific intersection methods and element intersector algorithms provided by SOFA's core collision detection mechanisms.\n\n### Role in the Global FEM Pipeline:\n\n#### Assembly Phase:\n- The component does not directly contribute to assembling global matrices or forces. Instead, it focuses on preparing and managing tasks related to collision detection.\n\n#### Time Integration:\n- Collision detection is a critical pre-processing step for time integration schemes used in FEM simulations. While `ParallelBruteForceBroadPhase` itself does not handle time integration, accurate and efficient collision detection ensures that the subsequent dynamics are correctly computed.\n\n#### Nonlinear Resolution:\n- The component's role in nonlinear resolution is indirect. By efficiently detecting collisions, it helps ensure that constraints (e.g., non-penetration) can be accurately enforced during the nonlinear solve phase.\n\n### Numerical Methods and Discretization Choices:\n\n#### Parallel Execution:\n- **Task Division**: It divides the collision detection task into smaller sub-tasks, each of which is assigned to a separate thread from the global thread pool. The number of threads used is determined by the available resources in the system.\n- **Concurrency**: This parallel execution approach significantly improves performance for large-scale simulations where exhaustive pairwise checks would otherwise be computationally expensive.\n\n#### Constraint Handling:\n- While not directly involved in enforcing constraints like Lagrange multipliers or projection methods, accurate collision detection provides the necessary information to enforce such constraints in subsequent stages of the simulation pipeline.\n\n### Variational / Lagrangian Mechanics Framework:\n\n#### Bridging Continuum Mechanics and Numerical Simulation:\n- The component operates at a higher level where it ensures that all pairwise interactions are considered. This is crucial for maintaining physical consistency, especially when dealing with deformable bodies that may come into contact or collision.\n\n### Summary:\n\nThe `ParallelBruteForceBroadPhase` enhances the efficiency of collision detection in SOFA simulations by leveraging parallel computing techniques. It does not directly contribute to governing equations such as mass and stiffness matrices but plays a critical role in ensuring accurate and efficient collision handling, which is essential for maintaining physical consistency in FEM-based simulations.",
  "abstract": "The `ParallelBruteForceBroadPhase` performs exhaustive pairwise collision detection using parallel computing techniques, enhancing simulation performance by dividing the workload into concurrent tasks.",
  "sheet": "\n# ParallelBruteForceBroadPhase\n\n**Overview:**\nThe `ParallelBruteForceBroadPhase` is a component in SOFA's MultiThreading module that extends the standard `BruteForceBroadPhase`. It performs exhaustive pairwise collision detection using parallel computing techniques, dividing the workload into smaller tasks for concurrent execution. This improves performance in large-scale simulations by leveraging multiple threads from the global thread pool.\n\n**Dependencies and Connections:**\nThe component inherits from `BruteForceBroadPhase` and `TaskSchedulerUser`, indicating its reliance on both collision detection algorithms and multithreading mechanisms. It interacts with other components via methods like `addCollisionModel` and `addCollisionModels`, which register models for pairwise testing.\n\n**Practical Notes:**\nThe component initializes its thread pool during the `init()` method to prepare for parallel execution. Use `addCollisionModel` and `addCollisionModels` methods to register collision models that need to be tested against each other, ensuring only relevant pairs are checked. The number of threads used is determined by the available resources in the system.\n"
}