Back

PointProjectiveConstraint

sofa::component::constraint::projective::PointProjectiveConstraint
ProjectiveConstraintSet
Doc (from source)

Project particles to a point Attach given particles to their initial positions. Contrary to FixedConstraint, this one stops the particles even if they have a non-null initial velocity. @sa FixedConstraint

Abstract (AI generated)

The `PointProjectiveConstraint` projects specified particles to their initial positions, ensuring they remain fixed even if initially moving. It modifies response vectors and system matrices using Lagrange multipliers during assembly and time integration phases.

Metadata
module
Sofa.Component.Constraint.Projective
namespace
sofa::component::constraint::projective
include
sofa/component/constraint/projective/PointProjectiveConstraint.h
inherits
  • ProjectiveConstraintSet
templates
  • sofa::defaulttype::Vec3Types
description

The PointProjectiveConstraint is designed to enforce that specified particles remain at their initial positions, effectively stopping them even if they have non-null initial velocities. This constraint extends the ProjectiveConstraintSet, indicating its role in projecting mechanical data (positions and velocities) onto specific points.

Governing Equations and Operators:

  • Mass Matrix ( ext{M}): Although not explicitly manipulated within this component, the mass matrix is affected through constraints that modify the system's response to external forces. The constraint modifies the solution space of the dynamic equations by imposing conditions on certain degrees of freedom (DOFs).

  • Stiffness Matrix ( ext{K}): This component does not directly define or update the stiffness matrix; however, it influences how the linear solver handles constraints via modifications to the mass and damping matrices.

  • Internal Force Vector ( ext{f_{int}}): Constraints modify the internal force vector by adding Lagrange multipliers that enforce constraint equations. The constraint ensures that particles are fixed at their initial positions, which affects the residual vector in the nonlinear solve process.

Constitutive or Kinematic Laws:

  • Projection to Target Points: Particles specified via indices are projected to a target point defined as $\text{d_point} = ar{oldsymbol{x}}_0$, where $ar{oldsymbol{x}}_0$ is the initial position vector of these particles. The constraint modifies both the positions and velocities of these particles.

Role in Global FEM Pipeline:

  • Assembly: This component plays a role during assembly by modifying matrices and vectors related to constraints, such as applying zero Dirichlet boundary conditions to specific degrees of freedom.

  • Time Integration: Constraints are applied at each time step to ensure the particles remain fixed. The constraint impacts the linear solve phase within implicit integration schemes by enforcing that certain DOFs retain their initial values.

  • Nonlinear Solve: During the nonlinear solve, this component contributes to the residual vector by ensuring that constrained degrees of freedom do not move from their initial positions.

Numerical Methods and Discretization Choices:

  • Constraints Handling: The projectResponse, projectVelocity, and projectPosition methods project the response, velocity, and position vectors back to their initial values for the specified particles. This ensures that these particles are fixed at their target points.

  • Matrix Modification: Methods like applyConstraint modify the system matrix $\text{M}$ by setting rows and columns associated with constrained DOFs to ensure they remain fixed. This is done using Lagrange multipliers in a saddle-point problem formulation, ensuring that constraints are satisfied during the linear solve phase.

Variational/Lagrangian Mechanics Framework:

  • Variational Formulation: The constraint modifies the variational formulation by enforcing specific positions and velocities for certain particles through Lagrange multipliers. This is consistent with variational mechanics principles where constraints modify the action principle to enforce specific boundary conditions or initial conditions.

Summary:

The PointProjectiveConstraint enforces that specified particles remain at their initial positions, ensuring they are fixed even if they have non-null velocities initially. It achieves this by modifying response vectors and system matrices during assembly and time integration phases. The constraint is consistent with variational mechanics principles through the use of Lagrange multipliers to enforce specific positions for constrained degrees of freedom.

