9 #include "imstkPbdCollisionConstraint.h" 31 double getRestLength()
const {
return m_restLength; }
32 void setRestLength(
const double length) { m_restLength = length; }
52 const std::vector<PbdParticleId>& ptIdsA,
53 const std::vector<double>& weightsA,
54 const std::vector<PbdParticleId>& ptIdsB,
55 const std::vector<double>& weightsB,
56 const double stiffnessA,
const double stiffnessB);
62 const std::vector<PbdParticleId>& ptIdsA,
63 const std::vector<double>& weightsA,
64 const std::vector<PbdParticleId>& ptIdsB,
65 const std::vector<double>& weightsB,
66 const double stiffnessA,
const double stiffnessB,
67 const double restLength = 0.0);
76 double& c, std::vector<Vec3d>& dcdx)
override;
84 double m_restLength = 0.0;
86 std::vector<double> m_weights;
The PbdCollisionConstraint implements two sided collision. This allows the usage of differing stiffne...
void initConstraint(const std::vector< PbdParticleId > &ptIdsA, const std::vector< double > &weightsA, const std::vector< PbdParticleId > &ptIdsB, const std::vector< double > &weightsB, const double stiffnessA, const double stiffnessB, const double restLength=0.0)
Initialize the constraint.
bool computeValueAndGradient(PbdState &bodies, double &c, std::vector< Vec3d > &dcdx) override
Compute value and gradient of constraint function.
Vec3d computeInterpolantDifference(PbdState &bodies) const
double getRestValue() const
Return the rest configuration for the constraint.
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
Constrains two points from two separate cells/elements given via barycentric coordinates to be coinci...
void initConstraintToRest(PbdState &bodies, const std::vector< PbdParticleId > &ptIdsA, const std::vector< double > &weightsA, const std::vector< PbdParticleId > &ptIdsB, const std::vector< double > &weightsB, const double stiffnessA, const double stiffnessB)
initialize constraint with current distance between the points as the resting length ...