iMSTK
Interactive Medical Simulation Toolkit
imstkPbdPointPointConstraint.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkPbdCollisionConstraint.h"
10 
11 namespace imstk
12 {
19 {
20 public:
22  ~PbdPointPointConstraint() override = default;
23 
24  IMSTK_TYPE_NAME(PbdPointPointConstraint)
25 
26 public:
30  void initConstraint(
31  const PbdParticleId& ptA, const PbdParticleId& ptB,
32  double stiffnessA, double stiffnessB);
33 
40  bool computeValueAndGradient(PbdState& bodies,
41  double& c, std::vector<Vec3d>& dcdx) override;
42 };
43 } // imstk
The PbdCollisionConstraint implements two sided collision. This allows the usage of differing stiffne...
std::pair< int, int > PbdParticleId
Index pair that refers to a particle in a PbdState. Index 0 is the body id, Index 1 is the particle i...
bool computeValueAndGradient(PbdState &bodies, double &c, std::vector< Vec3d > &dcdx) override
Compute value and gradient of constraint function.
Compound Geometry.
This constraint resolves two vertices to each other.
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
Definition: imstkPbdBody.h:229
void initConstraint(const PbdParticleId &ptA, const PbdParticleId &ptB, double stiffnessA, double stiffnessB)
Initialize constraint.