Back

LinearSolverAccessor

sofa::core::behavior::LinearSolverAccessor
BaseObject
Doc (from source)

Base class for components requiring access to a linear solver

Abstract (AI generated)

`LinearSolverAccessor` provides derived components in SOFA with access to a linear solver for solving linear systems arising from numerical simulations.

Metadata
module
Sofa.framework.Core
namespace
sofa::core::behavior
include
sofa/core/behavior/LinearSolverAccessor.h
inherits
  • BaseObject
description

The LinearSolverAccessor is an abstract base class in the SOFA framework designed to provide components with access to a linear solver. This class plays a crucial role in enabling derived classes to solve linear systems that arise during numerical simulations, particularly within the context of finite element methods (FEM) and constrained dynamics.

Mathematical and Physical Description:

Governing Equations or Operators:

  • Linear System: The primary purpose of LinearSolverAccessor is to enable access to a solver for linear systems of equations of the form:
    $$ Ax = b $$

where $ A $ represents the system matrix (e.g., stiffness matrix, mass matrix), $ x $ is the vector of unknowns (e.g., displacements, velocities), and $ b $ is a vector representing external forces or constraints.

  • Role in FEM Pipeline: In the context of FEM simulations:
  • The linear system may represent the global tangent stiffness matrix $ K $ in nonlinear Newton-Raphson iterations:
    $$ K(x_k)δ x_k = -R(x_k) $$
  • It could also be part of the mass matrix $ M $ during implicit time integration schemes:
    $$ Mτ^2 + K(x_k) δx_k = f_{int}(x_k) - f_{ext} $$

Constitutive or Kinematic Laws:

  • Constitutive Models: The LinearSolverAccessor does not directly implement constitutive laws but provides a framework for solving the linear systems derived from such models. For example, hyperelastic potentials leading to nonlinear stress-strain relationships are solved using iterative methods that rely on linear solvers.

Numerical Methods or Discretization Choices:

  • Discretization: The LinearSolverAccessor is agnostic to specific discretization schemes but enables the solution of linear systems arising from spatial and temporal discretizations in FEM. This includes assembling global matrices such as mass, stiffness, and internal force contributions.

Role in Global FEM Pipeline:

  • Assembly Phase: During the assembly phase, LinearSolverAccessor ensures that components requiring a linear solver can access one for solving assembled systems.
  • Time Integration: In implicit time integration schemes, the component's role is critical for advancing the solution through iterative methods.

Constraint Handling and Mapping:

  • The LinearSolverAccessor does not directly handle constraints but provides solvers that can be used in conjunction with constraint projection or Lagrange multiplier methods to solve constrained systems of equations.

Summary:

  • Mathematical Content: While the component itself is abstract, it serves as a bridge for derived classes to access linear solvers necessary for solving linear systems arising from FEM and other numerical simulation methods.
  • Numerical Role: It ensures that components can efficiently solve linear systems via iterative or direct methods, contributing to the overall stability and accuracy of simulations.