Data Fields
NameTypeDefaultHelp
d_point Coord Target of the projection
d_fixAll bool filter all the DOF to implement a fixed object
d_drawSize SReal Size of the rendered particles (0 -> point based rendering, >0 -> radius of spheres)
Links
NameTypeHelp
l_topology link to the topology container
Methods
void clearConstraints ()
void addConstraint (int index)
void removeConstraint (int index)
void init ()
void reinit ()
void projectResponse (const core::MechanicalParams * mparams, DataVecDeriv & resData)
void projectVelocity (const core::MechanicalParams * mparams, DataVecDeriv & vData)
void projectPosition (const core::MechanicalParams * mparams, DataVecCoord & xData)
void projectJacobianMatrix (const core::MechanicalParams * mparams, DataMatrixDeriv & cData)
void applyConstraint (const core::MechanicalParams * mparams, const sofa::core::behavior::MultiMatrixAccessor * matrix)
void applyConstraint (const core::MechanicalParams * mparams, linearalgebra::BaseVector * vector, const sofa::core::behavior::MultiMatrixAccessor * matrix)
void applyConstraint (sofa::core::behavior::ZeroDirichletCondition * matrix)
void projectMatrix (sofa::linearalgebra::BaseMatrix * , unsigned int )
void draw (const core::visual::VisualParams * vparams)
bool fixAllDOFs ()
{
  "name": "PointProjectiveConstraint",
  "namespace": "sofa::component::constraint::projective",
  "module": "Sofa.Component.Constraint.Projective",
  "include": "sofa/component/constraint/projective/PointProjectiveConstraint.h",
  "doc": "Project particles to a point\n\nAttach given particles to their initial positions.\nContrary to FixedConstraint, this one stops the particles even if they have a non-null initial velocity.\n@sa FixedConstraint",
  "inherits": [
    "ProjectiveConstraintSet"
  ],
  "templates": [
    "sofa::defaulttype::Vec3Types"
  ],
  "data_fields": [
    {
      "name": "d_point",
      "type": "Coord",
      "xmlname": "point",
      "help": "Target of the projection"
    },
    {
      "name": "d_fixAll",
      "type": "bool",
      "xmlname": "fixAll",
      "help": "filter all the DOF to implement a fixed object"
    },
    {
      "name": "d_drawSize",
      "type": "SReal",
      "xmlname": "drawSize",
      "help": "Size of the rendered particles (0 -> point based rendering, >0 -> radius of spheres)"
    }
  ],
  "links": [
    {
      "name": "l_topology",
      "target": "BaseMeshTopology",
      "kind": "single",
      "xmlname": "topology",
      "help": "link to the topology container"
    }
  ],
  "methods": [
    {
      "name": "clearConstraints",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "addConstraint",
      "return_type": "void",
      "params": [
        {
          "name": "index",
          "type": "int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "removeConstraint",
      "return_type": "void",
      "params": [
        {
          "name": "index",
          "type": "int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "init",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "reinit",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "projectResponse",
      "return_type": "void",
      "params": [
        {
          "name": "mparams",
          "type": "const core::MechanicalParams *"
        },
        {
          "name": "resData",
          "type": "DataVecDeriv &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "projectVelocity",
      "return_type": "void",
      "params": [
        {
          "name": "mparams",
          "type": "const core::MechanicalParams *"
        },
        {
          "name": "vData",
          "type": "DataVecDeriv &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "projectPosition",
      "return_type": "void",
      "params": [
        {
          "name": "mparams",
          "type": "const core::MechanicalParams *"
        },
        {
          "name": "xData",
          "type": "DataVecCoord &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "projectJacobianMatrix",
      "return_type": "void",
      "params": [
        {
          "name": "mparams",
          "type": "const core::MechanicalParams *"
        },
        {
          "name": "cData",
          "type": "DataMatrixDeriv &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "applyConstraint",
      "return_type": "void",
      "params": [
        {
          "name": "mparams",
          "type": "const core::MechanicalParams *"
        },
        {
          "name": "matrix",
          "type": "const sofa::core::behavior::MultiMatrixAccessor *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "applyConstraint",
      "return_type": "void",
      "params": [
        {
          "name": "mparams",
          "type": "const core::MechanicalParams *"
        },
        {
          "name": "vector",
          "type": "linearalgebra::BaseVector *"
        },
        {
          "name": "matrix",
          "type": "const sofa::core::behavior::MultiMatrixAccessor *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "applyConstraint",
      "return_type": "void",
      "params": [
        {
          "name": "matrix",
          "type": "sofa::core::behavior::ZeroDirichletCondition *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "projectMatrix",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "sofa::linearalgebra::BaseMatrix *"
        },
        {
          "name": "",
          "type": "unsigned int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "draw",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "const core::visual::VisualParams *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "fixAllDOFs",
      "return_type": "bool",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `PointProjectiveConstraint` is a component in the SOFA framework designed to project particles to specific target points, effectively fixing them at those positions. It extends `ProjectiveConstraintSet`, indicating its role as a constraint that operates on sets of mechanical data such as position and velocity.\n\nThis component interacts with other components via its API methods like `projectResponse`, `applyConstraint`, and `draw`. It also maintains links to the topology container through which it accesses particle indices. The component supports various vector types (e.g., Vec3, Vec2) for handling different dimensional data.\n\nThe primary purpose of this constraint is to enforce that specified particles remain at their initial positions, even if they had non-zero velocities initially. This behavior contrasts with the `FixedConstraint` where particles are fixed but may retain their initial velocity. The `PointProjectiveConstraint` provides methods to add and remove constraints on specific particle indices.\n\nUsers can configure the constraint by setting the target point (`d_point`) and determining whether all degrees of freedom should be fixed (`d_fixAll`). Additionally, the size for rendering these particles in the visual output is adjustable via `d_drawSize`. The component initializes itself based on the topology it links to, ensuring compatibility with the simulation context.",
  "maths": "The `PointProjectiveConstraint` is designed to enforce that specified particles remain at their initial positions, effectively stopping them even if they have non-null initial velocities. This constraint extends the `ProjectiveConstraintSet`, indicating its role in projecting mechanical data (positions and velocities) onto specific points.\n\n### Governing Equations and Operators:\n- **Mass Matrix (\text{M})**: Although not explicitly manipulated within this component, the mass matrix is affected through constraints that modify the system's response to external forces. The constraint modifies the solution space of the dynamic equations by imposing conditions on certain degrees of freedom (DOFs).\n\n- **Stiffness Matrix (\text{K})**: This component does not directly define or update the stiffness matrix; however, it influences how the linear solver handles constraints via modifications to the mass and damping matrices.\n\n- **Internal Force Vector (\text{f_{int}})**: Constraints modify the internal force vector by adding Lagrange multipliers that enforce constraint equations. The constraint ensures that particles are fixed at their initial positions, which affects the residual vector in the nonlinear solve process.\n\n### Constitutive or Kinematic Laws:\n- **Projection to Target Points**: Particles specified via indices are projected to a target point defined as \\(\\text{d_point} = \bar{\boldsymbol{x}}_0\\), where \\(\bar{\boldsymbol{x}}_0\\) is the initial position vector of these particles. The constraint modifies both the positions and velocities of these particles.\n\n### Role in Global FEM Pipeline:\n- **Assembly**: This component plays a role during assembly by modifying matrices and vectors related to constraints, such as applying zero Dirichlet boundary conditions to specific degrees of freedom.\n\n- **Time Integration**: Constraints are applied at each time step to ensure the particles remain fixed. The constraint impacts the linear solve phase within implicit integration schemes by enforcing that certain DOFs retain their initial values.\n\n- **Nonlinear Solve**: During the nonlinear solve, this component contributes to the residual vector by ensuring that constrained degrees of freedom do not move from their initial positions.\n\n### Numerical Methods and Discretization Choices:\n- **Constraints Handling**: The `projectResponse`, `projectVelocity`, and `projectPosition` methods project the response, velocity, and position vectors back to their initial values for the specified particles. This ensures that these particles are fixed at their target points.\n\n- **Matrix Modification**: Methods like `applyConstraint` modify the system matrix \\(\\text{M}\\) by setting rows and columns associated with constrained DOFs to ensure they remain fixed. This is done using Lagrange multipliers in a saddle-point problem formulation, ensuring that constraints are satisfied during the linear solve phase.\n\n### Variational/Lagrangian Mechanics Framework:\n- **Variational Formulation**: The constraint modifies the variational formulation by enforcing specific positions and velocities for certain particles through Lagrange multipliers. This is consistent with variational mechanics principles where constraints modify the action principle to enforce specific boundary conditions or initial conditions.\n\n### Summary:\nThe `PointProjectiveConstraint` enforces that specified particles remain at their initial positions, ensuring they are fixed even if they have non-null velocities initially. It achieves this by modifying response vectors and system matrices during assembly and time integration phases. The constraint is consistent with variational mechanics principles through the use of Lagrange multipliers to enforce specific positions for constrained degrees of freedom.",
  "abstract": "The `PointProjectiveConstraint` projects specified particles to their initial positions, ensuring they remain fixed even if initially moving. It modifies response vectors and system matrices using Lagrange multipliers during assembly and time integration phases.",
  "sheet": "\n# PointProjectiveConstraint\n\n## Overview\n\nThe `PointProjectiveConstraint` is a constraint component that projects specified particles to their initial positions, ensuring they remain fixed even if initially moving. It extends the `ProjectiveConstraintSet`, indicating its role in projecting mechanical data (positions and velocities) onto specific points.\n\n## Mathematical Model\n\n### Governing Equations and Operators:\n- **Mass Matrix (\text{M})**: Although not explicitly manipulated within this component, the mass matrix is affected through constraints that modify the system's response to external forces. The constraint modifies the solution space of the dynamic equations by imposing conditions on certain degrees of freedom (DOFs).\n\n- **Stiffness Matrix (\text{K})**: This component does not directly define or update the stiffness matrix; however, it influences how the linear solver handles constraints via modifications to the mass and damping matrices.\n\n- **Internal Force Vector (\text{f_{int}})**: Constraints modify the internal force vector by adding Lagrange multipliers that enforce constraint equations. The constraint ensures that particles are fixed at their initial positions, which affects the residual vector in the nonlinear solve process.\n\n### Constitutive or Kinematic Laws:\n- **Projection to Target Points**: Particles specified via indices are projected to a target point defined as \\(\\text{d_point} = \\bar{\\boldsymbol{x}}_0\\), where \\(\\bar{\\boldsymbol{x}}_0\\) is the initial position vector of these particles. The constraint modifies both the positions and velocities of these particles.\n\n## Parameters and Data\n\n- **`d_point`**: Target point for projection (type: Coord).\n- **`d_fixAll`**: Flag to fix all degrees of freedom (type: bool, default: false).\n- **`d_drawSize`**: Size for rendering the particles (type: SReal).\n\n## Dependencies and Connections\n\nThe component links to a `BaseMeshTopology` container to access particle indices. It interacts with other components via methods like `projectResponse`, `applyConstraint`, and `draw`.\n"
}