iMSTK
Interactive Medical Simulation Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
imstkPbdEdgeEdgeConstraint.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 {
20 {
21 public:
23  ~PbdEdgeEdgeConstraint() override = default;
24 
25  IMSTK_TYPE_NAME(PbdEdgeEdgeConstraint)
26 
27 public:
37  void initConstraint(
38  const PbdParticleId& ptA1, const PbdParticleId& ptA2,
39  const PbdParticleId& ptB1, const PbdParticleId& ptB2,
40  double stiffnessA, double stiffnessB);
41 
48  bool computeValueAndGradient(PbdState& bodies,
49  double& c, std::vector<Vec3d>& dcdx) override;
50 };
51 } // namespace imstk
bool computeValueAndGradient(PbdState &bodies, double &c, std::vector< Vec3d > &dcdx) override
Compute value and gradient of constraint function.
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...
void initConstraint(const PbdParticleId &ptA1, const PbdParticleId &ptA2, const PbdParticleId &ptB1, const PbdParticleId &ptB2, double stiffnessA, double stiffnessB)
Initialize constraint.
Compound Geometry.
Resolves an edge given by two pbd particles to coincide with another edge.
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
Definition: imstkPbdBody.h:229