Links
NameTypeHelp
l_linearSolver Linear solver used by this component
Methods
void init () virtual
{
  "name": "LinearSolverAccessor",
  "namespace": "sofa::core::behavior",
  "module": "Sofa.framework.Core",
  "include": "sofa/core/behavior/LinearSolverAccessor.h",
  "doc": "Base class for components requiring access to a linear solver",
  "inherits": [
    "BaseObject"
  ],
  "templates": [],
  "data_fields": [],
  "links": [
    {
      "name": "l_linearSolver",
      "target": "LinearSolver",
      "kind": "single",
      "xmlname": "linearSolver",
      "help": "Linear solver used by this component"
    }
  ],
  "methods": [
    {
      "name": "init",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `LinearSolverAccessor` is a base class in the SOFA framework that provides components with access to a linear solver, which is essential for solving linear systems often encountered in numerical simulations, particularly in finite element methods and constrained dynamics. This component inherits from `BaseObject`, indicating it follows SOFA's object model conventions.\n\n**Role and Purpose:**\n- The primary role of `LinearSolverAccessor` is to ensure that any derived components can access a linear solver required for their functionality.\n\n**Interactions with Other Components:*\n- It uses the `SingleLink` mechanism to connect to an instance of `LinearSolver`. This link (`l_linearSolver`) ensures that the accessor has a reference to the correct linear solver during simulation.\n- The `init()` method initializes this link, attempting to find and assign a suitable linear solver from the component's context if one is not already provided.\n\n**Practical Usage Guidance:*\n- Derived classes should inherit from `LinearSolverAccessor` when they require access to a linear solver for their operations.\n- The linear solver can be specified via the `linearSolver` link or auto-detected within the SOFA scene graph.\n- If no suitable linear solver is found, the component will be marked as invalid and an error message will be generated.",
  "maths": "The `LinearSolverAccessor` is an abstract base class in the SOFA framework designed to provide components with access to a linear solver. This class plays a crucial role in enabling derived classes to solve linear systems that arise during numerical simulations, particularly within the context of finite element methods (FEM) and constrained dynamics.\n\n### Mathematical and Physical Description:\n\n#### Governing Equations or Operators:\n- **Linear System:** The primary purpose of `LinearSolverAccessor` is to enable access to a solver for linear systems of equations of the form: \n  \\[ Ax = b \\]\n  where \\( A \\) represents the system matrix (e.g., stiffness matrix, mass matrix), \\( x \\) is the vector of unknowns (e.g., displacements, velocities), and \\( b \\) is a vector representing external forces or constraints.\n\n- **Role in FEM Pipeline:** In the context of FEM simulations:\n  - The linear system may represent the global tangent stiffness matrix \\( K \\) in nonlinear Newton-Raphson iterations: \n    \\[ K(x_k)δ x_k = -R(x_k) \\]\n  - It could also be part of the mass matrix \\( M \\) during implicit time integration schemes: \n    \\[ Mτ^2 + K(x_k) δx_k = f_{int}(x_k) - f_{ext} \\]\n\n#### Constitutive or Kinematic Laws:\n- **Constitutive Models:** The `LinearSolverAccessor` does not directly implement constitutive laws but provides a framework for solving the linear systems derived from such models. For example, hyperelastic potentials leading to nonlinear stress-strain relationships are solved using iterative methods that rely on linear solvers.\n\n#### Numerical Methods or Discretization Choices:\n- **Discretization:** The `LinearSolverAccessor` is agnostic to specific discretization schemes but enables the solution of linear systems arising from spatial and temporal discretizations in FEM. This includes assembling global matrices such as mass, stiffness, and internal force contributions.\n\n#### Role in Global FEM Pipeline:\n- **Assembly Phase:** During the assembly phase, `LinearSolverAccessor` ensures that components requiring a linear solver can access one for solving assembled systems.\n- **Time Integration:** In implicit time integration schemes, the component's role is critical for advancing the solution through iterative methods.\n\n#### Constraint Handling and Mapping:\n- The `LinearSolverAccessor` does not directly handle constraints but provides solvers that can be used in conjunction with constraint projection or Lagrange multiplier methods to solve constrained systems of equations.\n\n### Summary:\n- **Mathematical Content:** While the component itself is abstract, it serves as a bridge for derived classes to access linear solvers necessary for solving linear systems arising from FEM and other numerical simulation methods.\n- **Numerical Role:** It ensures that components can efficiently solve linear systems via iterative or direct methods, contributing to the overall stability and accuracy of simulations.",
  "abstract": "`LinearSolverAccessor` provides derived components in SOFA with access to a linear solver for solving linear systems arising from numerical simulations.",
  "sheet": "<h1>LinearSolverAccessor</h1>\n\n<h2>Overview</h2>\n<p>`LinearSolverAccessor` is an abstract base class that enables derived components within the SOFA framework to access and utilize a linear solver. This component ensures that any derived classes requiring a linear solver can efficiently solve linear systems of equations, which are essential for numerical simulations such as finite element methods (FEM) and constrained dynamics.</p>\n\n<h2>Dependencies and Connections</h2>\n<p>`LinearSolverAccessor` uses the `SingleLink` mechanism to connect to an instance of `LinearSolver`. The link (`l_linearSolver`) ensures that the accessor has a reference to the correct linear solver during simulation. The <code>init()</code> method initializes this link, attempting to find and assign a suitable linear solver from the component's context if one is not already provided.</p>"
}